new file: img/blocks/LARS.svg

new file:   img/blocks/LARS_BLH.svg
	new file:   img/blocks/LARS_BLL.svg
	new file:   img/blocks/LARS_BRH.svg
	new file:   img/blocks/LARS_BRL.svg
	new file:   img/blocks/LARS_FLH.svg
	new file:   img/blocks/LARS_FLL.svg
	new file:   img/blocks/LARS_FRH.svg
	new file:   img/blocks/LARS_FRL.svg
	new file:   img/blocks/acknowledgements.html
	new file:   lang/LARS.json
	modified:   lars_blocks.js
	modified:   src/LARS.cpp
	modified:   src/LARS.h
This commit is contained in:
roboticafacil 2017-12-12 00:01:01 +01:00
父節點 b5ac2d6875
當前提交 84f01d277b
共有 14 個文件被更改,包括 880 次插入346 次删除

65
img/blocks/LARS.svg Normal file
查看文件

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="75.938px"
height="75.938px"
viewBox="0 0 75.938 75.938"
style="enable-background:new 0 0 75.938 75.938;"
xml:space="preserve"
sodipodi:docname="LARS.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview39"
showgrid="false"
inkscape:zoom="4.3950905"
inkscape:cx="57.872316"
inkscape:cy="52.258221"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><path
d="m 62.689709,34.172256 c 5.866461,-5.260644 9.65833,-12.273531 9.65833,-20.165801 h 3.79803 V -0.02453734 H 63.379699 V 14.296103 h 3.79649 c 0,6.137418 -2.761504,11.982578 -7.246445,16.365143 L 49.581422,20.725779 H 26.117114 L 15.767251,30.661246 C 11.282311,26.278681 8.5223473,20.725779 8.5223473,14.296103 H 12.317296 V -0.02453734 H 0.24245728 V 14.296103 H 4.0374069 c 0,7.889662 3.7949495,14.905158 9.6598721,20.165801 -2.27833,7.961066 -2.099482,5.278205 0.003,13.443867 -4.1399459,3.799354 -7.2449047,8.475482 -8.9698817,13.736126 H 0.24553759 v 14.32064 H 13.010368 v -14.32064 h -2.759963 c 1.034986,-3.79805 3.449954,-7.015497 6.209918,-9.936772 l 10.004866,9.936772 h 23.461229 l 10.000246,-9.936772 c 3.10958,2.921275 5.176471,6.138722 6.211458,9.936772 h -2.761504 v 14.32064 h 12.76637 v -14.32064 h -4.831475 c -1.379982,-5.260644 -4.48494,-9.936772 -8.969881,-13.736126 1.652684,-8.801963 1.743027,-5.465526 0.348077,-13.733515 z"
id="path2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
style="stroke-width:1.41756129" /><g
id="g8" /><g
id="g10" /><g
id="g12" /><g
id="g14" /><g
id="g16" /><g
id="g18" /><g
id="g20" /><g
id="g22" /><g
id="g24" /><g
id="g26" /><g
id="g28" /><g
id="g30" /><g
id="g32" /><g
id="g34" /><g
id="g36" /></svg>

After

Width:  |  Height:  |  大小: 3.0 KiB

71
img/blocks/LARS_BLH.svg Normal file
查看文件

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="75.938px"
height="75.938px"
viewBox="0 0 75.938 75.938"
style="enable-background:new 0 0 75.938 75.938;"
xml:space="preserve"
sodipodi:docname="LARS_BLH.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview39"
showgrid="false"
inkscape:zoom="4.3950905"
inkscape:cx="57.872316"
inkscape:cy="52.258221"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><path
d="m 62.689709,34.172256 c 5.866461,-5.260644 9.65833,-12.273531 9.65833,-20.165801 h 3.79803 V -0.02453734 H 63.379699 V 14.296103 h 3.79649 c 0,6.137418 -2.761504,11.982578 -7.246445,16.365143 L 49.581422,20.725779 H 26.117114 L 15.767251,30.661246 C 11.282311,26.278681 8.5223473,20.725779 8.5223473,14.296103 H 12.317296 V -0.02453734 H 0.24245728 V 14.296103 H 4.0374069 c 0,7.889662 3.7949495,14.905158 9.6598721,20.165801 -2.27833,7.961066 -2.099482,5.278205 0.003,13.443867 -4.1399459,3.799354 -7.2449047,8.475482 -8.9698817,13.736126 H 0.24553759 v 14.32064 H 13.010368 v -14.32064 h -2.759963 c 1.034986,-3.79805 3.449954,-7.015497 6.209918,-9.936772 l 10.004866,9.936772 h 23.461229 l 10.000246,-9.936772 c 3.10958,2.921275 5.176471,6.138722 6.211458,9.936772 h -2.761504 v 14.32064 h 12.76637 v -14.32064 h -4.831475 c -1.379982,-5.260644 -4.48494,-9.936772 -8.969881,-13.736126 1.652684,-8.801963 1.743027,-5.465526 0.348077,-13.733515 z"
id="path2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
style="stroke-width:1.41756129" /><g
id="g8" /><g
id="g10" /><g
id="g12" /><g
id="g14" /><g
id="g16" /><g
id="g18" /><g
id="g20" /><g
id="g22" /><g
id="g24" /><g
id="g26" /><g
id="g28" /><g
id="g30" /><g
id="g32" /><g
id="g34" /><g
id="g36" /><ellipse
style="fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:110.7085495;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
id="path4525-2"
cx="18.429653"
cy="50.682549"
rx="7.3946142"
ry="7.508378" /></svg>

After

Width:  |  Height:  |  大小: 3.3 KiB

71
img/blocks/LARS_BLL.svg Normal file
查看文件

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="75.938px"
height="75.938px"
viewBox="0 0 75.938 75.938"
style="enable-background:new 0 0 75.938 75.938;"
xml:space="preserve"
sodipodi:docname="LARS_BLL.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview39"
showgrid="false"
inkscape:zoom="4.3950905"
inkscape:cx="57.872316"
inkscape:cy="52.258221"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><path
d="m 62.689709,34.172256 c 5.866461,-5.260644 9.65833,-12.273531 9.65833,-20.165801 h 3.79803 V -0.02453734 H 63.379699 V 14.296103 h 3.79649 c 0,6.137418 -2.761504,11.982578 -7.246445,16.365143 L 49.581422,20.725779 H 26.117114 L 15.767251,30.661246 C 11.282311,26.278681 8.5223473,20.725779 8.5223473,14.296103 H 12.317296 V -0.02453734 H 0.24245728 V 14.296103 H 4.0374069 c 0,7.889662 3.7949495,14.905158 9.6598721,20.165801 -2.27833,7.961066 -2.099482,5.278205 0.003,13.443867 -4.1399459,3.799354 -7.2449047,8.475482 -8.9698817,13.736126 H 0.24553759 v 14.32064 H 13.010368 v -14.32064 h -2.759963 c 1.034986,-3.79805 3.449954,-7.015497 6.209918,-9.936772 l 10.004866,9.936772 h 23.461229 l 10.000246,-9.936772 c 3.10958,2.921275 5.176471,6.138722 6.211458,9.936772 h -2.761504 v 14.32064 h 12.76637 v -14.32064 h -4.831475 c -1.379982,-5.260644 -4.48494,-9.936772 -8.969881,-13.736126 1.652684,-8.801963 1.743027,-5.465526 0.348077,-13.733515 z"
id="path2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
style="stroke-width:1.41756129" /><g
id="g8" /><g
id="g10" /><g
id="g12" /><g
id="g14" /><g
id="g16" /><g
id="g18" /><g
id="g20" /><g
id="g22" /><g
id="g24" /><g
id="g26" /><g
id="g28" /><g
id="g30" /><g
id="g32" /><g
id="g34" /><g
id="g36" /><rect
style="fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:7.77202845;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
id="rect4551-2"
width="12.764831"
height="14.320644"
x="0.24553759"
y="61.641895" /></svg>

After

Width:  |  Height:  |  大小: 3.3 KiB

71
img/blocks/LARS_BRH.svg Normal file
查看文件

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="75.938px"
height="75.938px"
viewBox="0 0 75.938 75.938"
style="enable-background:new 0 0 75.938 75.938;"
xml:space="preserve"
sodipodi:docname="LARS_BRH.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview39"
showgrid="false"
inkscape:zoom="4.3950905"
inkscape:cx="57.872316"
inkscape:cy="52.258221"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><path
d="m 62.689709,34.172256 c 5.866461,-5.260644 9.65833,-12.273531 9.65833,-20.165801 h 3.79803 V -0.02453734 H 63.379699 V 14.296103 h 3.79649 c 0,6.137418 -2.761504,11.982578 -7.246445,16.365143 L 49.581422,20.725779 H 26.117114 L 15.767251,30.661246 C 11.282311,26.278681 8.5223473,20.725779 8.5223473,14.296103 H 12.317296 V -0.02453734 H 0.24245728 V 14.296103 H 4.0374069 c 0,7.889662 3.7949495,14.905158 9.6598721,20.165801 -2.27833,7.961066 -2.099482,5.278205 0.003,13.443867 -4.1399459,3.799354 -7.2449047,8.475482 -8.9698817,13.736126 H 0.24553759 v 14.32064 H 13.010368 v -14.32064 h -2.759963 c 1.034986,-3.79805 3.449954,-7.015497 6.209918,-9.936772 l 10.004866,9.936772 h 23.461229 l 10.000246,-9.936772 c 3.10958,2.921275 5.176471,6.138722 6.211458,9.936772 h -2.761504 v 14.32064 h 12.76637 v -14.32064 h -4.831475 c -1.379982,-5.260644 -4.48494,-9.936772 -8.969881,-13.736126 1.652684,-8.801963 1.743027,-5.465526 0.348077,-13.733515 z"
id="path2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
style="stroke-width:1.41756129" /><g
id="g8" /><g
id="g10" /><g
id="g12" /><g
id="g14" /><g
id="g16" /><g
id="g18" /><g
id="g20" /><g
id="g22" /><g
id="g24" /><g
id="g26" /><g
id="g28" /><g
id="g30" /><g
id="g32" /><g
id="g34" /><g
id="g36" /><ellipse
style="fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:110.7085495;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
id="path4525-2"
cx="56.881649"
cy="49.089863"
rx="7.3946142"
ry="7.508378" /></svg>

