Skip to content

Instantly share code, notes, and snippets.

@WestsideRobotics
Created July 11, 2023 05:33
Show Gist options
  • Save WestsideRobotics/ea7540175b11d07bf362cb9625a54042 to your computer and use it in GitHub Desktop.
Save WestsideRobotics/ea7540175b11d07bf362cb9625a54042 to your computer and use it in GitHub Desktop.
7-10-23 FTC Blocks Test OpMode to demonstrate VisionPort features to save CPU resources
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="l)/,LjA`jR!1Nc@Z:`l!">myAprilTagDetections</variable>
<variable id="OlJB[R?bruF2C6T]y:j,">myTfodRecognitions</variable>
<variable id="3.)/eLHm(iRl1^Qsq;Hb">USE_WEBCAM</variable>
<variable id="?.?jAjDXaP~!^(jq/Ls_">myAprilTagProcessor</variable>
<variable id="0+0vTWC]m(07a_?T(!L@">StreamingStatus</variable>
<variable id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</variable>
<variable id="JOq5~V*[H32U/*U?fY4!">LiveViewStatus</variable>
<variable id="dcyg]V)[gW!0CW;MZ{oJ">myTfodProcessor</variable>
<variable id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</variable>
<variable id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</variable>
<variable id="uq}xym`Xu`%m/;b%:2@X">myFPS</variable>
<variable id="h_4q]^+cuMwY?7E#7$Pc">x</variable>
<variable id="R{3+3{j6;,uRMizwTeH6">y</variable>
</variables>
<block type="procedures_defnoreturn" id="WtpyD@tEu+EoY=P9iY,D" deletable="false" x="-429" y="-11">
<field name="NAME">runOpMode</field>
<comment pinned="true" h="249" w="760">This OpMode allows stopping and resuming only LiveView (RC preview), which does not affect DS Camera Stream. This saves some CPU resources, and resumes very quickly.
This OpMode separately allows stopping and resuming Streaming, which includes LiveView and DS Camera Stream. This saves more CPU resources, but takes slightly longer to resume.
Another CPU-saving choice: disable/enable the AprilTag and/or TFOD processors.
The Telemetry functions include an alternate for getting only fresh (not all) detections/recognitions.
Note the VisionPortal.close() command, to be used when finished using the camera.</comment>
<data>{"commentPositionLeft":-22,"commentPositionTop":-271}</data>
<statement name="STACK">
<block type="comment" id="vG1;7$#*;crH,9)V$Lbq">
<field name="COMMENT">This OpMode turns RC LiveView and Streaming off and on.</field>
<next>
<block type="variables_set" id="+WOa|3hz0c^Rah6+[;U4">
<field name="VAR" id="3.)/eLHm(iRl1^Qsq;Hb">USE_WEBCAM</field>
<value name="VALUE">
<block type="logic_boolean" id="C]dWgdzJ2YW[h}=7w5QN">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="variables_set" id="o8JqaS(}{2G}emO+7j`B">
<field name="VAR" id="0+0vTWC]m(07a_?T(!L@">StreamingStatus</field>
<value name="VALUE">
<block type="text" id="l6Qr$.lUp8b:Rp:)yYs@">
<field name="TEXT">ON</field>
</block>
</value>
<next>
<block type="variables_set" id="Y`6z,/IQpb_.XBP~t4}D">
<field name="VAR" id="JOq5~V*[H32U/*U?fY4!">LiveViewStatus</field>
<value name="VALUE">
<block type="text" id=":GMjv4:PpOy7O@BH){FC">
<field name="TEXT">ON</field>
</block>
</value>
<next>
<block type="procedures_callnoreturn" id="f5VC4xOrYYZrGzpFY}@G">
<mutation name="initAprilTag"/>
<comment pinned="false" h="60" w="270">Initialize AprilTag before waitForStart.</comment>
<next>
<block type="variables_set" id="4k7=U-`^j+W8yNUnECp]">
<field name="VAR" id="uq}xym`Xu`%m/;b%:2@X">myFPS</field>
<value name="VALUE">
<block type="visionPortal_getFps" id="Ne-}g{]q!JX.VMa]9=_V">
<comment pinned="false" h="150" w="325">Get the current vision frame rate.</comment>
<data>{"commentPositionLeft":-81,"commentPositionTop":-175}</data>
<value name="VISION_PORTAL">
<block type="variables_get" id="+fWc2qAZDhIK?7*anI$z">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_whileUntil" id="@sWyWf4YQ:mgWX*V2Sto">
<field name="MODE">WHILE</field>
<value name="BOOL">
<block type="linearOpMode_opModeInInit" id="5Fp[NSDEP|=QrFZRw*gf"/>
</value>
<statement name="DO">
<block type="telemetry_addTextData_All" id="Y/b(p3p_Ls7l_.)bQt%8">
<value name="KEY">
<shadow type="text" id="]K/@Q[7z:EBSoy.ggFCo">
<field name="TEXT">DS preview on/off</field>
</shadow>
</value>
<value name="TEXT">
<shadow type="text" id="eV-62@bA|1V9{)n7lim2">
<field name="TEXT">3 dots, Camera Stream</field>
</shadow>
</value>
<next>
<block type="telemetry_addTextData_All" id="/Zm[n8^)(`(S}Ab9j!;|">
<value name="KEY">
<shadow type="text" id="E)4aB(Zb2,Da/0v0AiN=">
<field name="TEXT">&gt;</field>
</shadow>
</value>
<value name="TEXT">
<shadow type="text" id="^u5_oh+s(.Vs1Kk;$yw9">
<field name="TEXT">Touch Play to start OpMode</field>
</shadow>
</value>
<next>
<block type="telemetry_addLine" id="ZQU{~)G9gx9SXJO:T*C`">
<value name="TEXT">
<shadow type="text" id="~0c$rZOobOBOX;8(`,2i">
<field name="TEXT"/>
</shadow>
</value>
<next>
<block type="procedures_callnoreturn" id="e9p6buhNTAS!:}(#;/41">
<mutation name="Toggle and Telemetry"/>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="comment" id="/TX8,^RvHuP6X%R,Py^^">
<field name="COMMENT">Wait until DS Start button is touched.</field>
<next>
<block type="linearOpMode_waitForStart" id=":`$wN_ci`O;o6P0~.(+g">
<next>
<block type="controls_if" id="}Q?5mbxSO8Di;i!__6[y">
<value name="IF0">
<block type="linearOpMode_opModeIsActive" id=")o%YFX/#9kvv^sgXr4~5"/>
</value>
<statement name="DO0">
<block type="controls_whileUntil" id="^0Kagy/e+Ea{rbZPv2G6">
<field name="MODE">WHILE</field>
<value name="BOOL">
<block type="linearOpMode_opModeIsActive" id="e)cr{!2VIET83s,JWC.="/>
</value>
<statement name="DO">
<block type="procedures_callnoreturn" id="5Kl1l}6%CYHl,|*ryJZ,">
<mutation name="Toggle and Telemetry"/>
</block>
</statement>
<next>
<block type="visionPortal_close" id="#UITW/J_UkU$bP(IJG7%">
<comment pinned="true" h="82" w="205">Save computing resources by closing VisionPortal at any time, if no longer needed.</comment>
<data>{"commentPositionLeft":371,"commentPositionTop":-68}</data>
<value name="VISION_PORTAL">
<block type="variables_get" id="PZEyHkJ%{1f!YF#;ncIg">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="iBdBsnA~mlnc67%mFtuH" x="506" y="-3">
<field name="NAME">Toggle and Telemetry</field>
<comment pinned="false" h="80" w="160">Describe this function...</comment>
<statement name="STACK">
<block type="procedures_callnoreturn" id="|1h*6xV4PWk.Z^AF^mys">
<mutation name="Toggle LiveView and Streaming"/>
<next>
<block type="procedures_callnoreturn" id="h4Q.1e#c^,d-Q.#e3ow*">
<mutation name="Toggle Processors"/>
<next>
<block type="procedures_callnoreturn" id="peGlS865z-9HMBH8gK:d">
<mutation name="Frames Per Second"/>
<next>
<block type="procedures_callnoreturn" id="L1~6q-w9m`2ahlT|b!@A">
<mutation name="telemetryAprilTag"/>
<next>
<block type="procedures_callnoreturn" id="~W7mTOO=Q3?TmHzxA41O">
<mutation name="telemetryTfod"/>
<next>
<block type="telemetry_update" id="CcM7+$syN,5p}u1NCi8q">
<next>
<block type="linearOpMode_sleep_Number" id="jjoCwI:;J87CrtGs%}K7">
<comment pinned="false" h="46" w="191">Share the CPU.</comment>
<data>{"commentPositionLeft":-48,"commentPositionTop":-71}</data>
<value name="MILLISECONDS">
<shadow type="math_number" id="w~.7$M*lJeh#@I/xsbHy">
<field name="NUM">20</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="}H-T4W}l;e7`S17@+iUN" x="1179" y="0">
<field name="NAME">Frames Per Second</field>
<comment pinned="false" h="80" w="160">Describe this function...</comment>
<statement name="STACK">
<block type="telemetry_addNumericData_Number" id="8^Rivrs$w$BmSq*G0)4o">
<value name="KEY">
<shadow type="text" id="0Xt%d)|WE9ed{Leo-_%h">
<field name="TEXT">Frames Per Second (FPS)</field>
</shadow>
</value>
<value name="NUMBER">
<block type="misc_roundDecimal" id="JB2i=c6X:Xj=fhTD(vau">
<value name="NUMBER">
<shadow type="math_number" id="t6#vOO0WoI0jzC/O4`tm">
<field name="NUM">3.14159265</field>
</shadow>
<block type="visionPortal_getFps" id="/a#/|De6d@[8-k)*}+ND">
<comment pinned="false" h="150" w="325">Get the current vision frame rate.</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="lkjji+4(-vWw?yE%T-Q7">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
</block>
</value>
<value name="PRECISION">
<shadow type="math_number" id=",}?P/)Kah;1J6e`f~M[c">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="telemetry_addLine" id="Ji1Kc(!ubd[d4V/Gr$=h">
<value name="TEXT">
<shadow type="text" id="X(D[pT6ulC.atL*N%tJ-">
<field name="TEXT"/>
</shadow>
</value>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="a9hAqGLN+G(|6-Eu:3~R" x="508" y="293">
<field name="NAME">Toggle LiveView and Streaming</field>
<comment pinned="false" h="80" w="160">Describe this function...</comment>
<statement name="STACK">
<block type="controls_if" id="s]~]0K2S~zbH[eJ9ENk|">
<mutation elseif="1"/>
<value name="IF0">
<block type="gamepad_getProperty_Boolean" id="k,,VMEnmGL]73O[-#O_w">
<field name="IDENTIFIER">gamepad1</field>
<field name="PROP">DpadLeft</field>
<data>{"IDENTIFIER":"gamepad1"}</data>
</block>
</value>
<statement name="DO0">
<block type="visionPortal_stopLiveView" id=".~;|?K$?7w]2,eIH7#PB">
<comment pinned="false" h="150" w="325">Temporarily stop the live view (RC preview).</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="B;2/$xHg7rd_2YfJE]i;">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<next>
<block type="variables_set" id="4me_ez-;cCVo*,7+mHk?">
<field name="VAR" id="JOq5~V*[H32U/*U?fY4!">LiveViewStatus</field>
<value name="VALUE">
<block type="text" id="pE)q1#@MMFW|8o5Dfd6}">
<field name="TEXT">OFF</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="gamepad_getProperty_Boolean" id="RJNj#D]Tz|#xZwpY=tG:">
<field name="IDENTIFIER">gamepad1</field>
<field name="PROP">DpadRight</field>
<data>{"IDENTIFIER":"gamepad1"}</data>
</block>
</value>
<statement name="DO1">
<block type="visionPortal_resumeLiveView" id=".wEF!^!bt.]A=Y(!Oc_!">
<comment pinned="false" h="150" w="325">Start the live view (RC preview) again.</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="0t^o:cf5*cei,[:;5O}N">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<next>
<block type="variables_set" id="Z96Kv%s_U{kh~o)B%QgS">
<field name="VAR" id="JOq5~V*[H32U/*U?fY4!">LiveViewStatus</field>
<value name="VALUE">
<block type="text" id=",Ri|vF1{kNaO2|:;G9l_">
<field name="TEXT">ON</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<next>
<block type="controls_if" id="!7_WSukNml?WxUrVW=}Y">
<mutation elseif="1"/>
<value name="IF0">
<block type="gamepad_getProperty_Boolean" id="nHP+eLQXZnMf$GP.l+2:">
<field name="IDENTIFIER">gamepad1</field>
<field name="PROP">DpadDown</field>
<data>{"IDENTIFIER":"gamepad1"}</data>
</block>
</value>
<statement name="DO0">
<block type="visionPortal_stopStreaming" id="WxT@T#Ky#v5b~U}F-piA">
<comment pinned="false" h="150" w="325">Temporarily stop the streaming session. This can save CPU resources, with the ability to resume quickly when needed.</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="+oda$..:Xa3Va0rMe{;L">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<next>
<block type="variables_set" id="P5YlYIAnCjb5k.u,!TXl">
<field name="VAR" id="0+0vTWC]m(07a_?T(!L@">StreamingStatus</field>
<value name="VALUE">
<block type="text" id="R)#]91gm5}m@Or#9GCz#">
<field name="TEXT">OFF</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="gamepad_getProperty_Boolean" id="4p5t*;5@A|8*!R_$E^Fw">
<field name="IDENTIFIER">gamepad1</field>
<field name="PROP">DpadUp</field>
<data>{"IDENTIFIER":"gamepad1"}</data>
</block>
</value>
<statement name="DO1">
<block type="visionPortal_resumeStreaming" id="TRp3/F9RhWFZnU3l.]ei">
<comment pinned="false" h="150" w="325">Resume the streaming session if previously stopped.</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="{Bzk]pC5=f5AS/,gp5T{">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<next>
<block type="variables_set" id="^re%BNWjR^^QEoyFPp}c">
<field name="VAR" id="0+0vTWC]m(07a_?T(!L@">StreamingStatus</field>
<value name="VALUE">
<block type="text" id="@9ZV|0fUUhf@+7d6w1oj">
<field name="TEXT">ON</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<next>
<block type="telemetry_addLine" id="WEyOdVX$sns#?S4u6i)_">
<value name="TEXT">
<shadow type="text">
<field name="TEXT"/>
</shadow>
<block type="text_join" id="AeyN{z,V3nYed$kVN;e^">
<mutation items="4"/>
<value name="ADD0">
<block type="text" id="MZxJPPxgM,V34}y=!,r0">
<field name="TEXT">Dpad L/R LiveView: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="GVBdO$%LD?0[pJI/$l:e">
<field name="VAR" id="JOq5~V*[H32U/*U?fY4!">LiveViewStatus</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="6Je~x{fMQxT5$M}cp#`3">
<field name="TEXT"> Down/Up Streaming: </field>
</block>
</value>
<value name="ADD3">
<block type="variables_get" id="6lwQQ.90k3Q(-9x+d22f">
<field name="VAR" id="0+0vTWC]m(07a_?T(!L@">StreamingStatus</field>
</block>
</value>
</block>
</value>
<next>
<block type="telemetry_addLine" id="y9RS5Fr~lgFq9ph}NVNf">
<value name="TEXT">
<shadow type="text" id="~M4d8#`jbTStugB:x;jq">
<field name="TEXT"/>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="zq%!h!!MY70Zb#KF1z-1" x="1182" y="287">
<field name="NAME">Toggle Processors</field>
<comment pinned="false" h="80" w="160">Describe this function...</comment>
<statement name="STACK">
<block type="controls_if" id="Sek=?)XULKj$p%YI[Cr`">
<mutation elseif="1"/>
<value name="IF0">
<block type="gamepad_getProperty_Boolean" id="NiN2UC:qf:a4W)k1raeo">
<field name="IDENTIFIER">gamepad1</field>
<field name="PROP">X</field>
<data>{"IDENTIFIER":"gamepad1"}</data>
</block>
</value>
<statement name="DO0">
<block type="visionPortal_setProcessorEnabled" id="I2waXS~qE(HUL!5In6,T">
<comment pinned="false" h="150" w="325">Enable or disable the AprilTag processor.</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="z(s[eZvCrlcXZp018cTp">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<value name="VISION_PROCESSOR">
<block type="variables_get" id="!DP81p8lol2`y)k+=T$0">
<field name="VAR" id="?.?jAjDXaP~!^(jq/Ls_">myAprilTagProcessor</field>
</block>
</value>
<value name="ENABLED">
<shadow type="logic_boolean" id="||iVl#~vj9H#46Ie*1Dj">
<field name="BOOL">TRUE</field>
</shadow>
</value>
</block>
</statement>
<value name="IF1">
<block type="gamepad_getProperty_Boolean" id="vz.){imdnT;u{Z~v.$hb">
<field name="IDENTIFIER">gamepad1</field>
<field name="PROP">Y</field>
<data>{"IDENTIFIER":"gamepad1"}</data>
</block>
</value>
<statement name="DO1">
<block type="visionPortal_setProcessorEnabled" id="vew2Z*+HaWWQA9xTzm_G">
<comment pinned="false" h="150" w="325">Enable or disable the AprilTag processor.</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="#,@#88e*?y_CmDMruf;k">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<value name="VISION_PROCESSOR">
<block type="variables_get" id="CjUW-10Hw#.8?q;m4g9T">
<field name="VAR" id="?.?jAjDXaP~!^(jq/Ls_">myAprilTagProcessor</field>
</block>
</value>
<value name="ENABLED">
<shadow type="logic_boolean" id="K`xk-jQbU4HT]3+!9:33">
<field name="BOOL">FALSE</field>
</shadow>
</value>
</block>
</statement>
<next>
<block type="controls_if" id="$FNokyCCv0M%DI_C`P7/">
<mutation elseif="1"/>
<value name="IF0">
<block type="gamepad_getProperty_Boolean" id="0m0_VF.|8^R,SCB6MO`E">
<field name="IDENTIFIER">gamepad1</field>
<field name="PROP">A</field>
<data>{"IDENTIFIER":"gamepad1"}</data>
</block>
</value>
<statement name="DO0">
<block type="visionPortal_setProcessorEnabled" id="sN82#sI.z@e%GUur9aG]">
<comment pinned="false" h="150" w="325">Enable or disable the TensorFlow Object Detection processor.</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="dwBzVf+jo=:y10$B/;8-">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<value name="VISION_PROCESSOR">
<block type="variables_get" id="CSQ.,/)#`2BqrJRxk]%1">
<field name="VAR" id="dcyg]V)[gW!0CW;MZ{oJ">myTfodProcessor</field>
</block>
</value>
<value name="ENABLED">
<shadow type="logic_boolean" id="vDWzj4@V@Q^d?NkxHLll">
<field name="BOOL">TRUE</field>
</shadow>
</value>
</block>
</statement>
<value name="IF1">
<block type="gamepad_getProperty_Boolean" id="-}GTdb,+[5#s4Udyb}nO">
<field name="IDENTIFIER">gamepad1</field>
<field name="PROP">B</field>
<data>{"IDENTIFIER":"gamepad1"}</data>
</block>
</value>
<statement name="DO1">
<block type="visionPortal_setProcessorEnabled" id="CrOialW6O-b=V%g,$NY$">
<comment pinned="false" h="150" w="325">Enable or disable the TensorFlow Object Detection processor.</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="usHC(ot?hWoJ/jw3O?^_">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<value name="VISION_PROCESSOR">
<block type="variables_get" id="v|{^5a5+KmN]qfs:@(],">
<field name="VAR" id="dcyg]V)[gW!0CW;MZ{oJ">myTfodProcessor</field>
</block>
</value>
<value name="ENABLED">
<shadow type="logic_boolean" id="o#t:7H0+$TARWwu6`cP=">
<field name="BOOL">FALSE</field>
</shadow>
</value>
</block>
</statement>
<next>
<block type="telemetry_addLine" id="]$O,6Ve){/}3sW0kz.x)">
<value name="TEXT">
<shadow type="text" id="(XVsGKeS2(#`0.$x,GS/">
<field name="TEXT"/>
</shadow>
<block type="text_join" id="q^Ec9P0$#X6zW!/u(@)m">
<mutation items="4"/>
<value name="ADD0">
<block type="text" id="CsoJJ5=olu%;:?7?HtOp">
<field name="TEXT">X/Y AprilTag on? </field>
</block>
</value>
<value name="ADD1">
<block type="visionPortal_getProcessorEnabled" id="AC[.RM5@=?BxQ4ib!8Rw">
<comment pinned="false" h="150" w="325">Get whether the AprilTag processor is enabled.</comment>
<value name="VISION_PORTAL">
<block type="variables_get" id="e,DSpf~8Bhj#gxg+LHI,">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<value name="VISION_PROCESSOR">
<block type="variables_get" id="_=3E]E}.:~C77$(r=OI8">
<field name="VAR" id="?.?jAjDXaP~!^(jq/Ls_">myAprilTagProcessor</field>
</block>
</value>
</block>
</value>
<value name="ADD2">
<block type="text" id=":@prB%**8QhDo{BAxiP!">
<field name="TEXT"> A/B TFOD on? </field>
</block>
</value>
<value name="ADD3">
<block type="visionPortal_getProcessorEnabled" id="b6796c~4PavX{QFqyH]L">
<comment pinned="false" h="150" w="325">Get whether the TensorFlow Object Detection processor is enabled.</comment>
<data>{"commentPositionLeft":-81,"commentPositionTop":-175}</data>
<value name="VISION_PORTAL">
<block type="variables_get" id="Wc:bi6LGaiGsUr^?mVHn">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
</block>
</value>
<value name="VISION_PROCESSOR">
<block type="variables_get" id="D|saP2~_ocxa]%=d/N`j">
<field name="VAR" id="dcyg]V)[gW!0CW;MZ{oJ">myTfodProcessor</field>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="telemetry_addLine" id="BxSv(uj12]J7#Uj7ec9Q">
<value name="TEXT">
<shadow type="text" id="2EG;T%~zKZ.ijI#AJZ$B">
<field name="TEXT"/>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id=":Un!nS!LS%^tq]:g4^?Z" x="-426" y="727">
<field name="NAME">initAprilTag</field>
<comment pinned="false" h="80" w="160">Initialize AprilTag Detection.</comment>
<statement name="STACK">
<block type="comment" id="Z#tr,B$;l$RV0)j4q0n.">
<field name="COMMENT">First, create the AprilTag and TFOD Processors.</field>
<next>
<block type="variables_set" id="$.wt,WCD1s5fSqROQT*(">
<field name="VAR" id="?.?jAjDXaP~!^(jq/Ls_">myAprilTagProcessor</field>
<value name="VALUE">
<block type="aprilTagProcessor_easyCreateWithDefaults" id="l3,LV}S*`D5Qwwt?riR$"/>
</value>
<next>
<block type="variables_set" id="qcRRdZFncwPo8QQ2Qmk3">
<field name="VAR" id="dcyg]V)[gW!0CW;MZ{oJ">myTfodProcessor</field>
<comment pinned="false" h="150" w="325">Create the TensorFlow Object Detection processor and assign it to a variable.</comment>
<data>{"commentPositionLeft":-81,"commentPositionTop":-175}</data>
<value name="VALUE">
<block type="tfodProcessor_easyCreateWithDefaults" id="w:5^/c!AhfY}Lu=X5^f["/>
</value>
<next>
<block type="comment" id="w{nzs#L5ZbP.GKW2S`x_">
<field name="COMMENT">Next, create a VisionPortal.</field>
<next>
<block type="controls_if" id="T`t))DI)e(S6b*Xls7U=">
<mutation else="1"/>
<value name="IF0">
<block type="variables_get" id="Zr+H]wQb_aiB|J+{-0:G">
<field name="VAR" id="3.)/eLHm(iRl1^Qsq;Hb">USE_WEBCAM</field>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="A]1L#sF#.~~(DbGXr/*Z">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
<comment pinned="false" h="150" w="325">Create a VisionPortal, with the specified webcam name, AprilTag processor, and TensorFlow Object Detection processor, and assign it to a variable.</comment>
<value name="VALUE">
<block type="visionPortal_easyCreateWithDefaults_twoProcessors" id="bCL7%fCN9UUxwT[hDmpS">
<value name="CAMERA">
<shadow type="navigation_webcamName" id="}6T#Fg*?eyvgw(%Kb!w6">
<field name="WEBCAM_NAME">Webcam 1</field>
</shadow>
</value>
<value name="VISION_PROCESSOR_1">
<block type="variables_get" id="`x:;FdTG}hQ~$aF?0v4J">
<field name="VAR" id="?.?jAjDXaP~!^(jq/Ls_">myAprilTagProcessor</field>
</block>
</value>
<value name="VISION_PROCESSOR_2">
<block type="variables_get" id="R9^B=a,rg##A2PcSo8ee">
<field name="VAR" id="dcyg]V)[gW!0CW;MZ{oJ">myTfodProcessor</field>
</block>
</value>
</block>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="variables_set" id="X|~t^_f?zB_ck%Czf_1m">
<field name="VAR" id="Xk!_{IPng0#/P|7dx?3N">myVisionPortal</field>
<comment pinned="false" h="150" w="325">Create a VisionPortal, with the specified builtin camera direction, AprilTag processor, and TensorFlow Object Detection processor, and assign it to a variable.</comment>
<value name="VALUE">
<block type="visionPortal_easyCreateWithDefaults_twoProcessors" id="*]`sO7ma%*Jgo{ey}bwO">
<value name="CAMERA">
<shadow type="navigation_typedEnum_builtinCameraDirection" id="+J36!#!`p~[Iwt5^S.=U">
<field name="CAMERA_DIRECTION">BACK</field>
</shadow>
</value>
<value name="VISION_PROCESSOR_1">
<block type="variables_get" id="_%I|O:,wX|,lbwn-B:qd">
<field name="VAR" id="?.?jAjDXaP~!^(jq/Ls_">myAprilTagProcessor</field>
</block>
</value>
<value name="VISION_PROCESSOR_2">
<block type="variables_get" id="?F!wU{%WY;4Ke$RpQ4%x">
<field name="VAR" id="dcyg]V)[gW!0CW;MZ{oJ">myTfodProcessor</field>
</block>
</value>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="Eg%7GTPuhcoA]FCw9:]O" collapsed="true" x="-430" y="1163">
<field name="NAME">telemetryAprilTag</field>
<comment pinned="false" h="80" w="160">Display info (using telemetry) for a recognized AprilTag.</comment>
<data>{"commentPositionLeft":-40,"commentPositionTop":-105}</data>
<statement name="STACK">
<block type="variables_set" id="c8~R@@~J_)0dhTTP,GP@" disabled="true">
<field name="VAR" id="l)/,LjA`jR!1Nc@Z:`l!">myAprilTagDetections</field>
<comment pinned="false" h="80" w="160">Get a list of AprilTag detections.</comment>
<value name="VALUE">
<block type="aprilTagProcessor_getDetections" id="^Sth`xX=n79Q8`P*Z#qt">
<value name="APRIL_TAG_PROCESSOR">
<block type="variables_get" id="Icn).;@XjTI7SR.j$UY#">
<field name="VAR" id="?.?jAjDXaP~!^(jq/Ls_">myAprilTagProcessor</field>
</block>
</value>
</block>
</value>
<next>
<block type="comment" id="L:j4_7I$X/;)tduHIgZB">
<field name="COMMENT">Alternate: get only fresh detections.</field>
<next>
<block type="variables_set" id="tm|KE-KyhaGFa.DgAM9~">
<field name="VAR" id="l)/,LjA`jR!1Nc@Z:`l!">myAprilTagDetections</field>
<value name="VALUE">
<block type="aprilTagProcessor_getFreshDetections" id="KqP3wl;Om2wS,Ni;iF!n">
<comment pinned="false" h="150" w="325">Get a list containing detections that were detected since the last call to this method, or null if no new detections are available. This is useful to avoid re-processing the same detections multiple times.</comment>
<value name="APRIL_TAG_PROCESSOR">
<block type="variables_get" id="MCu6OsTbnY%qczu?SS4n">
<field name="VAR" id="?.?jAjDXaP~!^(jq/Ls_">myAprilTagProcessor</field>
</block>
</value>
</block>
</value>
<next>
<block type="telemetry_addTextData_All" id="3m5}jTks8BeMJ]|.h*Kp">
<value name="KEY">
<shadow type="text" id="MNA3Pe{~9.uc1dSMmO=j">
<field name="TEXT"># AprilTags Detected</field>
</shadow>
</value>
<value name="TEXT">
<shadow type="text" id="DRWu-r*O-0eJ4pG2n$_l">
<field name="TEXT"/>
</shadow>
<block type="lists_length" id="q{bEB[P*p2XiVOMj*ku#">
<value name="VALUE">
<block type="variables_get" id="/5v#48C2W5M+l:4)g!zX">
<field name="VAR" id="l)/,LjA`jR!1Nc@Z:`l!">myAprilTagDetections</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_forEach" id="|@Y$y8D~],V(MRQ+Cyv{">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
<comment pinned="false" h="81" w="199">Iterate through list and call a function to display info for each recognized AprilTag.</comment>
<value name="LIST">
<block type="variables_get" id="W,d1s!eFWeDT0X}~eq,n">
<field name="VAR" id="l)/,LjA`jR!1Nc@Z:`l!">myAprilTagDetections</field>
</block>
</value>
<statement name="DO">
<block type="comment" id="U@Dkpel-LMa.00jJsqA-">
<field name="COMMENT">Display info about the detection.</field>
<next>
<block type="telemetry_addLine" id="qrKb?#/HMYJo.RhU8rW:">
<value name="TEXT">
<shadow type="text" id="3^Lv-r.jG6}7LV;(yIh.">
<field name="TEXT"/>
</shadow>
</value>
<next>
<block type="controls_if" id="1KHSCf_sX!Qd~BKfG}QD">
<mutation else="1"/>
<value name="IF0">
<block type="aprilTagDetection_getProperty_IsNotNull" id=":^$lP:Ut!p3Z)E+vy^]D">
<field name="PROP">metadata</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="9Lq*6VTlT$7uDRiB|mYe">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="telemetry_addLine" id="awB~K!HjEb=h6tM,%vLN">
<value name="TEXT">
<shadow type="text" id="?hM/$PX}4MN:|W`joKgn">
<field name="TEXT"/>
</shadow>
<block type="text_join" id="0C_x2#T#t7yl!%45k{$?">
<mutation items="4"/>
<value name="ADD0">
<block type="text" id="buEo7p[-2T4:49=`uwK1">
<field name="TEXT">==== (ID </field>
</block>
</value>
<value name="ADD1">
<block type="aprilTagDetection_getProperty_Number" id="lifbVBMNn+.1j?y6v54X">
<field name="PROP">id</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="w(63KWmGiZ83+qITBep;">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="ADD2">
<block type="text" id="=n-]].djPxb,OFyxcOQF">
<field name="TEXT">) </field>
</block>
</value>
<value name="ADD3">
<block type="aprilTagDetection_getProperty_String" id="=AvXMAjUic3u3lbFtEt4">
<field name="PROP">metadata.name</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="zKHYs.Y87Qrl9%G~Oq^V">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="telemetry_addLine" id=";grqK`+-g7;g50c=|L0l">
<value name="TEXT">
<shadow type="text" id="!y]i-sUsabeyV/)u=6D5">
<field name="TEXT"/>
</shadow>
<block type="text_join" id="4TtGi;Z(gbFaks}Eap^9">
<mutation items="7"/>
<value name="ADD0">
<block type="text" id="+]Cns+.i=%b0bFaT6;NI">
<field name="TEXT">XYZ </field>
</block>
</value>
<value name="ADD1">
<block type="misc_formatNumber_withWidth" id="df*#gw3iYx$kvL$9{Y?m">
<value name="NUMBER">
<shadow type="math_number" id="g`p?z|x@JeU%MJ4.tSFQ">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="jUN`u.6t[:O8`9Ncql]!">
<field name="PROP">ftcPose.x</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="mb(6}~t}KLoi4`XT~d:H">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="k*}!VVn#l8HSq7E2i?#R">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="mh4H+`GE$Em,(iS4ZjPR">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="ADD2">
<block type="text" id="y34}1aACqw@S]sESt=A#">
<field name="TEXT"> </field>
</block>
</value>
<value name="ADD3">
<block type="misc_formatNumber_withWidth" id="4Oj?ZaC$d#_1X}?b[T.|">
<value name="NUMBER">
<shadow type="math_number" id="2cGf/q9c-ZnJ}LB6C1i$">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="^ZxENE!MDi;z:vW0d@XL">
<field name="PROP">ftcPose.y</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="bYyr?K,sa#Z.])=_ot.X">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="BQJxM*kkA=P:cx1$gjDj">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="$REh~]PUb9LYTO;OfzqZ">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="ADD4">
<block type="text" id="D7A3=:fGOVPSdci(UQtX">
<field name="TEXT"> </field>
</block>
</value>
<value name="ADD5">
<block type="misc_formatNumber_withWidth" id="FCZL%yFs6[0x{rm0ps54">
<value name="NUMBER">
<shadow type="math_number" id="|j[Xf6X[,{Y~6k#Ow9ay">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="@o/Xx/]f-CWGv|Tr)2Nk">
<field name="PROP">ftcPose.z</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="[9!-4|yF{X2|/{iSu:SC">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="ga,Viu`_|ozkv#5q3*@0">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="(E3-dHVlUbl(~6A~LN[p">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="ADD6">
<block type="text" id=")9nfo^3]N$S,m~5}*3*=">
<field name="TEXT"> (inch)</field>
</block>
</value>
</block>
</value>
<next>
<block type="telemetry_addLine" id="6W%[*9{;}.5Jl{VBB=*t">
<value name="TEXT">
<shadow type="text" id=";t?`r+|~SzTLUUHO=;M9">
<field name="TEXT"/>
</shadow>
<block type="text_join" id="$$x)e|XJcO*g[Y8~M2/Q">
<mutation items="7"/>
<value name="ADD0">
<block type="text" id="CNSpY2iH=tR#]P,pi4u.">
<field name="TEXT">PRY </field>
</block>
</value>
<value name="ADD1">
<block type="misc_formatNumber_withWidth" id="sht8%%Nn`h2}jwZ`-{x)">
<value name="NUMBER">
<shadow type="math_number" id="?pMQrP+klggGPQ})NZWJ">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="Iy|1o|tQ9/Xq~XhaEN$_">
<field name="PROP">ftcPose.yaw</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="rVJim4c8+/ys[,t:o!0a">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="mHP*I^3G3|9rAiui`;?f">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="VxWPF,FgQz,lDodmj[WR">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="ADD2">
<block type="text" id="]dbZO?6z_PP)Na=ij|hW">
<field name="TEXT"> </field>
</block>
</value>
<value name="ADD3">
<block type="misc_formatNumber_withWidth" id="!i;Ow5b5|tm]^:f=af8O">
<value name="NUMBER">
<shadow type="math_number" id="xsH[9W8/eLks@vlm]1*g">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="ShLjZCVXxN!~/4l*tkIW">
<field name="PROP">ftcPose.pitch</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="OCoPF8gE#WFKctf6vd6f">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="DyJDDqNjyT?RD%Og91T/">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="M?Svc5)[b)Apn186A8Em">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="ADD4">
<block type="text" id="7-XP1=zX3p(TS(}va$9`">
<field name="TEXT"> </field>
</block>
</value>
<value name="ADD5">
<block type="misc_formatNumber_withWidth" id=":tQhsy?3wU|KpZT;GEux">
<value name="NUMBER">
<shadow type="math_number" id="v%b/#{Uh]xNL*jCpZAlp">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="rr^=wlJCB2_afebAXJ}Z">
<field name="PROP">ftcPose.roll</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="vBZ8!}wPWKb}V3-g]Wle">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="mu5y,^`sp#UgVsrfnkbc">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="1a@0e%XGstoBjtg)K@p]">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="ADD6">
<block type="text" id="I*Wn1Gf}j+e`]CP5J0Cp">
<field name="TEXT"> (deg)</field>
</block>
</value>
</block>
</value>
<next>
<block type="telemetry_addLine" id="p~aY/Ief^l:6#%yF5mBb">
<value name="TEXT">
<shadow type="text" id="[:Q^{:f(MSqR]$h@YO_G">
<field name="TEXT">text</field>
</shadow>
<block type="text_join" id="7AAW16ak[E;pRyJ50_pV">
<mutation items="7"/>
<value name="ADD0">
<block type="text" id="_D88fgJh36dZBe#kxQkh">
<field name="TEXT">RBE </field>
</block>
</value>
<value name="ADD1">
<block type="misc_formatNumber_withWidth" id="o=,mI,_W=C-(irqk:S^/">
<value name="NUMBER">
<shadow type="math_number" id="67$:0vchTm|ZAu?yf9Zs">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="V_e8w[RX[YJ6%2RfwTK4">
<field name="PROP">ftcPose.range</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="5U:C0C|9gsGJwjwric-u">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="E}T84I!akJTmE1gb#KTc">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="UKUfpg-DJ~rM||Pp1;?~">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="ADD2">
<block type="text" id="/)!A!j+m`c^.RSzJfnW8">
<field name="TEXT"> </field>
</block>
</value>
<value name="ADD3">
<block type="misc_formatNumber_withWidth" id="v,Ilg5bR5*;(#^l3B@-0">
<value name="NUMBER">
<shadow type="math_number" id="%)S}?+}8]#C5YOJMTtIz">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="}bh%9Kz6)u_zYo7,L]Iq">
<field name="PROP">ftcPose.bearing</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="B6P^H@vWo+vyX@sYn_ik">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="5ti##om.fc`N4y~4C#;|">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="22o;=,7*otM:5h`-4L|A">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="ADD4">
<block type="text" id="Q|e}m1um|X;(#X^F`wb(">
<field name="TEXT"> </field>
</block>
</value>
<value name="ADD5">
<block type="misc_formatNumber_withWidth" id="x-{*.Ghd4zinz}U9X3?V">
<value name="NUMBER">
<shadow type="math_number" id=".MdJRQ6rUBU)RFzD8T%o">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="D(K1+O}E+Y7i_ek8}A?z">
<field name="PROP">ftcPose.elevation</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="sv;lYz!5q^E[A|N14(.X">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="GU73O^@;SXL))%*l[8Me">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="4Nv)-M9MfCY%aAn:1SEF">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="ADD6">
<block type="text" id="x`,kpt}.uw,YSWON!D^j">
<field name="TEXT"> (inch, deg, deg)</field>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="telemetry_addLine" id=".k7)ZU|.JU[vLM%.9oWH">
<value name="TEXT">
<shadow type="text" id="hqwM9[:8R6P;nJWo`z$@">
<field name="TEXT"/>
</shadow>
<block type="text_join" id="Q$XL59m.y(HLLD=Lb6bM">
<mutation items="3"/>
<value name="ADD0">
<block type="text" id="GO{s|1|cjZX5wm!s}6^U">
<field name="TEXT">==== (ID </field>
</block>
</value>
<value name="ADD1">
<block type="aprilTagDetection_getProperty_Number" id="YbKMT]1!N/1orH}f.`^%">
<field name="PROP">id</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="*DZMa]u.xVDWo54-+9Xp">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="ADD2">
<block type="text" id="Ej2sUV*ZReT^:zwt~{Ar">
<field name="TEXT">) Unknown</field>
</block>
</value>
</block>
</value>
<next>
<block type="telemetry_addLine" id="*wewMc^H[$Rs0;EK}Ow]">
<value name="TEXT">
<shadow type="text" id="2oq;P##KvH:(,WjrIe3!">
<field name="TEXT"/>
</shadow>
<block type="text_join" id="DS^4mx0$o}XW[*EAx9g+">
<mutation items="5"/>
<value name="ADD0">
<block type="text" id="~aS!V+hMdY{-*4G3Ow%3">
<field name="TEXT">Center </field>
</block>
</value>
<value name="ADD1">
<block type="misc_formatNumber_withWidth" id="NWWJ-BvdUXyMBZ|RD`m}">
<value name="NUMBER">
<shadow type="math_number" id="WWZ1rIy[E-^rf4i5ES.w">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="Kns6PW?m}A;SO?@NVb#)">
<field name="PROP">center.x</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="Ar)`$(G]w1~mg?c!0{v;">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="ZZ080[{./+Y}t=(P1DCR">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="sPPkrRLvHyLpl?+E}RhL">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</value>
<value name="ADD2">
<block type="text" id="M[jW(z}Tg(pfF5o6v96v">
<field name="TEXT"/>
</block>
</value>
<value name="ADD3">
<block type="misc_formatNumber_withWidth" id="IGswFrO!Q%aCF}3x,SPE">
<value name="NUMBER">
<shadow type="math_number" id="iQ6P;:;Igrei}.mq2:.{">
<field name="NUM">3.14159265</field>
</shadow>
<block type="aprilTagDetection_getProperty_Number" id="P2eT2TYX6nNBSYz7e^E)">
<field name="PROP">center.y</field>
<value name="APRIL_TAG_DETECTION">
<block type="variables_get" id="ZmOVtYIkx|@b66VSAfd]">
<field name="VAR" id="vP~n9zf$lW%hYD/C.j_-">myAprilTagDetection</field>
</block>
</value>
</block>
</value>
<value name="WIDTH">
<shadow type="math_number" id="MQkYmiA}ms4pA[Ifr2gb">
<field name="NUM">6</field>
</shadow>
</value>
<value name="PRECISION">
<shadow type="math_number" id="*L=(!sY,[nz~xV=Ke@]u">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</value>
<value name="ADD4">
<block type="text" id="lH92feGire@JDBfwGTlN">
<field name="TEXT"> (pixels)</field>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="telemetry_addLine" id="3N{F`jhy%rx/{Xex;5zu">
<value name="TEXT">
<shadow type="text" id="ds{Hr}!u1tUZ{*]D~==j">
<field name="TEXT"/>
</shadow>
</value>
<next>
<block type="telemetry_addLine" id="[:W.s1Ok!]MP)3.3IU{#">
<value name="TEXT">
<shadow type="text" id="Pzz,~#oj]g6(p8-kE+HJ">
<field name="TEXT">key:</field>
</shadow>
</value>
<next>
<block type="telemetry_addLine" id="(z3|~vT*DZX[fOyQ2%S[">
<value name="TEXT">
<shadow type="text" id="M=~-,X%t3PZW:?]x+FCV">
<field name="TEXT">XYZ = X (Right), Y (Forward), Z (Up) dist.</field>
</shadow>
</value>
<next>
<block type="telemetry_addLine" id="M,AbdMv6W{1dFQc)zQt~">
<value name="TEXT">
<shadow type="text" id="`KTr5c!E2VUU.9*_77qL">
<field name="TEXT">PRY = Pitch, Roll &amp; Yaw (XYZ Rotation)</field>
</shadow>
</value>
<next>
<block type="telemetry_addLine" id="uuC6(PL0R.pO7.AFo]db">
<value name="TEXT">
<shadow type="text" id="^GlP*DEB!=^Mvq=zsRKv">
<field name="TEXT">RBE = Range, Bearing &amp; Elevation</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="[c@CeEbU,|xfW?0cq^r(" collapsed="true" x="670" y="1155">
<field name="NAME">telemetryTfod</field>
<comment pinned="false" h="80" w="160">Display info (using telemetry) for a detected object</comment>
<statement name="STACK">
<block type="variables_set" id=";kKrr_fkD,ReoNRRJd/A" disabled="true">
<field name="VAR" id="OlJB[R?bruF2C6T]y:j,">myTfodRecognitions</field>
<comment pinned="false" h="80" w="160">Get a list of recognitions from TFOD.</comment>
<data>{"commentPositionLeft":-40,"commentPositionTop":-105}</data>
<value name="VALUE">
<block type="tfodProcessor_getRecognitions" id="W6*sEN$`k`xj]];PWogd">
<value name="TFOD_PROCESSOR">
<block type="variables_get" id="xvR(ob?-[A7s/c^9nVj#">
<field name="VAR" id="dcyg]V)[gW!0CW;MZ{oJ">myTfodProcessor</field>
</block>
</value>
</block>
</value>
<next>
<block type="comment" id="hrt#e.;2T.U}7!M.2(|_">
<field name="COMMENT">Alternate: get only fresh recognitions.</field>
<next>
<block type="variables_set" id="djC^:s(*a/H]@)/IQQWa">
<field name="VAR" id="OlJB[R?bruF2C6T]y:j,">myTfodRecognitions</field>
<value name="VALUE">
<block type="tfodProcessor_getFreshRecognitions" id="rvRc_jW[806([mc/b+L~">
<comment pinned="false" h="150" w="325">Get a list containing recognitions that were detected since the last call to this method, or null if no new recognitions are available. This is useful to avoid re-processing the same recognitions multiple times.</comment>
<value name="TFOD_PROCESSOR">
<block type="variables_get" id="PzKMqd$(|;rhlLkcSZ*#">
<field name="VAR" id="dcyg]V)[gW!0CW;MZ{oJ">myTfodProcessor</field>
</block>
</value>
</block>
</value>
<next>
<block type="telemetry_addTextData_All" id="IUhP^VfcTpNj|YOwtCAW">
<value name="KEY">
<shadow type="text" id="snXuLC.ImPz*:?|]~VwD">
<field name="TEXT"># Objects Detected</field>
</shadow>
</value>
<value name="TEXT">
<shadow type="text">
<field name="TEXT"/>
</shadow>
<block type="lists_length" id="Nu=Z;Jjb-)8=8[qE6[_S">
<value name="VALUE">
<block type="variables_get" id="CSTJ%~UYjgX~jpPP(}7v">
<field name="VAR" id="OlJB[R?bruF2C6T]y:j,">myTfodRecognitions</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_forEach" id="TAw0m,$,4W5-YVi/kkdI">
<field name="VAR" id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</field>
<comment pinned="false" h="81" w="199">Iterate through list and call a function to display info for each recognized object.</comment>
<value name="LIST">
<block type="variables_get" id="{5Bfhg0hW*aUFip#[}ff">
<field name="VAR" id="OlJB[R?bruF2C6T]y:j,">myTfodRecognitions</field>
</block>
</value>
<statement name="DO">
<block type="comment" id="DFeTY(CqihY6o+?vE^@E">
<field name="COMMENT">Display info about the recognition.</field>
<next>
<block type="telemetry_addLine" id="O`H=Fb=KCdh9Ux}JZF@v">
<value name="TEXT">
<shadow type="text" id="y^/}:J+l`rZ]{h-xIl_F">
<field name="TEXT"/>
</shadow>
</value>
<next>
<block type="comment" id="BSF*5~M|._a$4^|J|8HR">
<field name="COMMENT">Display label and confidence.</field>
<next>
<block type="telemetry_addTextData_All" id="g3MCjYHv~z(y-%,$3fRc">
<comment pinned="false" h="80" w="160">Display the label and confidence for the recognition.</comment>
<value name="KEY">
<shadow type="text" id="(+5_H#hdy|qb8S-TlcCw">
<field name="TEXT">Image</field>
</shadow>
</value>
<value name="TEXT">
<shadow type="text">
<field name="TEXT">text</field>
</shadow>
<block type="text_join" id="uyT^[{v=cBU^x!`}HSel">
<mutation items="4"/>
<value name="ADD0">
<block type="tfodRecognition_getProperty_String" id="e%1!0shi-$iQZYM*d.cj">
<field name="PROP">Label</field>
<value name="TFOD_RECOGNITION">
<block type="variables_get" id="AH;4HkekA7WTSP{kbosr">
<field name="VAR" id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</field>
</block>
</value>
</block>
</value>
<value name="ADD1">
<block type="text" id="q6FcC$Bh4khG5A%Id.*I">
<field name="TEXT"> (</field>
</block>
</value>
<value name="ADD2">
<block type="misc_formatNumber" id="Qw4=`/bI8h35C5HV9(CH">
<value name="NUMBER">
<shadow type="math_number">
<field name="NUM">3.14159265</field>
</shadow>
<block type="math_arithmetic" id="xBgy39n6Z;$Dk0#`6551">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="tfodRecognition_getProperty_Number" id="88`sUy4H$u!/h,OcUcbF">
<field name="PROP">Confidence</field>
<value name="TFOD_RECOGNITION">
<block type="variables_get" id="q1c{5sGMc`m=~[,si)z1">
<field name="VAR" id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="Ff*B:`AVH;VG*rQ?;Vb,">
<field name="NUM">100</field>
</shadow>
</value>
</block>
</value>
<value name="PRECISION">
<shadow type="math_number" id="}TOH07;OcTYeu(OQNs/k">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</value>
<value name="ADD3">
<block type="text" id="yX];4)yP:iSRvhIPnO+W">
<field name="TEXT"> % Conf.)</field>
</block>
</value>
</block>
</value>
<next>
<block type="comment" id="9$G,z,ZC.C|@=xhlP[H4">
<field name="COMMENT">Display position.</field>
<next>
<block type="variables_set" id="wkf*LhAI/#m0[dDh}r2G">
<field name="VAR" id="h_4q]^+cuMwY?7E#7$Pc">x</field>
<value name="VALUE">
<block type="math_arithmetic" id="YJ.IPiGo(*9r^0UyilE]" inline="false">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="k49f@V!LVIrF-(vY4n%k">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="tfodRecognition_getProperty_Number" id="4`Ee4LE=jc0P`@[Ly=E+">
<field name="PROP">Left</field>
<value name="TFOD_RECOGNITION">
<block type="variables_get" id="Wjrmkkf::iT]78cHxNQU">
<field name="VAR" id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="tfodRecognition_getProperty_Number" id="QZ;!lR45Jl)0X?,|Ooh}">
<field name="PROP">Right</field>
<value name="TFOD_RECOGNITION">
<block type="variables_get" id="ul1yr)Nj@?+*D#_G`L.;">
<field name="VAR" id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="{0Y[K5Wc9E}215e0_oi9">
<field name="NUM">2</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="variables_set" id="j|`waKp%$b@S98aKk`=o">
<field name="VAR" id="R{3+3{j6;,uRMizwTeH6">y</field>
<value name="VALUE">
<block type="math_arithmetic" id="LDDkw}ltw|Cp(4PoUaLC" inline="false">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="@Ci!hzt|h5x`SBx5=~ym">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="tfodRecognition_getProperty_Number" id="|5O#w!V.U26,a`Jiv*y#">
<field name="PROP">Top</field>
<value name="TFOD_RECOGNITION">
<block type="variables_get" id="prN,#?G4*:DVkqcxojKN">
<field name="VAR" id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="tfodRecognition_getProperty_Number" id=",=woW,c`%;[;5VFr:zI^">
<field name="PROP">Bottom</field>
<value name="TFOD_RECOGNITION">
<block type="variables_get" id="h7?@lcOAz?X+Ce236uiW">
<field name="VAR" id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="gqT)Wf]B4e*1i^{2VFG~">
<field name="NUM">2</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="telemetry_addTextData_All" id="^7ZoU4?~A9X@oO-+cDg;">
<comment pinned="false" h="100" w="200">Display the position of the center of the detection boundary for the recognition</comment>
<value name="KEY">
<shadow type="text">
<field name="TEXT">key</field>
</shadow>
<block type="text" id="/!iTh?dK,yp5t7YE;IMZ">
<field name="TEXT">- Position</field>
</block>
</value>
<value name="TEXT">
<shadow type="text">
<field name="TEXT">text</field>
</shadow>
<block type="text_join" id="r;D+0lUYY.W09kml)^X!">
<mutation items="3"/>
<value name="ADD0">
<block type="misc_formatNumber" id="o6-g/(TkZd#CVWXe[b[$">
<value name="NUMBER">
<shadow type="math_number">
<field name="NUM">3.14159265</field>
</shadow>
<block type="variables_get" id="B_{mhA52Ee]xX7dI$QZt">
<field name="VAR" id="h_4q]^+cuMwY?7E#7$Pc">x</field>
</block>
</value>
<value name="PRECISION">
<shadow type="math_number" id="[lWZY7I/M^m,xV3be8As">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</value>
<value name="ADD1">
<block type="text" id="fbCp[T1mB,D5fZ[~p;FS">
<field name="TEXT">, </field>
</block>
</value>
<value name="ADD2">
<block type="misc_formatNumber" id="2x2)7m;p`1m:AHZt(rhp">
<value name="NUMBER">
<shadow type="math_number">
<field name="NUM">3.14159265</field>
</shadow>
<block type="variables_get" id="ix{ZvDx*LQm|B^:n+^mt">
<field name="VAR" id="R{3+3{j6;,uRMizwTeH6">y</field>
</block>
</value>
<value name="PRECISION">
<shadow type="math_number" id="#6cKA-ku|!haVl{Uly+E">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="comment" id="]V=I^tG}Vl-y!Vy!Vcrp">
<field name="COMMENT">Display size</field>
<next>
<block type="telemetry_addTextData_All" id="!xdv?nUjqKHUgo5~(2#c">
<comment pinned="false" h="100" w="200">Display the size of detection boundary for the recognition</comment>
<value name="KEY">
<shadow type="text">
<field name="TEXT">key</field>
</shadow>
<block type="text" id="V5}k~[fhxp=*3o~e#WJ8">
<field name="TEXT">- Size</field>
</block>
</value>
<value name="TEXT">
<shadow type="text">
<field name="TEXT">text</field>
</shadow>
<block type="text_join" id="R;er.t8rsZo;*W#kP7p!">
<mutation items="3"/>
<value name="ADD0">
<block type="misc_formatNumber" id=")!MFU[/@L~HCr_rj=r.}">
<value name="NUMBER">
<shadow type="math_number">
<field name="NUM">3.14159265</field>
</shadow>
<block type="tfodRecognition_getProperty_Number" id="tLq5tEcdzwIr*C8_C9/3">
<field name="PROP">Width</field>
<value name="TFOD_RECOGNITION">
<block type="variables_get" id="?2L@id,/+_B+qCE0(r5t">
<field name="VAR" id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</field>
</block>
</value>
</block>
</value>
<value name="PRECISION">
<shadow type="math_number" id="jK9}3WrLPb(chjLlM_n6">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</value>
<value name="ADD1">
<block type="text" id="!B?XiA#s(L|n2}QzW{M-">
<field name="TEXT"> x </field>
</block>
</value>
<value name="ADD2">
<block type="misc_formatNumber" id="%FBMCF$ZOGz*}{GC!m:;">
<value name="NUMBER">
<shadow type="math_number">
<field name="NUM">3.14159265</field>
</shadow>
<block type="tfodRecognition_getProperty_Number" id="VN%NTH]phJuv+j?NRboq">
<field name="PROP">Height</field>
<value name="TFOD_RECOGNITION">
<block type="variables_get" id="c,NhWqL}-Ot7PBB6si0;">
<field name="VAR" id="0(Iv9ie]^GJxK3,fL}G(">myTfodRecognition</field>
</block>
</value>
</block>
</value>
<value name="PRECISION">
<shadow type="math_number" id=":Qi$iv#0@Lw]RpA#@m~y">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<Extra>
<OpModeMeta flavor="TELEOP" group="" autoTransition="" />
<Enabled value="true" />
</Extra>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment