-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathprogram_test_find_face.json
More file actions
1 lines (1 loc) · 5.13 KB
/
program_test_find_face.json
File metadata and controls
1 lines (1 loc) · 5.13 KB
1
{"dom_code": "<xml xmlns=\"http://www.w3.org/1999/xhtml\"><variables><variable type=\"\" id=\"G`ooSD^IjFl@q`VRXz`M\">face</variable><variable type=\"\" id=\"JU]w:x,u6R_]KGB{:XP:\">face_x</variable><variable type=\"\" id=\"YdZ|nz8=@UwR53L{5(Te\">face_size</variable></variables><block type=\"controls_whileUntil\" id=\"CoP0+krwBNk-W]8d*90A\" x=\"32\" y=\"26\"><field name=\"MODE\">WHILE</field><value name=\"BOOL\"><block type=\"logic_boolean\" id=\"fi_0^7$bm]/5xQ|Zpg=(\"><field name=\"BOOL\">TRUE</field></block></value><statement name=\"DO\"><block type=\"variables_set\" id=\"f$?dr|af|Ac.xwmgSA%J\"><field name=\"VAR\" id=\"G`ooSD^IjFl@q`VRXz`M\" variabletype=\"\">face</field><value name=\"VALUE\"><block type=\"coderbot_adv_findFace\" id=\"H`#u_,_?;x,73RZ}}gR{\"><field name=\"RETVAL\">ALL</field></block></value><next><block type=\"variables_set\" id=\"{o9)u+=V]D]h(5aygd~M\"><field name=\"VAR\" id=\"JU]w:x,u6R_]KGB{:XP:\" variabletype=\"\">face_x</field><value name=\"VALUE\"><block type=\"lists_getIndex\" id=\"dAqQ+k+Lsv!1N7zj4(4^\"><mutation statement=\"false\" at=\"true\"></mutation><field name=\"MODE\">GET</field><field name=\"WHERE\">FROM_START</field><value name=\"VALUE\"><block type=\"variables_get\" id=\"65Q5x52oC~jam{#uHnFe\"><field name=\"VAR\" id=\"G`ooSD^IjFl@q`VRXz`M\" variabletype=\"\">face</field></block></value><value name=\"AT\"><block type=\"math_number\" id=\"^aod?Rq):AVnd02Or|!L\"><field name=\"NUM\">1</field></block></value></block></value><next><block type=\"variables_set\" id=\"I{^(8GT:UL9{7jdNlg[w\"><field name=\"VAR\" id=\"YdZ|nz8=@UwR53L{5(Te\" variabletype=\"\">face_size</field><value name=\"VALUE\"><block type=\"lists_getIndex\" id=\"2}fQ04Qws48,xb!?z1pW\"><mutation statement=\"false\" at=\"true\"></mutation><field name=\"MODE\">GET</field><field name=\"WHERE\">FROM_START</field><value name=\"VALUE\"><block type=\"variables_get\" id=\"hmZQMGjZ94)AhuZ6JUYa\"><field name=\"VAR\" id=\"G`ooSD^IjFl@q`VRXz`M\" variabletype=\"\">face</field></block></value><value name=\"AT\"><block type=\"math_number\" id=\"=LbR3.00CDs*hnk()Y^-\"><field name=\"NUM\">2</field></block></value></block></value><next><block type=\"text_print\" id=\"O}.LG0(E@nzN,p;l%v2{\"><value name=\"TEXT\"><block type=\"text_join\" id=\"mRJtt8foB.;Gpq0fM,4D\"><mutation items=\"2\"></mutation><value name=\"ADD0\"><block type=\"text\" id=\",=O:[=q5SBb`1$S,-R,:\"><field name=\"TEXT\">face: </field></block></value><value name=\"ADD1\"><block type=\"variables_get\" id=\"UEwJl:.puwUq)R!zo@Z7\"><field name=\"VAR\" id=\"JU]w:x,u6R_]KGB{:XP:\" variabletype=\"\">face_x</field></block></value></block></value><next><block type=\"controls_if\" id=\"9tGk|M6u455Nu1(SI}{K\"><value name=\"IF0\"><block type=\"variables_get\" id=\"9}[hrA3rOFo0n+BAsX-f\"><field name=\"VAR\" id=\"JU]w:x,u6R_]KGB{:XP:\" variabletype=\"\">face_x</field></block></value><statement name=\"DO0\"><block type=\"controls_if\" id=\"1-%~}MODhI#*$?^aB_tS\"><mutation elseif=\"1\" else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"`rz$_58rWb#ufStSd](T\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\"O}zML^tGL7t3C*mWsEMo\"><field name=\"VAR\" id=\"JU]w:x,u6R_]KGB{:XP:\" variabletype=\"\">face_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"gdx{O}:M_*b|FpvgG_~h\"><field name=\"NUM\">-10</field></block></value></block></value><statement name=\"DO0\"><block type=\"coderbot_adv_move\" id=\"@[^uw~TU^Vti#)6HZC?K\"><field name=\"ACTION\">LEFT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"vt6%MV@vkT*tB]%2:7vQ\"><field name=\"NUM\">80</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"d3[F3QtIG#jb=1IPOem)\"><field name=\"NUM\">0.1</field></block></value></block></statement><value name=\"IF1\"><block type=\"logic_compare\" id=\"/zef{/F+:n[eI1@+MIKR\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"variables_get\" id=\"dh8opiswQU13wjT![yV[\"><field name=\"VAR\" id=\"JU]w:x,u6R_]KGB{:XP:\" variabletype=\"\">face_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"2RVlzW2}AG#ywuHP6N=+\"><field name=\"NUM\">10</field></block></value></block></value><statement name=\"DO1\"><block type=\"coderbot_adv_move\" id=\"4`Z7%j+MV5(5,BM!RRBA\"><field name=\"ACTION\">RIGHT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"v`ab`#qs7J5]2XaOp]s[\"><field name=\"NUM\">80</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"A_y%A@DITmnWACnr0]zK\"><field name=\"NUM\">0.1</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"coderbot_adv_stop\" id=\"B/$XZ_Giuo_h#Q?JM{w}\"></block></statement></block></statement></block></next></block></next></block></next></block></next></block></statement></block></xml>", "code": "face = None\nface_x = None\nface_size = None\n\n\nwhile True:\n get_prog_eng().check_end()\n face = get_cam().find_face()\n face_x = face[0]\n face_size = face[1]\n get_cam().set_text(str('face: ') + str(face_x))\n if face_x:\n if face_x < -10:\n get_bot().left(speed=80, elapse=0.1)\n elif face_x > 10:\n get_bot().right(speed=80, elapse=0.1)\n else:\n get_bot().stop()\n", "name": "face_find"}