After

Width:  |  Height:  |  大小: 3.3 KiB

71
img/blocks/LARS_BRL.svg Normal file
查看文件

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="75.938px"
height="75.938px"
viewBox="0 0 75.938 75.938"
style="enable-background:new 0 0 75.938 75.938;"
xml:space="preserve"
sodipodi:docname="LARS_BRL.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview39"
showgrid="false"
inkscape:zoom="4.3950905"
inkscape:cx="57.872316"
inkscape:cy="52.258221"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><path
d="m 62.689709,34.172256 c 5.866461,-5.260644 9.65833,-12.273531 9.65833,-20.165801 h 3.79803 V -0.02453734 H 63.379699 V 14.296103 h 3.79649 c 0,6.137418 -2.761504,11.982578 -7.246445,16.365143 L 49.581422,20.725779 H 26.117114 L 15.767251,30.661246 C 11.282311,26.278681 8.5223473,20.725779 8.5223473,14.296103 H 12.317296 V -0.02453734 H 0.24245728 V 14.296103 H 4.0374069 c 0,7.889662 3.7949495,14.905158 9.6598721,20.165801 -2.27833,7.961066 -2.099482,5.278205 0.003,13.443867 -4.1399459,3.799354 -7.2449047,8.475482 -8.9698817,13.736126 H 0.24553759 v 14.32064 H 13.010368 v -14.32064 h -2.759963 c 1.034986,-3.79805 3.449954,-7.015497 6.209918,-9.936772 l 10.004866,9.936772 h 23.461229 l 10.000246,-9.936772 c 3.10958,2.921275 5.176471,6.138722 6.211458,9.936772 h -2.761504 v 14.32064 h 12.76637 v -14.32064 h -4.831475 c -1.379982,-5.260644 -4.48494,-9.936772 -8.969881,-13.736126 1.652684,-8.801963 1.743027,-5.465526 0.348077,-13.733515 z"
id="path2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
style="stroke-width:1.41756129" /><g
id="g8" /><g
id="g10" /><g
id="g12" /><g
id="g14" /><g
id="g16" /><g
id="g18" /><g
id="g20" /><g
id="g22" /><g
id="g24" /><g
id="g26" /><g
id="g28" /><g
id="g30" /><g
id="g32" /><g
id="g34" /><g
id="g36" /><rect
style="fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:7.77249622;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
id="rect4551"
width="12.766374"
height="14.320638"
x="63.376617"
y="61.641895" /></svg>

After

Width:  |  Height:  |  大小: 3.3 KiB

71
img/blocks/LARS_FLH.svg Normal file
查看文件

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="75.938px"
height="75.938px"
viewBox="0 0 75.938 75.938"
style="enable-background:new 0 0 75.938 75.938;"
xml:space="preserve"
sodipodi:docname="LARS_FLH.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview39"
showgrid="false"
inkscape:zoom="4.3950905"
inkscape:cx="57.872316"
inkscape:cy="52.258221"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><path
d="m 62.689709,34.172256 c 5.866461,-5.260644 9.65833,-12.273531 9.65833,-20.165801 h 3.79803 V -0.02453734 H 63.379699 V 14.296103 h 3.79649 c 0,6.137418 -2.761504,11.982578 -7.246445,16.365143 L 49.581422,20.725779 H 26.117114 L 15.767251,30.661246 C 11.282311,26.278681 8.5223473,20.725779 8.5223473,14.296103 H 12.317296 V -0.02453734 H 0.24245728 V 14.296103 H 4.0374069 c 0,7.889662 3.7949495,14.905158 9.6598721,20.165801 -2.27833,7.961066 -2.099482,5.278205 0.003,13.443867 -4.1399459,3.799354 -7.2449047,8.475482 -8.9698817,13.736126 H 0.24553759 v 14.32064 H 13.010368 v -14.32064 h -2.759963 c 1.034986,-3.79805 3.449954,-7.015497 6.209918,-9.936772 l 10.004866,9.936772 h 23.461229 l 10.000246,-9.936772 c 3.10958,2.921275 5.176471,6.138722 6.211458,9.936772 h -2.761504 v 14.32064 h 12.76637 v -14.32064 h -4.831475 c -1.379982,-5.260644 -4.48494,-9.936772 -8.969881,-13.736126 1.652684,-8.801963 1.743027,-5.465526 0.348077,-13.733515 z"
id="path2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
style="stroke-width:1.41756129" /><g
id="g8" /><g
id="g10" /><g
id="g12" /><g
id="g14" /><g
id="g16" /><g
id="g18" /><g
id="g20" /><g
id="g22" /><g
id="g24" /><g
id="g26" /><g
id="g28" /><g
id="g30" /><g
id="g32" /><g
id="g34" /><g
id="g36" /><ellipse
style="fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:110.7085495;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
id="path4525-2"
cx="19.112232"
cy="32.480423"
rx="7.3946142"
ry="7.508378" /></svg>

