Skip to content

Commit 5485411

Browse files
author
Antonio Vivace
authored
Add AR demo program
1 parent f964936 commit 5485411

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"dom_code": "<xml xmlns=\"http://www.w3.org/1999/xhtml\"><variables><variable type=\"\" id=\"t0%]}C@b{,qd7|sPe9zc\">tag_map</variable><variable type=\"\" id=\"6J?]Su~9cMcJ?1k)5D+=\">code</variable><variable type=\"\" id=\"w5)*3TcHccLvv^WOkh`c\">lista</variable><variable type=\"\" id=\"1J4H~VmQG*H$]$Q_:B__\">codes</variable><variable type=\"\" id=\"NC[lQ:--CtUITd)_|c$p\">positions</variable></variables><block type=\"controls_whileUntil\" id=\"@h-]#0?:MKRG}h:8:^x9\" x=\"-30\" y=\"144\"><field name=\"MODE\">WHILE</field><value name=\"BOOL\"><block type=\"logic_boolean\" id=\"#`fvr:O?_:Ttu0Bf{!]|\"><field name=\"BOOL\">TRUE</field></block></value><statement name=\"DO\"><block type=\"variables_set\" id=\"=^-j5Ga1MVnuBee97Y@C\"><field name=\"VAR\" id=\"t0%]}C@b{,qd7|sPe9zc\" variabletype=\"\">tag_map</field><value name=\"VALUE\"><block type=\"coderbot_adv_findARCode\" id=\"s#f+e.r41WtcACO*8E@R\"></block></value><next><block type=\"variables_set\" id=\"#WGMDf[e(XBFiFV~%T{/\"><field name=\"VAR\" id=\"1J4H~VmQG*H$]$Q_:B__\" variabletype=\"\">codes</field><value name=\"VALUE\"><block type=\"hashmap_get_value\" id=\"8n882RO_@|$b|*I#O`vD\"><value name=\"key\"><block type=\"text\" id=\"o)iJvT6q3wE1n$|w?}@W\"><field name=\"TEXT\">codes</field></block></value><value name=\"map\"><block type=\"variables_get\" id=\"jCx{KU9(=6P@.|peNlXN\"><field name=\"VAR\" id=\"t0%]}C@b{,qd7|sPe9zc\" variabletype=\"\">tag_map</field></block></value></block></value><next><block type=\"variables_set\" id=\"bD=(HSHU48zl0{-/~noc\"><field name=\"VAR\" id=\"NC[lQ:--CtUITd)_|c$p\" variabletype=\"\">positions</field><value name=\"VALUE\"><block type=\"hashmap_get_value\" id=\"#vbA+ig3tU@xSb1A|_w2\"><value name=\"key\"><block type=\"text\" id=\"i9_5n1O#`=t.~U,8FpGw\"><field name=\"TEXT\">positions</field></block></value><value name=\"map\"><block type=\"variables_get\" id=\"_JBza([QOX!qv/3VdYg9\"><field name=\"VAR\" id=\"t0%]}C@b{,qd7|sPe9zc\" variabletype=\"\">tag_map</field></block></value></block></value><next><block type=\"controls_if\" id=\"OGk43S34JND/,jXGeVxz\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"0JLvc%7rD_C|!6cqFw-$\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"lists_length\" id=\"J_lY]]zCbQ[u!MMD-Id2\"><value name=\"VALUE\"><block type=\"variables_get\" id=\"kD{*,b/[9X1eU%FDp-mJ\"><field name=\"VAR\" id=\"1J4H~VmQG*H$]$Q_:B__\" variabletype=\"\">codes</field></block></value></block></value><value name=\"B\"><block type=\"math_number\" id=\"EL*s.|ZMPGGbeVRYLFL8\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\" id=\"}|0Q`9cnLb|W)A4rACn(\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"SCm%!EpAerkyxrIF#P,5\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"lists_getIndex\" id=\"0NuaF,a-Mq%n]0F5yO71\"><mutation statement=\"false\" at=\"false\"></mutation><field name=\"MODE\">GET</field><field name=\"WHERE\">LAST</field><value name=\"VALUE\"><block type=\"lists_getIndex\" id=\"h*z9nE!]v$fkNq=L9Z1~\"><mutation statement=\"false\" at=\"false\"></mutation><field name=\"MODE\">GET</field><field name=\"WHERE\">FIRST</field><value name=\"VALUE\"><block type=\"variables_get\" id=\"TufaIZ~qb|Vm:zW)ks^F\"><field name=\"VAR\" id=\"NC[lQ:--CtUITd)_|c$p\" variabletype=\"\">positions</field></block></value></block></value></block></value><value name=\"B\"><block type=\"math_number\" id=\"PCV}Dn!d_nmNHl([4UL8\"><field name=\"NUM\">150</field></block></value></block></value><statement name=\"DO0\"><block type=\"variables_set\" id=\"k,p,V2i8b9cLa+XvIA1(\"><field name=\"VAR\" id=\"6J?]Su~9cMcJ?1k)5D+=\" variabletype=\"\">code</field><value name=\"VALUE\"><block type=\"lists_getIndex\" id=\":+(Y+3IFohgd9%TmK,~h\"><mutation statement=\"false\" at=\"false\"></mutation><field name=\"MODE\">GET</field><field name=\"WHERE\">FIRST</field><value name=\"VALUE\"><block type=\"variables_get\" id=\"@3wq8S#-um/Akpz8P@)N\"><field name=\"VAR\" id=\"1J4H~VmQG*H$]$Q_:B__\" variabletype=\"\">codes</field></block></value></block></value><next><block type=\"text_print\" id=\"{9n*QwIw`Xz2rr%]!||i\"><value name=\"TEXT\"><block type=\"variables_get\" id=\"g(BLm4y~J!I]Is)_+e.G\"><field name=\"VAR\" id=\"1J4H~VmQG*H$]$Q_:B__\" variabletype=\"\">codes</field></block></value><next><block type=\"controls_if\" id=\"a-*{EC|T*!~|Jy1T;ky#\"><mutation elseif=\"4\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"vBhZBNkW2fzfWPMBh7PA\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get\" id=\"|hM?o_^1/MjiZMk9f-Hi\"><field name=\"VAR\" id=\"6J?]Su~9cMcJ?1k)5D+=\" variabletype=\"\">code</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"T)cl7En!l}Tz;C{RAQmS\"><field name=\"NUM\">1</field></block></value></block></value><statement name=\"DO0\"><block type=\"coderbot_adv_move\" id=\"Qf$Tb:D7*.]1HC0#SV-w\"><field name=\"ACTION\">FORWARD</field><value name=\"SPEED\"><block type=\"math_number\" id=\"),wc.^}!FuO^[.fR5q+.\"><field name=\"NUM\">100</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"LvWv=:PuvKwdQKUqC!?Y\"><field name=\"NUM\">1</field></block></value><next><block type=\"coderbot_adv_move\" id=\"ks-wQ/9rha8HgY/5D7h8\"><field name=\"ACTION\">LEFT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"QC$[#;#k/{[cXjT9|rFM\"><field name=\"NUM\">100</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"r7k/daFIIP-h9r4]b*[I\"><field name=\"NUM\">1</field></block></value></block></next></block></statement><value name=\"IF1\"><block type=\"logic_compare\" id=\"1Bn+v{5X{t^w6~QWeM49\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get\" id=\"eortt4PGO/b|wmiM5W[m\"><field name=\"VAR\" id=\"6J?]Su~9cMcJ?1k)5D+=\" variabletype=\"\">code</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"lmmlOegf8o|uu},4OJNW\"><field name=\"NUM\">2</field></block></value></block></value><statement name=\"DO1\"><block type=\"coderbot_adv_move\" id=\"w$$-?Uh:1Rl@;`E*Av6C\"><field name=\"ACTION\">FORWARD</field><value name=\"SPEED\"><block type=\"math_number\" id=\"F:8LVYpTX]{Ox!iCa[U*\"><field name=\"NUM\">100</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"O)?`ZH~wDS@v!2JAwVA8\"><field name=\"NUM\">3</field></block></value></block></statement><value name=\"IF2\"><block type=\"logic_compare\" id=\";I.JQ{LcQebMq+Nm7o?I\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get\" id=\"|/1VTr97/4/eDb~hP?{g\"><field name=\"VAR\" id=\"6J?]Su~9cMcJ?1k)5D+=\" variabletype=\"\">code</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"{/N?L?9p9,Vpq9+JpM+}\"><field name=\"NUM\">3</field></block></value></block></value><statement name=\"DO2\"><block type=\"coderbot_adv_move\" id=\"[.uLTR$Q5eNd8!6wtvt=\"><field name=\"ACTION\">FORWARD</field><value name=\"SPEED\"><block type=\"math_number\" id=\"Qzrz#P^X_/TaN@zz_wv`\"><field name=\"NUM\">100</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"XLk{ic:(6Z=]u-mXr$5#\"><field name=\"NUM\">1</field></block></value><next><block type=\"coderbot_adv_move\" id=\"VbCuoNCr6`._jSHeX}u%\"><field name=\"ACTION\">RIGHT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"fuihEymc@dwWL(CFQTX#\"><field name=\"NUM\">100</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"sm0p34bg|Tw%*:JTUF_i\"><field name=\"NUM\">1</field></block></value></block></next></block></statement><value name=\"IF3\"><block type=\"logic_compare\" id=\"Ma(^bi?_`^YErYgp4h,P\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get\" id=\"r@fO;U{M?YQ=Fj9rJJtD\"><field name=\"VAR\" id=\"6J?]Su~9cMcJ?1k)5D+=\" variabletype=\"\">code</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"F./nuSmkfx;j=a.Xb||H\"><field name=\"NUM\">4</field></block></value></block></value><statement name=\"DO3\"><block type=\"controls_repeat_ext\" id=\"!*8%}BA^?C8ncHv`O=y;\"><value name=\"TIMES\"><block type=\"math_number\" id=\"mmRw*r1VW@9EOf*~U`(:\"><field name=\"NUM\">2</field></block></value><statement name=\"DO\"><block type=\"coderbot_adv_move\" id=\"h|=HGhp,p%JLZ6SjVA]d\"><field name=\"ACTION\">RIGHT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"ZM(/`ez$r4zl0JJXT(4v\"><field name=\"NUM\">100</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"7j.A;~YcadM%5QQe2n{R\"><field name=\"NUM\">0.5</field></block></value><next><block type=\"coderbot_adv_move\" id=\"YI6yNSOV`Zs^(Ys}w{A4\"><field name=\"ACTION\">LEFT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"Co1AlC0ej9L8xK:DuSzB\"><field name=\"NUM\">100</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"E3tV*]cN%|8g@UilswEz\"><field name=\"NUM\">0.5</field></block></value></block></next></block></statement><next><block type=\"coderbot_audio_say\" id=\"6IK2cc.l8ZX7+=V*IFjT\"><field name=\"LOCALE\">it</field><value name=\"TEXT\"><block type=\"text\" id=\"+%T8MdX}|,B;r,=+S|Nj\"><field name=\"TEXT\">Sono arrivato!</field></block></value></block></next></block></statement><value name=\"IF4\"><block type=\"logic_compare\" id=\"unM/bY{:-`/BAwdbil*~\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get\" id=\")HXZ]{NR`iX]-+gBKya6\"><field name=\"VAR\" id=\"6J?]Su~9cMcJ?1k)5D+=\" variabletype=\"\">code</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"MTJWF/*U[,/Aq=)gUK~@\"><field name=\"NUM\">5</field></block></value></block></value><statement name=\"DO4\"><block type=\"coderbot_audio_say\" id=\"$WB=k8dnPq;7!6KtgGSL\"><field name=\"LOCALE\">it</field><value name=\"TEXT\"><block type=\"text\" id=\"KuYp/v**F!_(?,!?~rQp\"><field name=\"TEXT\">Attenzione!</field></block></value></block></statement></block></next></block></next></block></statement></block></statement><next><block type=\"text_print\" id=\"7BYNgrmH0+*5Apcu|R[%\"><value name=\"TEXT\"><block type=\"text\" id=\"YMLXch,ZSheJiLbJ]h~f\"><field name=\"TEXT\"></field></block></value></block></next></block></next></block></next></block></next></block></statement></block></xml>", "code": "tag_map = None\ncode = None\nlista = None\ncodes = None\npositions = None\n\n\nwhile True:\n get_prog_eng().check_end()\n tag_map = get_cam().find_ar_code()\n codes = tag_map.get('codes')\n positions = tag_map.get('positions')\n if len(codes) > 0:\n if positions[0][-1] > 150:\n code = codes[0]\n get_cam().set_text(codes)\n if code == 1:\n get_bot().forward(speed=100, elapse=1)\n get_bot().left(speed=100, elapse=1)\n elif code == 2:\n get_bot().forward(speed=100, elapse=3)\n elif code == 3:\n get_bot().forward(speed=100, elapse=1)\n get_bot().right(speed=100, elapse=1)\n elif code == 4:\n for count in range(2):\n get_prog_eng().check_end()\n get_bot().right(speed=100, elapse=0.5)\n get_bot().left(speed=100, elapse=0.5)\n get_audio().say('Sono arrivato!', locale=\"it\")\n elif code == 5:\n get_audio().say('Attenzione!', locale=\"it\")\n get_cam().set_text('')\n", "name": "ar_bot"}

0 commit comments

Comments
 (0)