After

Width:  |  Height:  |  大小: 3.3 KiB

71
img/blocks/LARS_FLL.svg Normal file
查看文件

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="75.938px"
height="75.938px"
viewBox="0 0 75.938 75.938"
style="enable-background:new 0 0 75.938 75.938;"
xml:space="preserve"
sodipodi:docname="LARS_FLL.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview39"
showgrid="false"
inkscape:zoom="4.3950905"
inkscape:cx="57.872316"
inkscape:cy="52.258221"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><path
d="m 62.689709,34.172256 c 5.866461,-5.260644 9.65833,-12.273531 9.65833,-20.165801 h 3.79803 V -0.02453734 H 63.379699 V 14.296103 h 3.79649 c 0,6.137418 -2.761504,11.982578 -7.246445,16.365143 L 49.581422,20.725779 H 26.117114 L 15.767251,30.661246 C 11.282311,26.278681 8.5223473,20.725779 8.5223473,14.296103 H 12.317296 V -0.02453734 H 0.24245728 V 14.296103 H 4.0374069 c 0,7.889662 3.7949495,14.905158 9.6598721,20.165801 -2.27833,7.961066 -2.099482,5.278205 0.003,13.443867 -4.1399459,3.799354 -7.2449047,8.475482 -8.9698817,13.736126 H 0.24553759 v 14.32064 H 13.010368 v -14.32064 h -2.759963 c 1.034986,-3.79805 3.449954,-7.015497 6.209918,-9.936772 l 10.004866,9.936772 h 23.461229 l 10.000246,-9.936772 c 3.10958,2.921275 5.176471,6.138722 6.211458,9.936772 h -2.761504 v 14.32064 h 12.76637 v -14.32064 h -4.831475 c -1.379982,-5.260644 -4.48494,-9.936772 -8.969881,-13.736126 1.652684,-8.801963 1.743027,-5.465526 0.348077,-13.733515 z"
id="path2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
style="stroke-width:1.41756129" /><g
id="g8" /><g
id="g10" /><g
id="g12" /><g
id="g14" /><g
id="g16" /><g
id="g18" /><g
id="g20" /><g
id="g22" /><g
id="g24" /><g
id="g26" /><g
id="g28" /><g
id="g30" /><g
id="g32" /><g
id="g34" /><g
id="g36" /><rect
style="fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:7.5590539;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
id="rect4551-2"
width="12.074839"
height="14.32064"
x="0.24245729"
y="-0.02453734" /></svg>

After

Width:  |  Height:  |  大小: 3.3 KiB

71
img/blocks/LARS_FRH.svg Normal file
查看文件

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="75.938px"
height="75.938px"
viewBox="0 0 75.938 75.938"
style="enable-background:new 0 0 75.938 75.938;"
xml:space="preserve"
sodipodi:docname="LARS_FRH.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview39"
showgrid="false"
inkscape:zoom="4.3950905"
inkscape:cx="57.872316"
inkscape:cy="52.258221"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><path
d="m 62.689709,34.172256 c 5.866461,-5.260644 9.65833,-12.273531 9.65833,-20.165801 h 3.79803 V -0.02453734 H 63.379699 V 14.296103 h 3.79649 c 0,6.137418 -2.761504,11.982578 -7.246445,16.365143 L 49.581422,20.725779 H 26.117114 L 15.767251,30.661246 C 11.282311,26.278681 8.5223473,20.725779 8.5223473,14.296103 H 12.317296 V -0.02453734 H 0.24245728 V 14.296103 H 4.0374069 c 0,7.889662 3.7949495,14.905158 9.6598721,20.165801 -2.27833,7.961066 -2.099482,5.278205 0.003,13.443867 -4.1399459,3.799354 -7.2449047,8.475482 -8.9698817,13.736126 H 0.24553759 v 14.32064 H 13.010368 v -14.32064 h -2.759963 c 1.034986,-3.79805 3.449954,-7.015497 6.209918,-9.936772 l 10.004866,9.936772 h 23.461229 l 10.000246,-9.936772 c 3.10958,2.921275 5.176471,6.138722 6.211458,9.936772 h -2.761504 v 14.32064 h 12.76637 v -14.32064 h -4.831475 c -1.379982,-5.260644 -4.48494,-9.936772 -8.969881,-13.736126 1.652684,-8.801963 1.743027,-5.465526 0.348077,-13.733515 z"
id="path2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
style="stroke-width:1.41756129" /><g
id="g8" /><g
id="g10" /><g
id="g12" /><g
id="g14" /><g
id="g16" /><g
id="g18" /><g
id="g20" /><g
id="g22" /><g
id="g24" /><g
id="g26" /><g
id="g28" /><g
id="g30" /><g
id="g32" /><g
id="g34" /><g
id="g36" /><ellipse
style="fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:110.7085495;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
id="path4525"
cx="57.751133"
cy="31.295048"
rx="7.3946142"
ry="7.508378" /></svg>

After

Width:  |  Height:  |  大小: 3.3 KiB

71
img/blocks/LARS_FRL.svg Normal file
查看文件

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="75.938px"
height="75.938px"
viewBox="0 0 75.938 75.938"
style="enable-background:new 0 0 75.938 75.938;"
xml:space="preserve"
sodipodi:docname="LARS_FRL.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview39"
showgrid="false"
inkscape:zoom="4.3950905"
inkscape:cx="57.872316"
inkscape:cy="52.258221"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><path
d="m 62.689709,34.172256 c 5.866461,-5.260644 9.65833,-12.273531 9.65833,-20.165801 h 3.79803 V -0.02453734 H 63.379699 V 14.296103 h 3.79649 c 0,6.137418 -2.761504,11.982578 -7.246445,16.365143 L 49.581422,20.725779 H 26.117114 L 15.767251,30.661246 C 11.282311,26.278681 8.5223473,20.725779 8.5223473,14.296103 H 12.317296 V -0.02453734 H 0.24245728 V 14.296103 H 4.0374069 c 0,7.889662 3.7949495,14.905158 9.6598721,20.165801 -2.27833,7.961066 -2.099482,5.278205 0.003,13.443867 -4.1399459,3.799354 -7.2449047,8.475482 -8.9698817,13.736126 H 0.24553759 v 14.32064 H 13.010368 v -14.32064 h -2.759963 c 1.034986,-3.79805 3.449954,-7.015497 6.209918,-9.936772 l 10.004866,9.936772 h 23.461229 l 10.000246,-9.936772 c 3.10958,2.921275 5.176471,6.138722 6.211458,9.936772 h -2.761504 v 14.32064 h 12.76637 v -14.32064 h -4.831475 c -1.379982,-5.260644 -4.48494,-9.936772 -8.969881,-13.736126 1.652684,-8.801963 1.743027,-5.465526 0.348077,-13.733515 z"
id="path2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
style="stroke-width:1.41756129" /><g
id="g8" /><g
id="g10" /><g
id="g12" /><g
id="g14" /><g
id="g16" /><g
id="g18" /><g
id="g20" /><g
id="g22" /><g
id="g24" /><g
id="g26" /><g
id="g28" /><g
id="g30" /><g
id="g32" /><g
id="g34" /><g
id="g36" /><rect
style="fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:7.77249622;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
id="rect4551"
width="12.766368"
height="14.32064"
x="63.3797"
y="-0.02453734" /></svg>

After

Width:  |  Height:  |  大小: 3.3 KiB

查看文件

@ -0,0 +1 @@
<div>Icons made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>

36
lang/LARS.json Normal file
查看文件

@ -0,0 +1,36 @@
{
"langs":
{
"en-GB":
{
"keys":
{
"LANG_LARS_INIT_TOOLTIP": "Defines the servo pins for a quadruped robot.",
"LANG_LARS_MOVEMENT": "Move robot",
"LANG_LARS_MOVEMENT_MOVEMENT": "Movement",
"LANG_LARS_MOVEMENT_HOME": "Home",
"LANG_LARS_MOVEMENT_WALK": "Walk",
"LANG_LARS_MOVEMENT_OMNIWALK": "Omni walk",
"LANG_LARS_MOVEMENT_TURN_LEFT": "Turn left",
"LANG_LARS_MOVEMENT_TURN_RIGHT": "Turn right",
"LANG_LARS_MOVEMENT_MOONWALK": "Moonwalk",
"LANG_LARS_MOVEMENT_DANCE": "Dance",
"LANG_LARS_MOVEMENT_UPDOWN": "Up-down",
"LANG_LARS_MOVEMENT_PUSHUP": "Push-up",
"LANG_LARS_MOVEMENT_HELLO": "Hello",
"LANG_LARS_MOVEMENT_WAVE": "Wave",
"LANG_LARS_MOVEMENT_LEG_NUMBER": "Leg number",
"LANG_LARS_MOVEMENT_STEPS": "Steps",
"LANG_LARS_MOVEMENT_PERIOD": "Period",
"LANG_LARS_MOVEMENT_DIR": "Direction",
"LANG_LARS_MOVEMENT_SIDE": "Side",
"LANG_LARS_MOVEMENT_TURN_FACTOR": "Turn factor",
"LANG_LARS_MOVEMENT_FORWARD": "Forward",
"LANG_LARS_MOVEMENT_BACKWARD": "Backward",
"LANG_LARS_MOVEMENT_YES": "Yes",
"LANG_LARS_MOVEMENT_NO": "No",
"LANG_LARS_MOVEMENT_TOOLTIP": "Generates movement primitives for a quadruped robot"
}
}
}
}

查看文件

@ -1,349 +1,200 @@
/*
Blockly.Blocks['espui_prepare_fs'] = {
category: 'ESPUI',
colour: '#3357c7',
helpUrl: Facilino.getHelpUrl('espui'),
tags: ['webinterface'],
examples: ['lol.bly'],
init: function() {
var wifiOptions = [
['No', false],
['Yes', true]
];
this.appendDummyInput()
.appendField('Prepare FileSystem (upload once without other in setup code, then omit)');
}
};
Facilino.LANG_COLOUR_MOVEMENT = '#CECE42';
Facilino.LANG_COLOUR_MOVEMENT_WALK = '#8D8D25';
Blockly.Arduino['espui_prepare_fs'] = function(block) {
var wifi_option = block.getFieldValue('wifi_option');
Blockly.Arduino.definitions_['define_espui_h'] = '#include <ESPUI.h>';
Blockly.Arduino.setups_['setup_espui'] = '\n';
Blockly.Arduino.setups_['setup_espui'] += ' ESPUI.prepareFileSystem();\n';
return null;
};
Blockly.Blocks['LARS_init'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_MOVEMENT'),
subcategory: Facilino.locales.getKey('LANG_SUBCATEGORY_WALK'),
helpUrl: Facilino.getHelpUrl('LARS_init'),
category_colour: Facilino.LANG_COLOUR_MOVEMENT,
colour: Facilino.LANG_COLOUR_MOVEMENT_WALK,
tags: [],
examples: [],
init: function () {
this.setPreviousStatement(true,'code');
this.setNextStatement(true,'code');
this.setColour(Facilino.LANG_COLOUR_MOVEMENT_WALK);
this.setTooltip(Facilino.locales.getKey('LANG_LARS_INIT_TOOLTIP'));
}
}
*/
Blockly.Blocks['walk_forward'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('walk_forward'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Walking");
this.setColour("#FF00FF");
this.setTooltip("");
Blockly.Arduino['LARS_movement'] = function() {
var code='';
var movement = this.getFieldValue('MOVEMENT');
if (movement==='0')
code+='lars.home();\n';
else if (movement==='1')
code+='lars.hello();\n';
else if (movement==='2')
code+='lars.wave('+(Blockly.Arduino.valueToCode(this, 'INP1', Blockly.Arduino.ORDER_ATOMIC) || '1')+');\n';
else if (movement==='3')
code+='lars.turnL('+(Blockly.Arduino.valueToCode(this, 'INP1', Blockly.Arduino.ORDER_ATOMIC) || '1')+','+(Blockly.Arduino.valueToCode(this, 'INP2', Blockly.Arduino.ORDER_ATOMIC) || '600')+');\n';
else if (movement==='4')
code+='lars.turnR('+(Blockly.Arduino.valueToCode(this, 'INP1', Blockly.Arduino.ORDER_ATOMIC) || '1')+','+(Blockly.Arduino.valueToCode(this, 'INP2', Blockly.Arduino.ORDER_ATOMIC) || '600')+');\n';
else if (movement==='5')
code+='lars.moonwalk('+(Blockly.Arduino.valueToCode(this, 'INP1', Blockly.Arduino.ORDER_ATOMIC) || '1')+','+(Blockly.Arduino.valueToCode(this, 'INP2', Blockly.Arduino.ORDER_ATOMIC) || '5000')+');\n';
else if (movement==='6')
code+='lars.dance('+(Blockly.Arduino.valueToCode(this, 'INP1', Blockly.Arduino.ORDER_ATOMIC) || '1')+','+(Blockly.Arduino.valueToCode(this, 'INP2', Blockly.Arduino.ORDER_ATOMIC) || '600')+');\n';
else if (movement==='7')
code+='lars.upDown('+(Blockly.Arduino.valueToCode(this, 'INP1', Blockly.Arduino.ORDER_ATOMIC) || '1')+','+(Blockly.Arduino.valueToCode(this, 'INP2', Blockly.Arduino.ORDER_ATOMIC) || '5000')+');\n';
else if (movement==='8')
code+='lars.pushUp('+(Blockly.Arduino.valueToCode(this, 'INP1', Blockly.Arduino.ORDER_ATOMIC) || '1')+','+(Blockly.Arduino.valueToCode(this, 'INP2', Blockly.Arduino.ORDER_ATOMIC) || '600')+');\n';
else if (movement==='9')
code+='lars.walk('+this.getFieldValue('FIELD3')+','+(Blockly.Arduino.valueToCode(this, 'INP1', Blockly.Arduino.ORDER_ATOMIC) || '1')+','+(Blockly.Arduino.valueToCode(this, 'INP2', Blockly.Arduino.ORDER_ATOMIC) || '800')+');\n';
else if (movement==='10')
code+='lars.omniWalk('+(Blockly.Arduino.valueToCode(this, 'INP1', Blockly.Arduino.ORDER_ATOMIC) || '1')+','+(Blockly.Arduino.valueToCode(this, 'INP2', Blockly.Arduino.ORDER_ATOMIC) || '800')+','+this.getFieldValue('FIELD3')+','+(Blockly.Arduino.valueToCode(this, 'INP4', Blockly.Arduino.ORDER_ATOMIC) || '0')+');\n';
return code;
}
}
};
Blockly.Arduino['walk_forward'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.walk();\n';
code+= '\n';
return code;
};
Blockly.Blocks['walk_backward'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('walk_backward'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Walking_Back");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['walk_backward'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.walk(0);\n';
code+= '\n';
return code;
};
Blockly.Blocks['Turn_R'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('Turn_R'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Turn_Right");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['Turn_R'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.turnR(1, 550);\n';
code+= '\n';
return code;
};
Blockly.Blocks['Turn_L'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('Turn_L'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Turn_Left");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['Turn_L'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.turnL(1, 550);\n';
code+= '\n';
return code;
};
Blockly.Blocks['PushUp'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('PushUp'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Push_Up");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['PushUp'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.pushUp(1, 600);\n';
code+= '\n';
return code;
};
Blockly.Blocks['UpDown'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('UpDown'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Up_Down");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['UpDown'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.upDown(1, 5000);\n';
code+= '\n';
return code;
};
Blockly.Blocks['Dance'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('Dance'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Dance");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['Dance'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.dance(1, 600);\n';
code+= '\n';
return code;
};
Blockly.Blocks['Wave'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('Wave'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Wave");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['Wave'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.wave();\n';
code+= '\n';
return code;
};
Blockly.Blocks['Slow_Turn_R'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('Slow_Turn_R'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Slow_Turn_Right");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['Slow_Turn_R'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.omniWalk(1, 600, true, 1);\n';
code+= '\n';
return code;
};
Blockly.Blocks['Slow_Turn_L'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('Slow_Turn_L'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Slow_Turn_Left");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['Slow_Turn_L'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.omniWalk(1, 600, false, 1);\n';
code+= '\n';
return code;
};
Blockly.Blocks['MoonWalk'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('MoonWalk'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Moonwalk");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['MoonWalk'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.moonwalkL(1, 5000);\n';
code+= '\n';
return code;
};
Blockly.Blocks['Hello'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_BLOCKS'),
helpUrl: Facilino.getHelpUrl('Hello'),
tags: [],
examples: [],
init: function() {
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.appendDummyInput()
.appendField("Audience_Hello");
this.setColour("#FF00FF");
this.setTooltip("");
}
};
Blockly.Arduino['Hello'] = function(block) {
Blockly.Arduino.setups_['setup_']='robot.init();\n ';
var input_shall_walk = Blockly.Arduino.valueToCode(block, 'shall_walk', Blockly.Arduino.ORDER_ATOMIC);
Blockly.Arduino.definitions_['define_lars_h']='#include <LARS.h>';
Blockly.Arduino.definitions_['declare_var_define_robot']='LARS robot;';
var code='';
code+='robot.hello();\n';
code+= '\n';
return code;
};
Blockly.Blocks['LARS_movement'] = {
category: Facilino.locales.getKey('LANG_CATEGORY_MOVEMENT'),
subcategory: Facilino.locales.getKey('LANG_SUBCATEGORY_WALK'),
tags: [],
helpUrl: Facilino.getHelpUrl('LARS_movement'),
examples: [],
category_colour: Facilino.LANG_COLOUR_MOVEMENT,
colour: Facilino.LANG_COLOUR_MOVEMENT_WALK,
init: function() {
this.setColour(Facilino.LANG_COLOUR_MOVEMENT_WALK);
var movement = new Blockly.FieldDropdown([
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_HOME'),'0'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_HELLO'),'1'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_WAVE'),'2'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_TURN_LEFT'),'3'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_TURN_RIGHT'),'4'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_MOONWALK'),'5'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_DANCE'),'6'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_UPDOWN'),'7'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_PUSHUP'),'8'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_WALK'),'9'],
[Facilino.locales.getKey('LANG_LARS_MOVEMENT_OMNIWALK'),'10']
]);
this.appendDummyInput().appendField(new Blockly.FieldImage('img/blocks/LARS.svg', 32*options.zoom, 32*options.zoom)).appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT'));
this.appendDummyInput('').appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_MOVEMENT')).appendField(movement,'MOVEMENT').setAlign(Blockly.ALIGN_RIGHT);
this.last_movement = -1;
this._inp1_removed = true;
this._inp2_removed = true;
this._inp3_removed = true;
this._inp4_removed = true;
this.checkMovement();
this.last_movement = this.getFieldValue('MOVEMENT');
this.setInputsInline(false);
this.setPreviousStatement(true,'code');
this.setNextStatement(true,'code');
this.setOutput(false);
this.setTooltip(Facilino.locales.getKey('LANG_LARS_MOVEMENT_TOOLTIP'));
},
checkMovement: function() {
var _movement = this.getFieldValue('MOVEMENT');
try {
if (_movement<10)
{
this._inp4_removed=true;
this.removeInput('INP4');
}
} catch (e) {}
try {
if (_movement<9)
{
this._inp3_removed=true;
this.removeInput('INP3');
}
} catch (e) {}
try {
if (_movement<3)
{
this._inp2_removed=true;
this.removeInput('INP2');
}
} catch (e) {}
try {
if (_movement<2)
{
this._inp1_removed=true;
this.removeInput('INP1');
}
} catch (e) {}
if ( _movement === '2') {
if (this._inp1_removed)
{
this.appendValueInput('INP1').setCheck(Number).appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_LEG_NUMBER'),'TEXT1').setAlign(Blockly.ALIGN_RIGHT);
this._inp1_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_LEG_NUMBER'),'TEXT1');}catch (e) {}
} else if (( _movement >= '3')&&( _movement <= '8')) {
if (this._inp1_removed)
{
this.appendValueInput('INP1').setCheck(Number).appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_STEPS'),'TEXT1').setAlign(Blockly.ALIGN_RIGHT);
this._inp1_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_STEPS'),'TEXT1');}catch (e) {}
if (this._inp2_removed)
{
this.appendValueInput('INP2').setCheck(Number).appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_PERIOD','TEXT2')).setAlign(Blockly.ALIGN_RIGHT);
this._inp2_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_PERIOD'),'TEXT2');}catch (e) {}
} else if ( _movement === '9') {
if (this._inp1_removed)
{
this.appendValueInput('INP1').setCheck(Number).appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_STEPS'),'TEXT1').setAlign(Blockly.ALIGN_RIGHT);
this._inp1_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_STEPS'),'TEXT1');}catch (e) {}
if (this._inp2_removed)
{
this.appendValueInput('INP2').setCheck(Number).appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_PERIOD'),'TEXT2').setAlign(Blockly.ALIGN_RIGHT);
this._inp2_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_PERIOD'),'TEXT2');}catch (e) {}
if (this._inp3_removed)
{
this.appendDummyInput('INP3').appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_DIR'),'TEXT3').appendField(new Blockly.FieldDropdown([['Forward','0'],['Backward','1']]),'FIELD3').setAlign(Blockly.ALIGN_RIGHT);
this._inp3_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_DIR'),'TEXT3'); this.getInput('INP3').removeField('FIELD3'); this.getInput('INP3').appendField(new Blockly.FieldDropdown([['Forward','0'],['Backward','1']]),'FIELD3');}catch (e) {}
}
else if ( _movement === '10') {
if (this._inp1_removed)
{
this.appendValueInput('INP1').setCheck(Number).appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_STEPS'),'TEXT1').setAlign(Blockly.ALIGN_RIGHT);
this._inp1_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_STEPS'),'TEXT1');}catch (e) {}
if (this._inp2_removed)
{
this.appendValueInput('INP2').setCheck(Number).appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_PERIOD'),'TEXT2').setAlign(Blockly.ALIGN_RIGHT);
this._inp2_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_PERIOD'),'TEXT2');}catch (e) {}
if (this._inp3_removed)
{
this.appendDummyInput('INP3').appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_DIR'),'TEXT3').appendField(new Blockly.FieldDropdown([['Yes','true'],['No','false']]),'FIELD3').setAlign(Blockly.ALIGN_RIGHT);
this._inp3_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_SIDE'),'TEXT3'); this.getInput('INP3').removeField('FIELD3'); this.getInput('INP3').appendField(new Blockly.FieldDropdown([['Yes','true'],['No','false']]),'FIELD3');}catch (e) {}
if (this._inp4_removed)
{
this.appendValueInput('INP4').setCheck(Number).appendField(Facilino.locales.getKey('LANG_LARS_MOVEMENT_TURN_FACTOR'),'TEXT4').setAlign(Blockly.ALIGN_RIGHT);
this._inp4_removed=false;
}
else
try{this.setFieldValue(Facilino.locales.getKey('LANG_LARS_MOVEMENT_TURN_FACTOR'),'TEXT4');}catch (e) {}
}
},
onchange: function() {
if (this.getFieldValue('MOVEMENT') !== this.last_movement) {
this.checkMovement();
this.last_movement = this.getFieldValue('MOVEMENT');
}
}
};

查看文件

@ -59,6 +59,18 @@ void LARS::init() {
home();
}
void init(int FRH, int FLH, int BRH, int BLH, int FRL, int FLL, int BRL, int BLL)
{
board_pins[FRONT_RIGHT_HIP] = FRH; // front right inner
board_pins[FRONT_LEFT_HIP] = FLH; // front left inner
board_pins[BACK_RIGHT_HIP] = BRH; // back right inner
board_pins[BACK_LEFT_HIP] = BLH; // back left inner
board_pins[FRONT_RIGHT_LEG] = FRL; // front right outer
board_pins[FRONT_LEFT_LEG] = FLL; // front left outer // POSITIONS LOOKING FROM THE MIDDLE OF THE ROBOT!!!!!
board_pins[BACK_RIGHT_LEG] = BRL; // back right outer
board_pins[BACK_LEFT_LEG] = BLL; // back left outer
}
void LARS::turnR(float steps, float T = 600) {
//int x_amp = 15;
//int z_amp = 15;

查看文件

@ -20,6 +20,7 @@ class LARS {
public:
LARS();
void init();
void init(int FRH, int FLH, int BRH, int BLH, int FRL, int FLL, int BRL, int BLL);
void walk(int dir = 1, float steps = 1, float T = 800); // T initial 400
void omniWalk(float steps, float T, bool side, float turn_factor);
void turnL(float steps, float period);