<xml xmlns="https://developers.google.com/blockly/xml">
  <variables>
    <variable id="v_seen">seen</variable>
    <variable id="v_result">result</variable>
    <variable id="v_leftPower">leftPower</variable>
    <variable id="v_rightPower">rightPower</variable>
    <variable id="v_abort">abort</variable>
    <variable id="v_abortReason">abortReason</variable>
    <variable id="v_area">area</variable>
    <variable id="v_colorCandidate">colorCandidate</variable>
    <variable id="v_tx">tx</variable>
    <variable id="v_rangeInches">rangeInches</variable>
    <variable id="v_tracking">tracking</variable>
    <variable id="v_lastTx">lastTx</variable>
    <variable id="v_lastArea">lastArea</variable>
    <variable id="v_visibleFrames">visibleFrames</variable>
    <variable id="v_centeredFrames">centeredFrames</variable>
    <variable id="v_startRange">startFrontLeftTicks</variable>
    <variable id="v_startBackLeftTicks">startBackLeftTicks</variable>
    <variable id="v_startFrontRightTicks">startFrontRightTicks</variable>
    <variable id="v_startBackRightTicks">startBackRightTicks</variable>
    <variable id="v_goalRange">targetTicks</variable>
    <variable id="v_done">done</variable>
    <variable id="v_lossStartedAt">lossStartedAt</variable>
    <variable id="v_encoderTicks">encoderTicks</variable>
  </variables>
  <block type="procedures_defnoreturn" id="blue_298" deletable="false" x="25" y="30">
    <field name="NAME">runOpMode</field>
    <comment pinned="true" h="110" w="470">BLUE BALL APPROACH STUDY
These are real Limelight, steering and motor Blocks from the deployed autonomous. This teaching excerpt omits the wall guard and is disabled; use the complete robot program to drive.</comment>
    <data>{"commentPositionLeft":161,"commentPositionTop":-27}</data>
    <statement name="STACK">
      <block type="comment" id="student_blue_setup">
        <field name="COMMENT">MOTORS ARE ONLY THE OUTPUT
The four drive motors use encoder mode and start at zero power. The Limelight decides HOW to steer, but these motor blocks do the actual driving. This study copy is disabled because it does not include the real wall guard.</field>
        <next>
          <block type="dcMotor_setProperty_Direction" id="blue_2">
            <field name="IDENTIFIER">front_left_driveAsDcMotor</field>
            <field name="PROP">Direction</field>
            <data>{"IDENTIFIER":"front_left_drive"}</data>
            <value name="VALUE">
              <block type="dcMotor_typedEnum_direction" id="blue_1">
                <field name="DIRECTION">REVERSE</field>
              </block>
            </value>
            <next>
              <block type="dcMotor_setProperty_ZeroPowerBehavior" id="blue_4">
                <field name="IDENTIFIER">front_left_driveAsDcMotor</field>
                <field name="PROP">ZeroPowerBehavior</field>
                <data>{"IDENTIFIER":"front_left_drive"}</data>
                <value name="VALUE">
                  <block type="dcMotor_typedEnum_zeroPowerBehavior" id="blue_3">
                    <field name="ZERO_POWER_BEHAVIOR">BRAKE</field>
                  </block>
                </value>
                <next>
                  <block type="dcMotor_setProperty_RunMode" id="blue_6">
                    <field name="IDENTIFIER">front_left_driveAsDcMotor</field>
                    <field name="PROP">Mode</field>
                    <data>{"IDENTIFIER":"front_left_drive"}</data>
                    <value name="VALUE">
                      <block type="dcMotor_typedEnum_runMode" id="blue_5">
                        <field name="RUN_MODE">RUN_USING_ENCODER</field>
                      </block>
                    </value>
                    <next>
                      <block type="dcMotor_setProperty_Direction" id="blue_8">
                        <field name="IDENTIFIER">back_left_driveAsDcMotor</field>
                        <field name="PROP">Direction</field>
                        <data>{"IDENTIFIER":"back_left_drive"}</data>
                        <value name="VALUE">
                          <block type="dcMotor_typedEnum_direction" id="blue_7">
                            <field name="DIRECTION">REVERSE</field>
                          </block>
                        </value>
                        <next>
                          <block type="dcMotor_setProperty_ZeroPowerBehavior" id="blue_10">
                            <field name="IDENTIFIER">back_left_driveAsDcMotor</field>
                            <field name="PROP">ZeroPowerBehavior</field>
                            <data>{"IDENTIFIER":"back_left_drive"}</data>
                            <value name="VALUE">
                              <block type="dcMotor_typedEnum_zeroPowerBehavior" id="blue_9">
                                <field name="ZERO_POWER_BEHAVIOR">BRAKE</field>
                              </block>
                            </value>
                            <next>
                              <block type="dcMotor_setProperty_RunMode" id="blue_12">
                                <field name="IDENTIFIER">back_left_driveAsDcMotor</field>
                                <field name="PROP">Mode</field>
                                <data>{"IDENTIFIER":"back_left_drive"}</data>
                                <value name="VALUE">
                                  <block type="dcMotor_typedEnum_runMode" id="blue_11">
                                    <field name="RUN_MODE">RUN_USING_ENCODER</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="dcMotor_setProperty_Direction" id="blue_14">
                                    <field name="IDENTIFIER">front_right_driveAsDcMotor</field>
                                    <field name="PROP">Direction</field>
                                    <data>{"IDENTIFIER":"front_right_drive"}</data>
                                    <value name="VALUE">
                                      <block type="dcMotor_typedEnum_direction" id="blue_13">
                                        <field name="DIRECTION">FORWARD</field>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="dcMotor_setProperty_ZeroPowerBehavior" id="blue_16">
                                        <field name="IDENTIFIER">front_right_driveAsDcMotor</field>
                                        <field name="PROP">ZeroPowerBehavior</field>
                                        <data>{"IDENTIFIER":"front_right_drive"}</data>
                                        <value name="VALUE">
                                          <block type="dcMotor_typedEnum_zeroPowerBehavior" id="blue_15">
                                            <field name="ZERO_POWER_BEHAVIOR">BRAKE</field>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="dcMotor_setProperty_RunMode" id="blue_18">
                                            <field name="IDENTIFIER">front_right_driveAsDcMotor</field>
                                            <field name="PROP">Mode</field>
                                            <data>{"IDENTIFIER":"front_right_drive"}</data>
                                            <value name="VALUE">
                                              <block type="dcMotor_typedEnum_runMode" id="blue_17">
                                                <field name="RUN_MODE">RUN_USING_ENCODER</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="dcMotor_setProperty_Direction" id="blue_20">
                                                <field name="IDENTIFIER">back_right_driveAsDcMotor</field>
                                                <field name="PROP">Direction</field>
                                                <data>{"IDENTIFIER":"back_right_drive"}</data>
                                                <value name="VALUE">
                                                  <block type="dcMotor_typedEnum_direction" id="blue_19">
                                                    <field name="DIRECTION">REVERSE</field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="dcMotor_setProperty_ZeroPowerBehavior" id="blue_22">
                                                    <field name="IDENTIFIER">back_right_driveAsDcMotor</field>
                                                    <field name="PROP">ZeroPowerBehavior</field>
                                                    <data>{"IDENTIFIER":"back_right_drive"}</data>
                                                    <value name="VALUE">
                                                      <block type="dcMotor_typedEnum_zeroPowerBehavior" id="blue_21">
                                                        <field name="ZERO_POWER_BEHAVIOR">BRAKE</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="dcMotor_setProperty_RunMode" id="blue_24">
                                                        <field name="IDENTIFIER">back_right_driveAsDcMotor</field>
                                                        <field name="PROP">Mode</field>
                                                        <data>{"IDENTIFIER":"back_right_drive"}</data>
                                                        <value name="VALUE">
                                                          <block type="dcMotor_typedEnum_runMode" id="blue_23">
                                                            <field name="RUN_MODE">RUN_USING_ENCODER</field>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="blue_27">
                                                            <field name="VAR" id="v_leftPower">leftPower</field>
                                                            <value name="VALUE">
                                                              <block type="math_number" id="blue_25">
                                                                <field name="NUM">0</field>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="variables_set" id="blue_28">
                                                                <field name="VAR" id="v_rightPower">rightPower</field>
                                                                <value name="VALUE">
                                                                  <block type="math_number" id="blue_26">
                                                                    <field name="NUM">0</field>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="procedures_callnoreturn" id="blue_29">
                                                                    <mutation name="applyPower" />
                                                                    <next>
                                                                      <block type="comment" id="student_blue_pipeline">
                                                                        <field name="COMMENT">TURN ON THE FRONT LIMELIGHT
Use blue color pipeline 0 and request fresh results. This camera faces FORWARD. The rear Logitech camera is separate and is not part of this lesson.</field>
                                                                        <next>
                                                                          <block type="limelight3A_setPollRateHz" id="blue_31">
                                                                            <field name="IDENTIFIER">limelightAsLimelight3A</field>
                                                                            <data>{"IDENTIFIER":"limelight"}</data>
                                                                            <value name="RATE_HZ">
                                                                              <block type="math_number" id="blue_30">
                                                                                <field name="NUM">100</field>
                                                                              </block>
                                                                            </value>
                                                                            <next>
                                                                              <block type="limelight3A_pipelineSwitch" id="blue_33">
                                                                                <mutation has_output="false" />
                                                                                <field name="IDENTIFIER">limelightAsLimelight3A</field>
                                                                                <data>{"IDENTIFIER":"limelight"}</data>
                                                                                <value name="INDEX">
                                                                                  <block type="math_number" id="blue_32">
                                                                                    <field name="NUM">0</field>
                                                                                  </block>
                                                                                </value>
                                                                                <next>
                                                                                  <block type="limelight3A_start" id="blue_34">
                                                                                    <field name="IDENTIFIER">limelightAsLimelight3A</field>
                                                                                    <data>{"IDENTIFIER":"limelight"}</data>
                                                                                    <next>
                                                                                      <block type="comment" id="student_blue_preview">
                                                                                        <field name="COMMENT">INIT: LOOK BEFORE MOVING
During INIT, read blue contours and show the angle and estimated distance on the Driver Station. The robot must not drive toward a ball it cannot see.</field>
                                                                                        <next>
                                                                                          <block type="controls_whileUntil" id="blue_107">
                                                                                            <field name="MODE">WHILE</field>
                                                                                            <value name="BOOL">
                                                                                              <block type="linearOpMode_opModeInInit" id="blue_88" />
                                                                                            </value>
                                                                                            <statement name="DO">
                                                                                              <block type="procedures_callnoreturn" id="blue_89">
                                                                                                <mutation name="readBlue" />
                                                                                                <next>
                                                                                                  <block type="telemetry_addTextData" id="blue_92">
                                                                                                    <value name="KEY">
                                                                                                      <block type="text" id="blue_90">
                                                                                                        <field name="TEXT">Phase</field>
                                                                                                      </block>
                                                                                                    </value>
                                                                                                    <value name="TEXT">
                                                                                                      <block type="text" id="blue_91">
                                                                                                        <field name="TEXT">INIT: blue ball preview; check clear path</field>
                                                                                                      </block>
                                                                                                    </value>
                                                                                                    <next>
                                                                                                      <block type="controls_if" id="blue_103">
                                                                                                        <mutation else="1" />
                                                                                                        <value name="IF0">
                                                                                                          <block type="variables_get" id="blue_93">
                                                                                                            <field name="VAR" id="v_seen">seen</field>
                                                                                                          </block>
                                                                                                        </value>
                                                                                                        <statement name="DO0">
                                                                                                          <block type="telemetry_addNumericData" id="blue_96">
                                                                                                            <value name="KEY">
                                                                                                              <block type="text" id="blue_95">
                                                                                                                <field name="TEXT">Blue tx (deg)</field>
                                                                                                              </block>
                                                                                                            </value>
                                                                                                            <value name="NUMBER">
                                                                                                              <block type="variables_get" id="blue_94">
                                                                                                                <field name="VAR" id="v_tx">tx</field>
                                                                                                              </block>
                                                                                                            </value>
                                                                                                            <next>
                                                                                                              <block type="telemetry_addNumericData" id="blue_99">
                                                                                                                <value name="KEY">
                                                                                                                  <block type="text" id="blue_98">
                                                                                                                    <field name="TEXT">Lens-to-ball center (in)</field>
                                                                                                                  </block>
                                                                                                                </value>
                                                                                                                <value name="NUMBER">
                                                                                                                  <block type="variables_get" id="blue_97">
                                                                                                                    <field name="VAR" id="v_rangeInches">rangeInches</field>
                                                                                                                  </block>
                                                                                                                </value>
                                                                                                                <next>
                                                                                                                  <block type="telemetry_addNumericData" id="fixed_contour_telemetry">
                                                                                                                    <value name="KEY">
                                                                                                                      <block type="text" id="fixed_contour_label">
                                                                                                                        <field name="TEXT">Blue contour (fraction)</field>
                                                                                                                      </block>
                                                                                                                    </value>
                                                                                                                    <value name="NUMBER">
                                                                                                                      <block type="variables_get" id="fixed_contour_value">
                                                                                                                        <field name="VAR" id="v_area">area</field>
                                                                                                                      </block>
                                                                                                                    </value>
                                                                                                                    <next>
                                                                                                                      <block type="telemetry_addNumericData" id="ball_gap_preview">
                                                                                                                        <value name="KEY">
                                                                                                                          <block type="text" id="ball_gap_preview_label">
                                                                                                                            <field name="TEXT">Lens-to-ball gap est (in)</field>
                                                                                                                          </block>
                                                                                                                        </value>
                                                                                                                        <value name="NUMBER">
                                                                                                                          <block type="math_arithmetic" id="ball_gap_preview_difference">
                                                                                                                            <field name="OP">MINUS</field>
                                                                                                                            <value name="A">
                                                                                                                              <block type="variables_get" id="ball_gap_preview_range">
                                                                                                                                <field name="VAR" id="v_rangeInches">rangeInches</field>
                                                                                                                              </block>
                                                                                                                            </value>
                                                                                                                            <value name="B">
                                                                                                                              <block type="math_number" id="ball_gap_preview_radius">
                                                                                                                                <field name="NUM">1.4</field>
                                                                                                                              </block>
                                                                                                                            </value>
                                                                                                                          </block>
                                                                                                                        </value>
                                                                                                                      </block>
                                                                                                                    </next>
                                                                                                                  </block>
                                                                                                                </next>
                                                                                                              </block>
                                                                                                            </next>
                                                                                                          </block>
                                                                                                        </statement>
                                                                                                        <statement name="ELSE">
                                                                                                          <block type="telemetry_addTextData" id="blue_102">
                                                                                                            <value name="KEY">
                                                                                                              <block type="text" id="blue_100">
                                                                                                                <field name="TEXT">Blue ball</field>
                                                                                                              </block>
                                                                                                            </value>
                                                                                                            <value name="TEXT">
                                                                                                              <block type="text" id="blue_101">
                                                                                                                <field name="TEXT">not detected; robot will not drive</field>
                                                                                                              </block>
                                                                                                            </value>
                                                                                                          </block>
                                                                                                        </statement>
                                                                                                        <next>
                                                                                                          <block type="telemetry_update" id="blue_104">
                                                                                                            <next>
                                                                                                              <block type="linearOpMode_sleep" id="blue_106">
                                                                                                                <value name="MILLISECONDS">
                                                                                                                  <block type="math_number" id="blue_105">
                                                                                                                    <field name="NUM">50</field>
                                                                                                                  </block>
                                                                                                                </value>
                                                                                                              </block>
                                                                                                            </next>
                                                                                                          </block>
                                                                                                        </next>
                                                                                                      </block>
                                                                                                    </next>
                                                                                                  </block>
                                                                                                </next>
                                                                                              </block>
                                                                                            </statement>
                                                                                            <next>
                                                                                              <block type="linearOpMode_waitForStart" id="blue_280">
                                                                                                <next>
                                                                                                  <block type="variables_set" id="blue_282">
                                                                                                    <field name="VAR" id="v_visibleFrames">visibleFrames</field>
                                                                                                    <value name="VALUE">
                                                                                                      <block type="math_number" id="blue_281">
                                                                                                        <field name="NUM">0</field>
                                                                                                      </block>
                                                                                                    </value>
                                                                                                    <next>
                                                                                                      <block type="variables_set" id="blue_284">
                                                                                                        <field name="VAR" id="v_centeredFrames">centeredFrames</field>
                                                                                                        <value name="VALUE">
                                                                                                          <block type="math_number" id="blue_283">
                                                                                                            <field name="NUM">0</field>
                                                                                                          </block>
                                                                                                        </value>
                                                                                                        <next>
                                                                                                          <block type="linearOpMode_resetRuntime" id="blue_285">
                                                                                                            <next>
                                                                                                              <block type="comment" id="student_blue_center">
                                                                                                                <field name="COMMENT">FIRST: CENTER THE CAMERA
Check several fresh frames. Turn left or right until the ball's horizontal angle is within 2 degrees for five checks. If the ball disappears or is far off-screen, stop the motors instead of guessing.</field>
                                                                                                                <next>
                                                                                                                  <block type="controls_whileUntil" id="blue_181">
                                                                                                                    <field name="MODE">WHILE</field>
                                                                                                                    <value name="BOOL">
                                                                                                                      <block type="logic_operation" id="5HAy%^Je]vV|i%zr)a=4">
                                                                                                                        <field name="OP">AND</field>
                                                                                                                        <value name="A">
                                                                                                                          <block type="logic_operation" id="blue_170">
                                                                                                                            <field name="OP">AND</field>
                                                                                                                            <value name="A">
                                                                                                                              <block type="linearOpMode_opModeIsActive" id="blue_162" />
                                                                                                                            </value>
                                                                                                                            <value name="B">
                                                                                                                              <block type="logic_operation" id="blue_169">
                                                                                                                                <field name="OP">AND</field>
                                                                                                                                <value name="A">
                                                                                                                                  <block type="logic_compare" id="blue_165">
                                                                                                                                    <field name="OP">LT</field>
                                                                                                                                    <value name="A">
                                                                                                                                      <block type="linearOpMode_getRuntime" id="blue_163" />
                                                                                                                                    </value>
                                                                                                                                    <value name="B">
                                                                                                                                      <block type="math_number" id="blue_164">
                                                                                                                                        <field name="NUM">6</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                                <value name="B">
                                                                                                                                  <block type="logic_compare" id="blue_168">
                                                                                                                                    <field name="OP">LT</field>
                                                                                                                                    <value name="A">
                                                                                                                                      <block type="variables_get" id="blue_166">
                                                                                                                                        <field name="VAR" id="v_centeredFrames">centeredFrames</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                    <value name="B">
                                                                                                                                      <block type="math_number" id="blue_167">
                                                                                                                                        <field name="NUM">5</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                              </block>
                                                                                                                            </value>
                                                                                                                          </block>
                                                                                                                        </value>
                                                                                                                        <value name="B">
                                                                                                                          <block type="logic_negate" id="y:?%WI=e86~M}N)%]T*p">
                                                                                                                            <value name="BOOL">
                                                                                                                              <block type="variables_get" id="PquxfkNXM7|YxKzkMUcc">
                                                                                                                                <field name="VAR" id="v_abort">abort</field>
                                                                                                                              </block>
                                                                                                                            </value>
                                                                                                                          </block>
                                                                                                                        </value>
                                                                                                                      </block>
                                                                                                                    </value>
                                                                                                                    <statement name="DO">
                                                                                                                      <block type="procedures_callnoreturn" id="blue_171">
                                                                                                                        <mutation name="readBlue" />
                                                                                                                        <next>
                                                                                                                          <block type="controls_if" id="blue_161">
                                                                                                                            <mutation else="1" />
                                                                                                                            <value name="IF0">
                                                                                                                              <block type="logic_operation" id="%DT1(cEpB#,fKTTPTlwP">
                                                                                                                                <field name="OP">AND</field>
                                                                                                                                <value name="A">
                                                                                                                                  <block type="variables_get" id="blue_108">
                                                                                                                                    <field name="VAR" id="v_seen">seen</field>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                                <value name="B">
                                                                                                                                  <block type="logic_compare" id="[EeZ}Y!zP}e|H9^x!AV4">
                                                                                                                                    <field name="OP">LT</field>
                                                                                                                                    <value name="A">
                                                                                                                                      <block type="math_single" id="K4~l+{,D[qxcm0^.b3V8">
                                                                                                                                        <field name="OP">ABS</field>
                                                                                                                                        <value name="NUM">
                                                                                                                                          <block type="variables_get" id="sk7c:b5O,~hh@RU`Lq60">
                                                                                                                                            <field name="VAR" id="v_tx">tx</field>
                                                                                                                                          </block>
                                                                                                                                        </value>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                    <value name="B">
                                                                                                                                      <block type="math_number" id="?jx6Bs6^vpY$P[`lI(-t">
                                                                                                                                        <field name="NUM">25</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                              </block>
                                                                                                                            </value>
                                                                                                                            <statement name="DO0">
                                                                                                                              <block type="variables_set" id="blue_112">
                                                                                                                                <field name="VAR" id="v_visibleFrames">visibleFrames</field>
                                                                                                                                <value name="VALUE">
                                                                                                                                  <block type="math_arithmetic" id="blue_111">
                                                                                                                                    <field name="OP">ADD</field>
                                                                                                                                    <value name="A">
                                                                                                                                      <block type="variables_get" id="blue_109">
                                                                                                                                        <field name="VAR" id="v_visibleFrames">visibleFrames</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                    <value name="B">
                                                                                                                                      <block type="math_number" id="blue_110">
                                                                                                                                        <field name="NUM">1</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                                <next>
                                                                                                                                  <block type="controls_if" id="blue_151">
                                                                                                                                    <mutation else="1" />
                                                                                                                                    <value name="IF0">
                                                                                                                                      <block type="logic_compare" id="blue_115">
                                                                                                                                        <field name="OP">GTE</field>
                                                                                                                                        <value name="A">
                                                                                                                                          <block type="variables_get" id="blue_113">
                                                                                                                                            <field name="VAR" id="v_visibleFrames">visibleFrames</field>
                                                                                                                                          </block>
                                                                                                                                        </value>
                                                                                                                                        <value name="B">
                                                                                                                                          <block type="math_number" id="blue_114">
                                                                                                                                            <field name="NUM">5</field>
                                                                                                                                          </block>
                                                                                                                                        </value>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                    <statement name="DO0">
                                                                                                                                      <block type="controls_if" id="blue_145">
                                                                                                                                        <mutation else="1" />
                                                                                                                                        <value name="IF0">
                                                                                                                                          <block type="logic_compare" id="blue_119">
                                                                                                                                            <field name="OP">LTE</field>
                                                                                                                                            <value name="A">
                                                                                                                                              <block type="math_single" id="blue_117">
                                                                                                                                                <field name="OP">ABS</field>
                                                                                                                                                <value name="NUM">
                                                                                                                                                  <block type="variables_get" id="blue_116">
                                                                                                                                                    <field name="VAR" id="v_tx">tx</field>
                                                                                                                                                  </block>
                                                                                                                                                </value>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                            <value name="B">
                                                                                                                                              <block type="math_number" id="blue_118">
                                                                                                                                                <field name="NUM">2</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                          </block>
                                                                                                                                        </value>
                                                                                                                                        <statement name="DO0">
                                                                                                                                          <block type="variables_set" id="blue_122">
                                                                                                                                            <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                            <value name="VALUE">
                                                                                                                                              <block type="math_number" id="blue_120">
                                                                                                                                                <field name="NUM">0</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                            <next>
                                                                                                                                              <block type="variables_set" id="blue_123">
                                                                                                                                                <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                                <value name="VALUE">
                                                                                                                                                  <block type="math_number" id="blue_121">
                                                                                                                                                    <field name="NUM">0</field>
                                                                                                                                                  </block>
                                                                                                                                                </value>
                                                                                                                                                <next>
                                                                                                                                                  <block type="procedures_callnoreturn" id="blue_124">
                                                                                                                                                    <mutation name="applyPower" />
                                                                                                                                                    <next>
                                                                                                                                                      <block type="variables_set" id="blue_128">
                                                                                                                                                        <field name="VAR" id="v_centeredFrames">centeredFrames</field>
                                                                                                                                                        <value name="VALUE">
                                                                                                                                                          <block type="math_arithmetic" id="blue_127">
                                                                                                                                                            <field name="OP">ADD</field>
                                                                                                                                                            <value name="A">
                                                                                                                                                              <block type="variables_get" id="blue_125">
                                                                                                                                                                <field name="VAR" id="v_centeredFrames">centeredFrames</field>
                                                                                                                                                              </block>
                                                                                                                                                            </value>
                                                                                                                                                            <value name="B">
                                                                                                                                                              <block type="math_number" id="blue_126">
                                                                                                                                                                <field name="NUM">1</field>
                                                                                                                                                              </block>
                                                                                                                                                            </value>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                      </block>
                                                                                                                                                    </next>
                                                                                                                                                  </block>
                                                                                                                                                </next>
                                                                                                                                              </block>
                                                                                                                                            </next>
                                                                                                                                          </block>
                                                                                                                                        </statement>
                                                                                                                                        <statement name="ELSE">
                                                                                                                                          <block type="variables_set" id="blue_130">
                                                                                                                                            <field name="VAR" id="v_centeredFrames">centeredFrames</field>
                                                                                                                                            <value name="VALUE">
                                                                                                                                              <block type="math_number" id="blue_129">
                                                                                                                                                <field name="NUM">0</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                            <next>
                                                                                                                                              <block type="controls_if" id="blue_144">
                                                                                                                                                <mutation else="1" />
                                                                                                                                                <value name="IF0">
                                                                                                                                                  <block type="logic_compare" id="blue_133">
                                                                                                                                                    <field name="OP">GT</field>
                                                                                                                                                    <value name="A">
                                                                                                                                                      <block type="variables_get" id="blue_131">
                                                                                                                                                        <field name="VAR" id="v_tx">tx</field>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                    <value name="B">
                                                                                                                                                      <block type="math_number" id="blue_132">
                                                                                                                                                        <field name="NUM">0</field>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                  </block>
                                                                                                                                                </value>
                                                                                                                                                <statement name="DO0">
                                                                                                                                                  <block type="variables_set" id="blue_136">
                                                                                                                                                    <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                                    <value name="VALUE">
                                                                                                                                                      <block type="math_number" id="blue_134">
                                                                                                                                                        <field name="NUM">0.12</field>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                    <next>
                                                                                                                                                      <block type="variables_set" id="blue_137">
                                                                                                                                                        <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                                        <value name="VALUE">
                                                                                                                                                          <block type="math_number" id="blue_135">
                                                                                                                                                            <field name="NUM">-0.12</field>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                        <next>
                                                                                                                                                          <block type="procedures_callnoreturn" id="blue_138">
                                                                                                                                                            <mutation name="applyPower" />
                                                                                                                                                          </block>
                                                                                                                                                        </next>
                                                                                                                                                      </block>
                                                                                                                                                    </next>
                                                                                                                                                  </block>
                                                                                                                                                </statement>
                                                                                                                                                <statement name="ELSE">
                                                                                                                                                  <block type="variables_set" id="blue_141">
                                                                                                                                                    <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                                    <value name="VALUE">
                                                                                                                                                      <block type="math_number" id="blue_139">
                                                                                                                                                        <field name="NUM">-0.12</field>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                    <next>
                                                                                                                                                      <block type="variables_set" id="blue_142">
                                                                                                                                                        <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                                        <value name="VALUE">
                                                                                                                                                          <block type="math_number" id="blue_140">
                                                                                                                                                            <field name="NUM">0.12</field>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                        <next>
                                                                                                                                                          <block type="procedures_callnoreturn" id="blue_143">
                                                                                                                                                            <mutation name="applyPower" />
                                                                                                                                                          </block>
                                                                                                                                                        </next>
                                                                                                                                                      </block>
                                                                                                                                                    </next>
                                                                                                                                                  </block>
                                                                                                                                                </statement>
                                                                                                                                              </block>
                                                                                                                                            </next>
                                                                                                                                          </block>
                                                                                                                                        </statement>
                                                                                                                                      </block>
                                                                                                                                    </statement>
                                                                                                                                    <statement name="ELSE">
                                                                                                                                      <block type="variables_set" id="blue_148">
                                                                                                                                        <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                        <value name="VALUE">
                                                                                                                                          <block type="math_number" id="blue_146">
                                                                                                                                            <field name="NUM">0</field>
                                                                                                                                          </block>
                                                                                                                                        </value>
                                                                                                                                        <next>
                                                                                                                                          <block type="variables_set" id="blue_149">
                                                                                                                                            <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                            <value name="VALUE">
                                                                                                                                              <block type="math_number" id="blue_147">
                                                                                                                                                <field name="NUM">0</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                            <next>
                                                                                                                                              <block type="procedures_callnoreturn" id="blue_150">
                                                                                                                                                <mutation name="applyPower" />
                                                                                                                                              </block>
                                                                                                                                            </next>
                                                                                                                                          </block>
                                                                                                                                        </next>
                                                                                                                                      </block>
                                                                                                                                    </statement>
                                                                                                                                  </block>
                                                                                                                                </next>
                                                                                                                              </block>
                                                                                                                            </statement>
                                                                                                                            <statement name="ELSE">
                                                                                                                              <block type="variables_set" id="blue_154">
                                                                                                                                <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                <value name="VALUE">
                                                                                                                                  <block type="math_number" id="blue_152">
                                                                                                                                    <field name="NUM">0</field>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                                <next>
                                                                                                                                  <block type="variables_set" id="blue_155">
                                                                                                                                    <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                    <value name="VALUE">
                                                                                                                                      <block type="math_number" id="blue_153">
                                                                                                                                        <field name="NUM">0</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                    <next>
                                                                                                                                      <block type="procedures_callnoreturn" id="blue_156">
                                                                                                                                        <mutation name="applyPower" />
                                                                                                                                        <next>
                                                                                                                                          <block type="variables_set" id="blue_158">
                                                                                                                                            <field name="VAR" id="v_visibleFrames">visibleFrames</field>
                                                                                                                                            <value name="VALUE">
                                                                                                                                              <block type="math_number" id="blue_157">
                                                                                                                                                <field name="NUM">0</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                            <next>
                                                                                                                                              <block type="variables_set" id="blue_160">
                                                                                                                                                <field name="VAR" id="v_centeredFrames">centeredFrames</field>
                                                                                                                                                <value name="VALUE">
                                                                                                                                                  <block type="math_number" id="blue_159">
                                                                                                                                                    <field name="NUM">0</field>
                                                                                                                                                  </block>
                                                                                                                                                </value>
                                                                                                                                              </block>
                                                                                                                                            </next>
                                                                                                                                          </block>
                                                                                                                                        </next>
                                                                                                                                      </block>
                                                                                                                                    </next>
                                                                                                                                  </block>
                                                                                                                                </next>
                                                                                                                              </block>
                                                                                                                            </statement>
                                                                                                                            <next>
                                                                                                                              <block type="telemetry_addNumericData" id="blue_174">
                                                                                                                                <value name="KEY">
                                                                                                                                  <block type="text" id="blue_173">
                                                                                                                                    <field name="TEXT">Blue tx (deg)</field>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                                <value name="NUMBER">
                                                                                                                                  <block type="variables_get" id="blue_172">
                                                                                                                                    <field name="VAR" id="v_tx">tx</field>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                                <next>
                                                                                                                                  <block type="telemetry_addNumericData" id="blue_177">
                                                                                                                                    <value name="KEY">
                                                                                                                                      <block type="text" id="blue_176">
                                                                                                                                        <field name="TEXT">Centered frames</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                    <value name="NUMBER">
                                                                                                                                      <block type="variables_get" id="blue_175">
                                                                                                                                        <field name="VAR" id="v_centeredFrames">centeredFrames</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                    <next>
                                                                                                                                      <block type="telemetry_update" id="blue_178">
                                                                                                                                        <next>
                                                                                                                                          <block type="linearOpMode_sleep" id="blue_180">
                                                                                                                                            <value name="MILLISECONDS">
                                                                                                                                              <block type="math_number" id="blue_179">
                                                                                                                                                <field name="NUM">25</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                          </block>
                                                                                                                                        </next>
                                                                                                                                      </block>
                                                                                                                                    </next>
                                                                                                                                  </block>
                                                                                                                                </next>
                                                                                                                              </block>
                                                                                                                            </next>
                                                                                                                          </block>
                                                                                                                        </next>
                                                                                                                      </block>
                                                                                                                    </statement>
                                                                                                                    <next>
                                                                                                                      <block type="variables_set" id="blue_288">
                                                                                                                        <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                        <value name="VALUE">
                                                                                                                          <block type="math_number" id="blue_286">
                                                                                                                            <field name="NUM">0</field>
                                                                                                                          </block>
                                                                                                                        </value>
                                                                                                                        <next>
                                                                                                                          <block type="variables_set" id="blue_289">
                                                                                                                            <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                            <value name="VALUE">
                                                                                                                              <block type="math_number" id="blue_287">
                                                                                                                                <field name="NUM">0</field>
                                                                                                                              </block>
                                                                                                                            </value>
                                                                                                                            <next>
                                                                                                                              <block type="procedures_callnoreturn" id="blue_290">
                                                                                                                                <mutation name="applyPower" />
                                                                                                                                <next>
                                                                                                                                  <block type="comment" id="student_blue_approach">
                                                                                                                                    <field name="COMMENT">THEN: DRIVE WHILE RE-CENTERING
Only enter the approach after a stable center and a blue ball farther than the estimated 4.4-inch lens-to-center target. This is about a 3-inch gap to the surface of a 2.8-inch ball, not a tape-verified stopping distance.</field>
                                                                                                                                    <next>
                                                                                                                                      <block type="controls_if" id="blue_279">
                                                                                                                                        <mutation else="1" />
                                                                                                                                        <value name="IF0">
                                                                                                                                          <block type="logic_operation" id="blue_275">
                                                                                                                                            <field name="OP">AND</field>
                                                                                                                                            <value name="A">
                                                                                                                                              <block type="linearOpMode_opModeIsActive" id="blue_265" />
                                                                                                                                            </value>
                                                                                                                                            <value name="B">
                                                                                                                                              <block type="logic_operation" id="blue_274">
                                                                                                                                                <field name="OP">AND</field>
                                                                                                                                                <value name="A">
                                                                                                                                                  <block type="logic_compare" id="blue_268">
                                                                                                                                                    <field name="OP">GTE</field>
                                                                                                                                                    <value name="A">
                                                                                                                                                      <block type="variables_get" id="blue_266">
                                                                                                                                                        <field name="VAR" id="v_centeredFrames">centeredFrames</field>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                    <value name="B">
                                                                                                                                                      <block type="math_number" id="blue_267">
                                                                                                                                                        <field name="NUM">5</field>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                  </block>
                                                                                                                                                </value>
                                                                                                                                                <value name="B">
                                                                                                                                                  <block type="logic_operation" id="blue_273">
                                                                                                                                                    <field name="OP">AND</field>
                                                                                                                                                    <value name="A">
                                                                                                                                                      <block type="variables_get" id="blue_269">
                                                                                                                                                        <field name="VAR" id="v_seen">seen</field>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                    <value name="B">
                                                                                                                                                      <block type="logic_compare" id="blue_272">
                                                                                                                                                        <field name="OP">GT</field>
                                                                                                                                                        <value name="A">
                                                                                                                                                          <block type="variables_get" id="blue_270">
                                                                                                                                                            <field name="VAR" id="v_rangeInches">rangeInches</field>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                        <value name="B">
                                                                                                                                                          <block type="math_number" id="blue_271">
                                                                                                                                                            <field name="NUM">4.4</field>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                  </block>
                                                                                                                                                </value>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                          </block>
                                                                                                                                        </value>
                                                                                                                                        <statement name="DO0">
                                                                                                                                          <block type="variables_set" id="tracking_enable">
                                                                                                                                            <field name="VAR" id="v_tracking">tracking</field>
                                                                                                                                            <value name="VALUE">
                                                                                                                                              <block type="logic_boolean" id="tracking_true">
                                                                                                                                                <field name="BOOL">TRUE</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                            <next>
                                                                                                                                              <block type="variables_set" id="tracking_seed_tx">
                                                                                                                                                <field name="VAR" id="v_lastTx">lastTx</field>
                                                                                                                                                <value name="VALUE">
                                                                                                                                                  <block type="variables_get" id="tracking_centered_tx">
                                                                                                                                                    <field name="VAR" id="v_tx">tx</field>
                                                                                                                                                  </block>
                                                                                                                                                </value>
                                                                                                                                                <next>
                                                                                                                                                  <block type="variables_set" id="tracking_seed_area">
                                                                                                                                                    <field name="VAR" id="v_lastArea">lastArea</field>
                                                                                                                                                    <value name="VALUE">
                                                                                                                                                      <block type="variables_get" id="tracking_centered_area">
                                                                                                                                                        <field name="VAR" id="v_area">area</field>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                    <next>
                                                                                                                                                      <block type="variables_set" id="blue_242">
                                                                                                                                                        <field name="VAR" id="v_startRange">startFrontLeftTicks</field>
                                                                                                                                                        <value name="VALUE">
                                                                                                                                                          <block type="dcMotor_getProperty_Number" id="0U.QRzy.4,)f%[3UJCu{">
                                                                                                                                                            <field name="IDENTIFIER">front_left_driveAsDcMotor</field>
                                                                                                                                                            <field name="PROP">CurrentPosition</field>
                                                                                                                                                            <data>{"IDENTIFIER":"front_left_drive"}</data>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                        <next>
                                                                                                                                                          <block type="variables_set" id="z#dZ-u{/#Z6K{)lqTb`;">
                                                                                                                                                            <field name="VAR" id="v_startBackLeftTicks">startBackLeftTicks</field>
                                                                                                                                                            <value name="VALUE">
                                                                                                                                                              <block type="dcMotor_getProperty_Number" id="63KNW0joCAA?hnyDsAX]">
                                                                                                                                                                <field name="IDENTIFIER">back_left_driveAsDcMotor</field>
                                                                                                                                                                <field name="PROP">CurrentPosition</field>
                                                                                                                                                                <data>{"IDENTIFIER":"back_left_drive"}</data>
                                                                                                                                                              </block>
                                                                                                                                                            </value>
                                                                                                                                                            <next>
                                                                                                                                                              <block type="variables_set" id="yMP}8R];gGCq]+O@}d%V">
                                                                                                                                                                <field name="VAR" id="v_startFrontRightTicks">startFrontRightTicks</field>
                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                  <block type="dcMotor_getProperty_Number" id="-=du4eYjOi{[Qr`b#-I,">
                                                                                                                                                                    <field name="IDENTIFIER">front_right_driveAsDcMotor</field>
                                                                                                                                                                    <field name="PROP">CurrentPosition</field>
                                                                                                                                                                    <data>{"IDENTIFIER":"front_right_drive"}</data>
                                                                                                                                                                  </block>
                                                                                                                                                                </value>
                                                                                                                                                                <next>
                                                                                                                                                                  <block type="variables_set" id="I^Cy9d1j~uf1W:2Y`Plr">
                                                                                                                                                                    <field name="VAR" id="v_startBackRightTicks">startBackRightTicks</field>
                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                      <block type="dcMotor_getProperty_Number" id="3PjKEo/(PBu#oZsx_dN/">
                                                                                                                                                                        <field name="IDENTIFIER">back_right_driveAsDcMotor</field>
                                                                                                                                                                        <field name="PROP">CurrentPosition</field>
                                                                                                                                                                        <data>{"IDENTIFIER":"back_right_drive"}</data>
                                                                                                                                                                      </block>
                                                                                                                                                                    </value>
                                                                                                                                                                    <next>
                                                                                                                                                                      <block type="variables_set" id="blue_246">
                                                                                                                                                                        <field name="VAR" id="v_goalRange">targetTicks</field>
                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                          <block type="math_arithmetic" id="ball_dynamic_encoder_cap">
                                                                                                                                                                            <field name="OP">MULTIPLY</field>
                                                                                                                                                                            <value name="A">
                                                                                                                                                                              <block type="math_arithmetic" id="ball_remaining_camera_range">
                                                                                                                                                                                <field name="OP">MINUS</field>
                                                                                                                                                                                <value name="A">
                                                                                                                                                                                  <block type="variables_get" id="ball_initial_range">
                                                                                                                                                                                    <field name="VAR" id="v_rangeInches">rangeInches</field>
                                                                                                                                                                                  </block>
                                                                                                                                                                                </value>
                                                                                                                                                                                <value name="B">
                                                                                                                                                                                  <block type="math_number" id="ball_center_stop_range">
                                                                                                                                                                                    <field name="NUM">4.4</field>
                                                                                                                                                                                  </block>
                                                                                                                                                                                </value>
                                                                                                                                                                              </block>
                                                                                                                                                                            </value>
                                                                                                                                                                            <value name="B">
                                                                                                                                                                              <block type="math_number" id="ball_ticks_per_inch">
                                                                                                                                                                                <field name="NUM">115</field>
                                                                                                                                                                              </block>
                                                                                                                                                                            </value>
                                                                                                                                                                          </block>
                                                                                                                                                                        </value>
                                                                                                                                                                        <next>
                                                                                                                                                                          <block type="variables_set" id="blue_248">
                                                                                                                                                                            <field name="VAR" id="v_done">done</field>
                                                                                                                                                                            <value name="VALUE">
                                                                                                                                                                              <block type="logic_boolean" id="blue_247">
                                                                                                                                                                                <field name="BOOL">FALSE</field>
                                                                                                                                                                              </block>
                                                                                                                                                                            </value>
                                                                                                                                                                            <next>
                                                                                                                                                                              <block type="variables_set" id="blue_250">
                                                                                                                                                                                <field name="VAR" id="v_abort">abort</field>
                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                  <block type="logic_boolean" id="blue_249">
                                                                                                                                                                                    <field name="BOOL">FALSE</field>
                                                                                                                                                                                  </block>
                                                                                                                                                                                </value>
                                                                                                                                                                                <next>
                                                                                                                                                                                  <block type="variables_set" id="z/HcW/,]:e;;DAA:v0+_">
                                                                                                                                                                                    <field name="VAR" id="v_abortReason">abortReason</field>
                                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                                      <block type="text" id="vA:;6vr%FVc(t@vyiDsk">
                                                                                                                                                                                        <field name="TEXT">STOPPED: 16-second approach timeout</field>
                                                                                                                                                                                      </block>
                                                                                                                                                                                    </value>
                                                                                                                                                                                    <next>
                                                                                                                                                                                      <block type="variables_set" id="~W3}+_]g7x60p1$:E(wJ">
                                                                                                                                                                                        <field name="VAR" id="v_lossStartedAt">lossStartedAt</field>
                                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                                          <block type="math_number" id="7D.]i3NQwu}o,1OHo+;8">
                                                                                                                                                                                            <field name="NUM">-1</field>
                                                                                                                                                                                          </block>
                                                                                                                                                                                        </value>
                                                                                                                                                                                        <next>
                                                                                                                                                                                          <block type="linearOpMode_resetRuntime" id="blue_251">
                                                                                                                                                                                            <next>
                                                                                                                                                                                              <block type="controls_whileUntil" id="blue_240">
                                                                                                                                                                                                <field name="MODE">WHILE</field>
                                                                                                                                                                                                <value name="BOOL">
                                                                                                                                                                                                  <block type="logic_operation" id="blue_230">
                                                                                                                                                                                                    <field name="OP">AND</field>
                                                                                                                                                                                                    <value name="A">
                                                                                                                                                                                                      <block type="linearOpMode_opModeIsActive" id="blue_220" />
                                                                                                                                                                                                    </value>
                                                                                                                                                                                                    <value name="B">
                                                                                                                                                                                                      <block type="logic_operation" id="blue_229">
                                                                                                                                                                                                        <field name="OP">AND</field>
                                                                                                                                                                                                        <value name="A">
                                                                                                                                                                                                          <block type="logic_compare" id="blue_223">
                                                                                                                                                                                                            <field name="OP">LT</field>
                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                              <block type="linearOpMode_getRuntime" id="blue_221" />
                                                                                                                                                                                                            </value>
                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                              <block type="math_number" id="blue_222">
                                                                                                                                                                                                                <field name="NUM">16</field>
                                                                                                                                                                                                              </block>
                                                                                                                                                                                                            </value>
                                                                                                                                                                                                          </block>
                                                                                                                                                                                                        </value>
                                                                                                                                                                                                        <value name="B">
                                                                                                                                                                                                          <block type="logic_operation" id="blue_228">
                                                                                                                                                                                                            <field name="OP">AND</field>
                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                              <block type="logic_negate" id="blue_225">
                                                                                                                                                                                                                <value name="BOOL">
                                                                                                                                                                                                                  <block type="variables_get" id="blue_224">
                                                                                                                                                                                                                    <field name="VAR" id="v_done">done</field>
                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                </value>
                                                                                                                                                                                                              </block>
                                                                                                                                                                                                            </value>
                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                              <block type="logic_negate" id="blue_227">
                                                                                                                                                                                                                <value name="BOOL">
                                                                                                                                                                                                                  <block type="variables_get" id="blue_226">
                                                                                                                                                                                                                    <field name="VAR" id="v_abort">abort</field>
                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                </value>
                                                                                                                                                                                                              </block>
                                                                                                                                                                                                            </value>
                                                                                                                                                                                                          </block>
                                                                                                                                                                                                        </value>
                                                                                                                                                                                                      </block>
                                                                                                                                                                                                    </value>
                                                                                                                                                                                                  </block>
                                                                                                                                                                                                </value>
                                                                                                                                                                                                <statement name="DO">
                                                                                                                                                                                                  <block type="comment" id="student_blue_recheck">
                                                                                                                                                                                                    <field name="COMMENT">LOOK AGAIN EVERY LOOP
Every 25 milliseconds, take a NEW Limelight reading. Do not steer using the ball's old position: the robot and ball can both move between frames.</field>
                                                                                                                                                                                                    <next>
                                                                                                                                                                                                      <block type="procedures_callnoreturn" id="blue_231">
                                                                                                                                                                                                        <mutation name="readBlue" />
                                                                                                                                                                                                        <next>
                                                                                                                                                                                                          <block type="variables_set" id="Nti[jb6DB8[|5%/9v,t1">
                                                                                                                                                                                                            <field name="VAR" id="v_encoderTicks">encoderTicks</field>
                                                                                                                                                                                                            <value name="VALUE">
                                                                                                                                                                                                              <block type="math_on_list" id="ky0v4!kfW*784veX+MdB">
                                                                                                                                                                                                                <mutation op="MAX" />
                                                                                                                                                                                                                <field name="OP">MAX</field>
                                                                                                                                                                                                                <value name="LIST">
                                                                                                                                                                                                                  <block type="lists_create_with" id="me+xRU-%cjo_RuKyCy-J">
                                                                                                                                                                                                                    <mutation items="4" />
                                                                                                                                                                                                                    <value name="ADD0">
                                                                                                                                                                                                                      <block type="math_single" id="pj/UFc1C)yzO5$x+eAu]">
                                                                                                                                                                                                                        <field name="OP">ABS</field>
                                                                                                                                                                                                                        <value name="NUM">
                                                                                                                                                                                                                          <block type="math_arithmetic" id="1my7n|f59uHK`|e3K=a-">
                                                                                                                                                                                                                            <field name="OP">MINUS</field>
                                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                                              <block type="dcMotor_getProperty_Number" id=",4[]Zcv#15)E*sv~)dIf">
                                                                                                                                                                                                                                <field name="IDENTIFIER">front_left_driveAsDcMotor</field>
                                                                                                                                                                                                                                <field name="PROP">CurrentPosition</field>
                                                                                                                                                                                                                                <data>{"IDENTIFIER":"front_left_drive"}</data>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                                              <block type="variables_get" id="~{D3[`_=j612.GOH5N+0">
                                                                                                                                                                                                                                <field name="VAR" id="v_startRange">startFrontLeftTicks</field>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                    <value name="ADD1">
                                                                                                                                                                                                                      <block type="math_single" id="Ujt?}Kpp,T.kIdIkYrBL">
                                                                                                                                                                                                                        <field name="OP">ABS</field>
                                                                                                                                                                                                                        <value name="NUM">
                                                                                                                                                                                                                          <block type="math_arithmetic" id="10_cLW*=(!+H1Jc,[Flx">
                                                                                                                                                                                                                            <field name="OP">MINUS</field>
                                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                                              <block type="dcMotor_getProperty_Number" id="m$4u(k@Prgwg!R/97lu3">
                                                                                                                                                                                                                                <field name="IDENTIFIER">back_left_driveAsDcMotor</field>
                                                                                                                                                                                                                                <field name="PROP">CurrentPosition</field>
                                                                                                                                                                                                                                <data>{"IDENTIFIER":"back_left_drive"}</data>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                                              <block type="variables_get" id="^8)JHbsUQ6-l3+^TP1T7">
                                                                                                                                                                                                                                <field name="VAR" id="v_startBackLeftTicks">startBackLeftTicks</field>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                    <value name="ADD2">
                                                                                                                                                                                                                      <block type="math_single" id="*u9?0uwu0y{v.mzaZ:Mb">
                                                                                                                                                                                                                        <field name="OP">ABS</field>
                                                                                                                                                                                                                        <value name="NUM">
                                                                                                                                                                                                                          <block type="math_arithmetic" id="Ef(y*NX/o_|6#7-Cw!CZ">
                                                                                                                                                                                                                            <field name="OP">MINUS</field>
                                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                                              <block type="dcMotor_getProperty_Number" id="LXFwWKO=/pmc)Y~(qXhh">
                                                                                                                                                                                                                                <field name="IDENTIFIER">front_right_driveAsDcMotor</field>
                                                                                                                                                                                                                                <field name="PROP">CurrentPosition</field>
                                                                                                                                                                                                                                <data>{"IDENTIFIER":"front_right_drive"}</data>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                                              <block type="variables_get" id="~Y@!*PfIkHYm!ZP3#pFy">
                                                                                                                                                                                                                                <field name="VAR" id="v_startFrontRightTicks">startFrontRightTicks</field>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                    <value name="ADD3">
                                                                                                                                                                                                                      <block type="math_single" id="obesDH5ooP:|NOkP$#3b">
                                                                                                                                                                                                                        <field name="OP">ABS</field>
                                                                                                                                                                                                                        <value name="NUM">
                                                                                                                                                                                                                          <block type="math_arithmetic" id="ky(EcDq_Q2@D1Q]wQLb{">
                                                                                                                                                                                                                            <field name="OP">MINUS</field>
                                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                                              <block type="dcMotor_getProperty_Number" id="`??[h9n|rr=XdJjsu_F1">
                                                                                                                                                                                                                                <field name="IDENTIFIER">back_right_driveAsDcMotor</field>
                                                                                                                                                                                                                                <field name="PROP">CurrentPosition</field>
                                                                                                                                                                                                                                <data>{"IDENTIFIER":"back_right_drive"}</data>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                                              <block type="variables_get" id="|Y}PL|@6,-?Z3S:]Xt}T">
                                                                                                                                                                                                                                <field name="VAR" id="v_startBackRightTicks">startBackRightTicks</field>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                </value>
                                                                                                                                                                                                              </block>
                                                                                                                                                                                                            </value>
                                                                                                                                                                                                            <next>
                                                                                                                                                                                                              <block type="comment" id="student_blue_steer">
                                                                                                                                                                                                                <field name="COMMENT">DRIVE AND FIX THE ANGLE TOGETHER
When the blue ball is visible and no more than 25 degrees off center, the left command is 0.18 plus a clipped correction of 0.02 times tx. The right command subtracts the same correction. Recalculate EVERY loop so the ball stays centered as the robot drives forward.</field>
                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                  <block type="controls_if" id="blue_219">
                                                                                                                                                                                                                    <mutation else="1" />
                                                                                                                                                                                                                    <value name="IF0">
                                                                                                                                                                                                                      <block type="logic_operation" id="aAor`[aXE@ek]m;w/T#e">
                                                                                                                                                                                                                        <field name="OP">AND</field>
                                                                                                                                                                                                                        <value name="A">
                                                                                                                                                                                                                          <block type="logic_operation" id="blue_187">
                                                                                                                                                                                                                            <field name="OP">AND</field>
                                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                                              <block type="variables_get" id="blue_182">
                                                                                                                                                                                                                                <field name="VAR" id="v_seen">seen</field>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                                              <block type="logic_compare" id="blue_186">
                                                                                                                                                                                                                                <field name="OP">LTE</field>
                                                                                                                                                                                                                                <value name="A">
                                                                                                                                                                                                                                  <block type="math_single" id="blue_184">
                                                                                                                                                                                                                                    <field name="OP">ABS</field>
                                                                                                                                                                                                                                    <value name="NUM">
                                                                                                                                                                                                                                      <block type="variables_get" id="blue_183">
                                                                                                                                                                                                                                        <field name="VAR" id="v_tx">tx</field>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                <value name="B">
                                                                                                                                                                                                                                  <block type="math_number" id="blue_185">
                                                                                                                                                                                                                                    <field name="NUM">25</field>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                        <value name="B">
                                                                                                                                                                                                                          <block type="logic_compare" id="dkU=suWGk]B!#]rafHLo">
                                                                                                                                                                                                                            <field name="OP">GT</field>
                                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                                              <block type="variables_get" id="2hrkW24kIa(}a{[+3b?Q">
                                                                                                                                                                                                                                <field name="VAR" id="v_rangeInches">rangeInches</field>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                                              <block type="math_number" id="3mqh/x-AUx2xva%=KS=Y">
                                                                                                                                                                                                                                <field name="NUM">4.4</field>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                    <statement name="DO0">
                                                                                                                                                                                                                      <block type="variables_set" id="tWs-#R$gMU76PnYfDtZZ">
                                                                                                                                                                                                                        <field name="VAR" id="v_lossStartedAt">lossStartedAt</field>
                                                                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                                                                          <block type="math_number" id="#ofy|#T5MgwK5E0n:$Wv">
                                                                                                                                                                                                                            <field name="NUM">-1</field>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                        <next>
                                                                                                                                                                                                                          <block type="controls_if" id="blue_211">
                                                                                                                                                                                                                            <mutation else="1" />
                                                                                                                                                                                                                            <value name="IF0">
                                                                                                                                                                                                                              <block type="logic_compare" id="blue_190">
                                                                                                                                                                                                                                <field name="OP">GTE</field>
                                                                                                                                                                                                                                <value name="A">
                                                                                                                                                                                                                                  <block type="variables_get" id="xD2O=hm{p$424S@~KfOQ">
                                                                                                                                                                                                                                    <field name="VAR" id="v_encoderTicks">encoderTicks</field>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                <value name="B">
                                                                                                                                                                                                                                  <block type="variables_get" id="i=eR]?(_A25IFr22j}u[">
                                                                                                                                                                                                                                    <field name="VAR" id="v_goalRange">targetTicks</field>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                            <statement name="DO0">
                                                                                                                                                                                                                              <block type="variables_set" id="blue_192">
                                                                                                                                                                                                                                <field name="VAR" id="v_done">done</field>
                                                                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                                                                  <block type="logic_boolean" id="blue_191">
                                                                                                                                                                                                                                    <field name="BOOL">TRUE</field>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                                  <block type="variables_set" id="a1:QYV^KP?%g8)dJ$q?r">
                                                                                                                                                                                                                                    <field name="VAR" id="v_abortReason">abortReason</field>
                                                                                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                                                                                      <block type="text" id="4wm(-j8ZlVlsJT$|[NiL">
                                                                                                                                                                                                                                        <field name="TEXT">STOPPED: encoder safety limit before 3-inch camera gap</field>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                    <next>
                                                                                                                                                                                                                                      <block type="variables_set" id="blue_195">
                                                                                                                                                                                                                                        <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                                                                                          <block type="math_number" id="blue_193">
                                                                                                                                                                                                                                            <field name="NUM">0</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <next>
                                                                                                                                                                                                                                          <block type="variables_set" id="blue_196">
                                                                                                                                                                                                                                            <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                                                                                                                            <value name="VALUE">
                                                                                                                                                                                                                                              <block type="math_number" id="blue_194">
                                                                                                                                                                                                                                                <field name="NUM">0</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <next>
                                                                                                                                                                                                                                              <block type="procedures_callnoreturn" id="blue_197">
                                                                                                                                                                                                                                                <mutation name="applyPower" />
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </next>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </next>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </next>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </next>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </statement>
                                                                                                                                                                                                                            <statement name="ELSE">
                                                                                                                                                                                                                              <block type="variables_set" id="blue_208">
                                                                                                                                                                                                                                <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                                                                  <block type="math_arithmetic" id="blue_202">
                                                                                                                                                                                                                                    <field name="OP">ADD</field>
                                                                                                                                                                                                                                    <value name="A">
                                                                                                                                                                                                                                      <block type="math_number" id="blue_198">
                                                                                                                                                                                                                                        <field name="NUM">0.18</field>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                    <value name="B">
                                                                                                                                                                                                                                      <block type="math_constrain" id="blue_201">
                                                                                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                                                                                          <block type="math_arithmetic" id="tracking_gain_left">
                                                                                                                                                                                                                                            <field name="OP">MULTIPLY</field>
                                                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                                                              <block type="math_number" id="blue_199">
                                                                                                                                                                                                                                                <field name="NUM">0.02</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                                                              <block type="variables_get" id="blue_200">
                                                                                                                                                                                                                                                <field name="VAR" id="v_tx">tx</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <value name="LOW">
                                                                                                                                                                                                                                          <block type="math_number" id="tracking_low_left">
                                                                                                                                                                                                                                            <field name="NUM">-0.18</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <value name="HIGH">
                                                                                                                                                                                                                                          <block type="math_number" id="tracking_high_left">
                                                                                                                                                                                                                                            <field name="NUM">0.18</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                                  <block type="variables_set" id="blue_209">
                                                                                                                                                                                                                                    <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                                                                                      <block type="math_arithmetic" id="blue_207">
                                                                                                                                                                                                                                        <field name="OP">MINUS</field>
                                                                                                                                                                                                                                        <value name="A">
                                                                                                                                                                                                                                          <block type="math_number" id="blue_203">
                                                                                                                                                                                                                                            <field name="NUM">0.18</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <value name="B">
                                                                                                                                                                                                                                          <block type="math_constrain" id="blue_206">
                                                                                                                                                                                                                                            <value name="VALUE">
                                                                                                                                                                                                                                              <block type="math_arithmetic" id="tracking_gain_right">
                                                                                                                                                                                                                                                <field name="OP">MULTIPLY</field>
                                                                                                                                                                                                                                                <value name="A">
                                                                                                                                                                                                                                                  <block type="math_number" id="blue_204">
                                                                                                                                                                                                                                                    <field name="NUM">0.02</field>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                                <value name="B">
                                                                                                                                                                                                                                                  <block type="variables_get" id="blue_205">
                                                                                                                                                                                                                                                    <field name="VAR" id="v_tx">tx</field>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <value name="LOW">
                                                                                                                                                                                                                                              <block type="math_number" id="tracking_low_right">
                                                                                                                                                                                                                                                <field name="NUM">-0.18</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <value name="HIGH">
                                                                                                                                                                                                                                              <block type="math_number" id="tracking_high_right">
                                                                                                                                                                                                                                                <field name="NUM">0.18</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                    <next>
                                                                                                                                                                                                                                      <block type="procedures_callnoreturn" id="blue_210">
                                                                                                                                                                                                                                        <mutation name="applyPower" />
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </next>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </next>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </statement>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </next>
                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                    </statement>
                                                                                                                                                                                                                    <statement name="ELSE">
                                                                                                                                                                                                                      <block type="comment" id="student_blue_loss">
                                                                                                                                                                                                                        <field name="COMMENT">LOST BALL? POWER ZERO NOW
If the Limelight cannot confirm this ball, set BOTH power commands to zero immediately. A ball past the camera edge aborts. After 0.35 seconds without the ball, abandon the approach. Never keep driving blindly.</field>
                                                                                                                                                                                                                        <next>
                                                                                                                                                                                                                          <block type="variables_set" id="vo^5Pfo#ve,+%Rf5)RwH">
                                                                                                                                                                                                                            <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                                                                                                            <value name="VALUE">
                                                                                                                                                                                                                              <block type="math_number" id="[WA-A](7F5lORo~T7V:x">
                                                                                                                                                                                                                                <field name="NUM">0</field>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                            <next>
                                                                                                                                                                                                                              <block type="variables_set" id="IgBIBYDysC(XVBO@^k8.">
                                                                                                                                                                                                                                <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                                                                  <block type="math_number" id="=*{-V+MdiJZYt.K@/?Cq">
                                                                                                                                                                                                                                    <field name="NUM">0</field>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                                  <block type="procedures_callnoreturn" id="9ZZSc8hn:[w`#84[F*6c">
                                                                                                                                                                                                                                    <mutation name="applyPower" />
                                                                                                                                                                                                                                    <next>
                                                                                                                                                                                                                                      <block type="controls_if" id="5pgkRujBvR|bE1n-dYeM">
                                                                                                                                                                                                                                        <mutation else="1" />
                                                                                                                                                                                                                                        <value name="IF0">
                                                                                                                                                                                                                                          <block type="variables_get" id="R.q^iFeT3|c4@N9)8{u@">
                                                                                                                                                                                                                                            <field name="VAR" id="v_seen">seen</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <statement name="DO0">
                                                                                                                                                                                                                                          <block type="controls_if" id="Vv3x9W.s{#B#)~P_~ab`">
                                                                                                                                                                                                                                            <mutation else="1" />
                                                                                                                                                                                                                                            <value name="IF0">
                                                                                                                                                                                                                                              <block type="logic_compare" id="Ht].NXE]mm#J~6Fz:q+]">
                                                                                                                                                                                                                                                <field name="OP">LTE</field>
                                                                                                                                                                                                                                                <value name="A">
                                                                                                                                                                                                                                                  <block type="variables_get" id="*4bBR1hyi8P$ixrur/:y">
                                                                                                                                                                                                                                                    <field name="VAR" id="v_rangeInches">rangeInches</field>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                                <value name="B">
                                                                                                                                                                                                                                                  <block type="math_number" id="=TzW){cB;Z~wP-xQCIMI">
                                                                                                                                                                                                                                                    <field name="NUM">4.4</field>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <statement name="DO0">
                                                                                                                                                                                                                                              <block type="variables_set" id="+GR?xFJ9[Yt08,Zp8rE~">
                                                                                                                                                                                                                                                <field name="VAR" id="v_abortReason">abortReason</field>
                                                                                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                                                                                  <block type="text" id="5IMJ[/N8dh)@Gt?w)!(d">
                                                                                                                                                                                                                                                    <field name="TEXT">COMPLETE: estimated 3-inch gap from lens to ball surface</field>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                                                  <block type="variables_set" id="l|VGv(51VT7v#~Dz3x8?">
                                                                                                                                                                                                                                                    <field name="VAR" id="v_done">done</field>
                                                                                                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                                                                                                      <block type="logic_boolean" id="2qpe#J^1GZW:x~.1-f`X">
                                                                                                                                                                                                                                                        <field name="BOOL">TRUE</field>
                                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </next>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </statement>
                                                                                                                                                                                                                                            <statement name="ELSE">
                                                                                                                                                                                                                                              <block type="variables_set" id="2Ewy7PMgw,k(CGE4J]U?">
                                                                                                                                                                                                                                                <field name="VAR" id="v_abortReason">abortReason</field>
                                                                                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                                                                                  <block type="text" id="wd_!}(l@_BJyWo3qQYz}">
                                                                                                                                                                                                                                                    <field name="TEXT">STOPPED: blue ball at camera edge (over 25 degrees)</field>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                                                  <block type="variables_set" id="}|8,iel]*cag/6*ekQ~9">
                                                                                                                                                                                                                                                    <field name="VAR" id="v_abort">abort</field>
                                                                                                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                                                                                                      <block type="logic_boolean" id="3tdaIvwb%pXR)?/49,!t">
                                                                                                                                                                                                                                                        <field name="BOOL">TRUE</field>
                                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </next>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </statement>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </statement>
                                                                                                                                                                                                                                        <statement name="ELSE">
                                                                                                                                                                                                                                          <block type="controls_if" id="2uTaETas{/ImjP`*qWn!">
                                                                                                                                                                                                                                            <value name="IF0">
                                                                                                                                                                                                                                              <block type="logic_compare" id="Lz^EM]%4t4hbosDp34hE">
                                                                                                                                                                                                                                                <field name="OP">LT</field>
                                                                                                                                                                                                                                                <value name="A">
                                                                                                                                                                                                                                                  <block type="variables_get" id="M;6?Tg@A_;`f^_0-QDd:">
                                                                                                                                                                                                                                                    <field name="VAR" id="v_lossStartedAt">lossStartedAt</field>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                                <value name="B">
                                                                                                                                                                                                                                                  <block type="math_number" id="u5h;47!%$n8}=IEoLX@n">
                                                                                                                                                                                                                                                    <field name="NUM">0</field>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <statement name="DO0">
                                                                                                                                                                                                                                              <block type="variables_set" id="R{4-$.w4[qnN^pRtamOe">
                                                                                                                                                                                                                                                <field name="VAR" id="v_lossStartedAt">lossStartedAt</field>
                                                                                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                                                                                  <block type="linearOpMode_getRuntime" id="jeN]SS`s+{}6c_~Yc|#*" />
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </statement>
                                                                                                                                                                                                                                            <next>
                                                                                                                                                                                                                                              <block type="controls_if" id="}LxR[q#.nQk]E5XFcz,Q">
                                                                                                                                                                                                                                                <value name="IF0">
                                                                                                                                                                                                                                                  <block type="logic_compare" id="Y1M7Qy4%~iHdFg+q84AM">
                                                                                                                                                                                                                                                    <field name="OP">GTE</field>
                                                                                                                                                                                                                                                    <value name="A">
                                                                                                                                                                                                                                                      <block type="math_arithmetic" id="$B=dRyF6fENtCX*It=(%">
                                                                                                                                                                                                                                                        <field name="OP">MINUS</field>
                                                                                                                                                                                                                                                        <value name="A">
                                                                                                                                                                                                                                                          <block type="linearOpMode_getRuntime" id="j(uCHp=4=)MvQT?#tzYH" />
                                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                                        <value name="B">
                                                                                                                                                                                                                                                          <block type="variables_get" id="XFFJ[9-}CfjN[f4*(NB=">
                                                                                                                                                                                                                                                            <field name="VAR" id="v_lossStartedAt">lossStartedAt</field>
                                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                                    <value name="B">
                                                                                                                                                                                                                                                      <block type="math_number" id="u!59Vw,WonK}GtpEmwJ9">
                                                                                                                                                                                                                                                        <field name="NUM">0.35</field>
                                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                                <statement name="DO0">
                                                                                                                                                                                                                                                  <block type="variables_set" id="1nQ~/QUq04y(%0xqz,:C">
                                                                                                                                                                                                                                                    <field name="VAR" id="v_abortReason">abortReason</field>
                                                                                                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                                                                                                      <block type="text" id="1sbtyO%hgl30cOR.C-MI">
                                                                                                                                                                                                                                                        <field name="TEXT">STOPPED: blue target lost</field>
                                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                                    <next>
                                                                                                                                                                                                                                                      <block type="variables_set" id="_2q$w1~H1Hr[xM_jscv_">
                                                                                                                                                                                                                                                        <field name="VAR" id="v_abort">abort</field>
                                                                                                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                                                                                                          <block type="logic_boolean" id="zbC.yA#p8y1N}VkBn!JP">
                                                                                                                                                                                                                                                            <field name="BOOL">TRUE</field>
                                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                                    </next>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </statement>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </next>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </statement>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </next>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </next>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </next>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </next>
                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                    </statement>
                                                                                                                                                                                                                    <next>
                                                                                                                                                                                                                      <block type="comment" id="student_blue_encoder">
                                                                                                                                                                                                                        <field name="COMMENT">SAFETY LIMIT IS NOT SUCCESS
The wheel-encoder cap and a 16-second time limit can stop the robot BEFORE the camera thinks the ball is close. A stuck encoder also triggers a stop. Only a fresh target inside the estimated 4.4-inch lens-to-center range counts as reaching the goal.</field>
                                                                                                                                                                                                                        <next>
                                                                                                                                                                                                                          <block type="controls_if" id="]O6(!9]}`~xU;7`*B|uE">
                                                                                                                                                                                                                            <value name="IF0">
                                                                                                                                                                                                                              <block type="logic_operation" id="OODfxz_*Lc:Ad]*f52_W">
                                                                                                                                                                                                                                <field name="OP">AND</field>
                                                                                                                                                                                                                                <value name="A">
                                                                                                                                                                                                                                  <block type="logic_operation" id="SI+RU#o)aDn}0*!U/_iM">
                                                                                                                                                                                                                                    <field name="OP">AND</field>
                                                                                                                                                                                                                                    <value name="A">
                                                                                                                                                                                                                                      <block type="logic_operation" id="ball_no_encoder_check_after_done">
                                                                                                                                                                                                                                        <field name="OP">AND</field>
                                                                                                                                                                                                                                        <value name="A">
                                                                                                                                                                                                                                          <block type="variables_get" id="PqAX*fu}O[Y`UN5$~BjD">
                                                                                                                                                                                                                                            <field name="VAR" id="v_seen">seen</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <value name="B">
                                                                                                                                                                                                                                          <block type="logic_negate" id="ball_not_done_for_encoder_check">
                                                                                                                                                                                                                                            <value name="BOOL">
                                                                                                                                                                                                                                              <block type="variables_get" id="ball_done_for_encoder_check">
                                                                                                                                                                                                                                                <field name="VAR" id="v_done">done</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                    <value name="B">
                                                                                                                                                                                                                                      <block type="logic_negate" id=")ep7kmcouAftfv$K}R_S">
                                                                                                                                                                                                                                        <value name="BOOL">
                                                                                                                                                                                                                                          <block type="variables_get" id="@oA1i)r_q4Fb;B2C0q_R">
                                                                                                                                                                                                                                            <field name="VAR" id="v_abort">abort</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                <value name="B">
                                                                                                                                                                                                                                  <block type="logic_operation" id="6g/LOX}Jgh4GNC$hP5LH">
                                                                                                                                                                                                                                    <field name="OP">AND</field>
                                                                                                                                                                                                                                    <value name="A">
                                                                                                                                                                                                                                      <block type="logic_compare" id="^eM#:FE]LG1^5|zxx$Lx">
                                                                                                                                                                                                                                        <field name="OP">GTE</field>
                                                                                                                                                                                                                                        <value name="A">
                                                                                                                                                                                                                                          <block type="linearOpMode_getRuntime" id="v?shB/,@~4:t9,v%VI82" />
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <value name="B">
                                                                                                                                                                                                                                          <block type="math_number" id="XLMZu$SLkb|e7JU)2rxu">
                                                                                                                                                                                                                                            <field name="NUM">1</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                    <value name="B">
                                                                                                                                                                                                                                      <block type="logic_compare" id=")Q.52%11WmPp~=_oB=2m">
                                                                                                                                                                                                                                        <field name="OP">LT</field>
                                                                                                                                                                                                                                        <value name="A">
                                                                                                                                                                                                                                          <block type="variables_get" id="_H`cXgqVPV];G[H;piu)">
                                                                                                                                                                                                                                            <field name="VAR" id="v_encoderTicks">encoderTicks</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <value name="B">
                                                                                                                                                                                                                                          <block type="math_number" id="iHcv;ak7q)Jn[Xho+g`R">
                                                                                                                                                                                                                                            <field name="NUM">5</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                            <statement name="DO0">
                                                                                                                                                                                                                              <block type="variables_set" id="O]_;sODJ70v.JQKFgpo7">
                                                                                                                                                                                                                                <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                                                                  <block type="math_number" id="j[sBeY%zhGy%`v9QA0^K">
                                                                                                                                                                                                                                    <field name="NUM">0</field>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                                  <block type="variables_set" id="BE.ncgB?$*RqTOttsh+h">
                                                                                                                                                                                                                                    <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                                                                                      <block type="math_number" id="%x_o=~lmw2FWrqx@cbL*">
                                                                                                                                                                                                                                        <field name="NUM">0</field>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                    <next>
                                                                                                                                                                                                                                      <block type="procedures_callnoreturn" id="H#ppYm2s1WBNbGnR$V**">
                                                                                                                                                                                                                                        <mutation name="applyPower" />
                                                                                                                                                                                                                                        <next>
                                                                                                                                                                                                                                          <block type="variables_set" id="A8#h$}fnh[Jn.y}[*J$`">
                                                                                                                                                                                                                                            <field name="VAR" id="v_abort">abort</field>
                                                                                                                                                                                                                                            <value name="VALUE">
                                                                                                                                                                                                                                              <block type="logic_boolean" id="g`[[D|jdM+)V{/HY;R3D">
                                                                                                                                                                                                                                                <field name="BOOL">TRUE</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <next>
                                                                                                                                                                                                                                              <block type="variables_set" id="V`8]9IhN0s6x#H``TC,G">
                                                                                                                                                                                                                                                <field name="VAR" id="v_abortReason">abortReason</field>
                                                                                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                                                                                  <block type="text" id="oJvGVTE!M)ABAOv.zLc+">
                                                                                                                                                                                                                                                    <field name="TEXT">STOPPED: drive encoders not reporting movement</field>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </next>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </next>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </next>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </next>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </statement>
                                                                                                                                                                                                                            <next>
                                                                                                                                                                                                                              <block type="telemetry_addNumericData" id="^GScxD7p*(VMTumlgG}u">
                                                                                                                                                                                                                                <value name="KEY">
                                                                                                                                                                                                                                  <block type="text" id="Rthp+NL/yW_||Z*LNjX1">
                                                                                                                                                                                                                                    <field name="TEXT">Blue tx (deg)</field>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                <value name="NUMBER">
                                                                                                                                                                                                                                  <block type="variables_get" id="up8IuDpmJlX?AUL.o0@p">
                                                                                                                                                                                                                                    <field name="VAR" id="v_tx">tx</field>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                                  <block type="telemetry_addNumericData" id="JD{~/p)oog/O:k+f[l%Q">
                                                                                                                                                                                                                                    <value name="KEY">
                                                                                                                                                                                                                                      <block type="text" id="],j9w+[T:*[4Z;C_1M0:">
                                                                                                                                                                                                                                        <field name="TEXT">Lens-to-ball center (in)</field>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                    <value name="NUMBER">
                                                                                                                                                                                                                                      <block type="variables_get" id="9~jH$kPz(C/Q8jM1}SIj">
                                                                                                                                                                                                                                        <field name="VAR" id="v_rangeInches">rangeInches</field>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                    <next>
                                                                                                                                                                                                                                      <block type="telemetry_addNumericData" id="blue_236">
                                                                                                                                                                                                                                        <value name="KEY">
                                                                                                                                                                                                                                          <block type="text" id="blue_235">
                                                                                                                                                                                                                                            <field name="TEXT">Encoder travel (in)</field>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <value name="NUMBER">
                                                                                                                                                                                                                                          <block type="math_arithmetic" id="M~z*M$.5??L$b[ci_lF`">
                                                                                                                                                                                                                                            <field name="OP">DIVIDE</field>
                                                                                                                                                                                                                                            <value name="A">
                                                                                                                                                                                                                                              <block type="variables_get" id="im1wrkbd[VpGrtJ1RsRJ">
                                                                                                                                                                                                                                                <field name="VAR" id="v_encoderTicks">encoderTicks</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <value name="B">
                                                                                                                                                                                                                                              <block type="math_number" id="s9x^Ao:uxR!VhXqu)4sG">
                                                                                                                                                                                                                                                <field name="NUM">115</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </value>
                                                                                                                                                                                                                                        <next>
                                                                                                                                                                                                                                          <block type="telemetry_addNumericData" id="iSjtuv)P!`HlDl;qS*#$">
                                                                                                                                                                                                                                            <value name="KEY">
                                                                                                                                                                                                                                              <block type="text" id="^X5~U5@k.Ck9[E3y:WuV">
                                                                                                                                                                                                                                                <field name="TEXT">Wheel encoder ticks</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <value name="NUMBER">
                                                                                                                                                                                                                                              <block type="variables_get" id="L5fOkJ4nTE2PpvJq`iku">
                                                                                                                                                                                                                                                <field name="VAR" id="v_encoderTicks">encoderTicks</field>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </value>
                                                                                                                                                                                                                                            <next>
                                                                                                                                                                                                                                              <block type="telemetry_update" id="blue_237">
                                                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                                                  <block type="linearOpMode_sleep" id="blue_239">
                                                                                                                                                                                                                                                    <value name="MILLISECONDS">
                                                                                                                                                                                                                                                      <block type="math_number" id="blue_238">
                                                                                                                                                                                                                                                        <field name="NUM">25</field>
                                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                                </next>
                                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                                            </next>
                                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                                        </next>
                                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                                    </next>
                                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                                </next>
                                                                                                                                                                                                                              </block>
                                                                                                                                                                                                                            </next>
                                                                                                                                                                                                                          </block>
                                                                                                                                                                                                                        </next>
                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                    </next>
                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                </next>
                                                                                                                                                                                                              </block>
                                                                                                                                                                                                            </next>
                                                                                                                                                                                                          </block>
                                                                                                                                                                                                        </next>
                                                                                                                                                                                                      </block>
                                                                                                                                                                                                    </next>
                                                                                                                                                                                                  </block>
                                                                                                                                                                                                </statement>
                                                                                                                                                                                                <next>
                                                                                                                                                                                                  <block type="variables_set" id="blue_254">
                                                                                                                                                                                                    <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                                                      <block type="math_number" id="blue_252">
                                                                                                                                                                                                        <field name="NUM">0</field>
                                                                                                                                                                                                      </block>
                                                                                                                                                                                                    </value>
                                                                                                                                                                                                    <next>
                                                                                                                                                                                                      <block type="variables_set" id="blue_255">
                                                                                                                                                                                                        <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                                                          <block type="math_number" id="blue_253">
                                                                                                                                                                                                            <field name="NUM">0</field>
                                                                                                                                                                                                          </block>
                                                                                                                                                                                                        </value>
                                                                                                                                                                                                        <next>
                                                                                                                                                                                                          <block type="procedures_callnoreturn" id="blue_256">
                                                                                                                                                                                                            <mutation name="applyPower" />
                                                                                                                                                                                                            <next>
                                                                                                                                                                                                              <block type="telemetry_addTextData" id="F:zyFD+4iFa]:C,w%DW5">
                                                                                                                                                                                                                <value name="KEY">
                                                                                                                                                                                                                  <block type="text" id="*n]H@N[=li^Q`y)lH=Dv">
                                                                                                                                                                                                                    <field name="TEXT">Status</field>
                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                <value name="TEXT">
                                                                                                                                                                                                                  <block type="variables_get" id="jdeC[@4CQ/g8Of[Lm*U5">
                                                                                                                                                                                                                    <field name="VAR" id="v_abortReason">abortReason</field>
                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                </value>
                                                                                                                                                                                                                <next>
                                                                                                                                                                                                                  <block type="dbgLog_msg" id="pf@$?=.*u}GKNyBWx9S;">
                                                                                                                                                                                                                    <value name="MESSAGE">
                                                                                                                                                                                                                      <block type="variables_get" id="7i5Qcnr{3c$gJz+H^=c/">
                                                                                                                                                                                                                        <field name="VAR" id="v_abortReason">abortReason</field>
                                                                                                                                                                                                                      </block>
                                                                                                                                                                                                                    </value>
                                                                                                                                                                                                                  </block>
                                                                                                                                                                                                                </next>
                                                                                                                                                                                                              </block>
                                                                                                                                                                                                            </next>
                                                                                                                                                                                                          </block>
                                                                                                                                                                                                        </next>
                                                                                                                                                                                                      </block>
                                                                                                                                                                                                    </next>
                                                                                                                                                                                                  </block>
                                                                                                                                                                                                </next>
                                                                                                                                                                                              </block>
                                                                                                                                                                                            </next>
                                                                                                                                                                                          </block>
                                                                                                                                                                                        </next>
                                                                                                                                                                                      </block>
                                                                                                                                                                                    </next>
                                                                                                                                                                                  </block>
                                                                                                                                                                                </next>
                                                                                                                                                                              </block>
                                                                                                                                                                            </next>
                                                                                                                                                                          </block>
                                                                                                                                                                        </next>
                                                                                                                                                                      </block>
                                                                                                                                                                    </next>
                                                                                                                                                                  </block>
                                                                                                                                                                </next>
                                                                                                                                                              </block>
                                                                                                                                                            </next>
                                                                                                                                                          </block>
                                                                                                                                                        </next>
                                                                                                                                                      </block>
                                                                                                                                                    </next>
                                                                                                                                                  </block>
                                                                                                                                                </next>
                                                                                                                                              </block>
                                                                                                                                            </next>
                                                                                                                                          </block>
                                                                                                                                        </statement>
                                                                                                                                        <statement name="ELSE">
                                                                                                                                          <block type="telemetry_addTextData" id="blue_278">
                                                                                                                                            <value name="KEY">
                                                                                                                                              <block type="text" id="blue_276">
                                                                                                                                                <field name="TEXT">Status</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                            <value name="TEXT">
                                                                                                                                              <block type="text" id="blue_277">
                                                                                                                                                <field name="TEXT">STOPPED: no blue target, not centered, or already inside 3-inch gap</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                          </block>
                                                                                                                                        </statement>
                                                                                                                                        <next>
                                                                                                                                          <block type="variables_set" id="blue_293">
                                                                                                                                            <field name="VAR" id="v_leftPower">leftPower</field>
                                                                                                                                            <value name="VALUE">
                                                                                                                                              <block type="math_number" id="blue_291">
                                                                                                                                                <field name="NUM">0</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                            <next>
                                                                                                                                              <block type="variables_set" id="blue_294">
                                                                                                                                                <field name="VAR" id="v_rightPower">rightPower</field>
                                                                                                                                                <value name="VALUE">
                                                                                                                                                  <block type="math_number" id="blue_292">
                                                                                                                                                    <field name="NUM">0</field>
                                                                                                                                                  </block>
                                                                                                                                                </value>
                                                                                                                                                <next>
                                                                                                                                                  <block type="procedures_callnoreturn" id="blue_295">
                                                                                                                                                    <mutation name="applyPower" />
                                                                                                                                                    <next>
                                                                                                                                                      <block type="limelight3A_stop" id="blue_296">
                                                                                                                                                        <field name="IDENTIFIER">limelightAsLimelight3A</field>
                                                                                                                                                        <data>{"IDENTIFIER":"limelight"}</data>
                                                                                                                                                        <next>
                                                                                                                                                          <block type="telemetry_update" id="blue_297">
                                                                                                                                                            <next>
                                                                                                                                                              <block type="linearOpMode_sleep" id="E04GYYe4|x-P:fyMaGE!">
                                                                                                                                                                <value name="MILLISECONDS">
                                                                                                                                                                  <block type="math_number" id="dy3KHgjV9zX71$-=.8Oh">
                                                                                                                                                                    <field name="NUM">2000</field>
                                                                                                                                                                  </block>
                                                                                                                                                                </value>
                                                                                                                                                              </block>
                                                                                                                                                            </next>
                                                                                                                                                          </block>
                                                                                                                                                        </next>
                                                                                                                                                      </block>
                                                                                                                                                    </next>
                                                                                                                                                  </block>
                                                                                                                                                </next>
                                                                                                                                              </block>
                                                                                                                                            </next>
                                                                                                                                          </block>
                                                                                                                                        </next>
                                                                                                                                      </block>
                                                                                                                                    </next>
                                                                                                                                  </block>
                                                                                                                                </next>
                                                                                                                              </block>
                                                                                                                            </next>
                                                                                                                          </block>
                                                                                                                        </next>
                                                                                                                      </block>
                                                                                                                    </next>
                                                                                                                  </block>
                                                                                                                </next>
                                                                                                              </block>
                                                                                                            </next>
                                                                                                          </block>
                                                                                                        </next>
                                                                                                      </block>
                                                                                                    </next>
                                                                                                  </block>
                                                                                                </next>
                                                                                              </block>
                                                                                            </next>
                                                                                          </block>
                                                                                        </next>
                                                                                      </block>
                                                                                    </next>
                                                                                  </block>
                                                                                </next>
                                                                              </block>
                                                                            </next>
                                                                          </block>
                                                                        </next>
                                                                      </block>
                                                                    </next>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </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="blue_78" x="25" y="5600">
    <field name="NAME">readBlue</field>
    <comment pinned="true" h="110" w="470">FRESH BLUE CONTOUR ONLY
Accept a current result from color pipeline 0. Ignore the whole-image Ta for distance. One measured distance established the area-to-distance scale, not close-range accuracy.</comment>
    <data>{"commentPositionLeft":-500,"commentPositionTop":-27}</data>
    <statement name="STACK">
      <block type="comment" id="student_blue_fresh">
        <field name="COMMENT">CHECK THE CAMERA FEED FIRST
A result must be valid, from the blue pipeline 0, and under 250 milliseconds old. A stale frame is like an old photograph: it cannot safely guide a moving robot.</field>
        <next>
          <block type="variables_set" id="blue_71">
            <field name="VAR" id="v_seen">seen</field>
            <value name="VALUE">
              <block type="logic_boolean" id="blue_70">
                <field name="BOOL">FALSE</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="blue_73">
                <field name="VAR" id="v_result">result</field>
                <value name="VALUE">
                  <block type="limelight3A_getLatestResult" id="blue_72">
                    <field name="IDENTIFIER">limelightAsLimelight3A</field>
                    <data>{"IDENTIFIER":"limelight"}</data>
                  </block>
                </value>
                <next>
                  <block type="controls_if" id="blue_77">
                    <value name="IF0">
                      <block type="misc_isNotNull" id="blue_75">
                        <value name="VALUE">
                          <block type="variables_get" id="blue_74">
                            <field name="VAR" id="v_result">result</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <statement name="DO0">
                      <block type="telemetry_addNumericData" id="?UPrWSHyyeO*V.{i_z`O">
                        <value name="KEY">
                          <block type="text" id="l@}(Ri;JhoA-:i3:OpN#">
                            <field name="TEXT">Camera age (ms)</field>
                          </block>
                        </value>
                        <value name="NUMBER">
                          <block type="llResult_getProperty_Number" id="FR1yl5#))3Id*$A14P`.">
                            <field name="PROP">Staleness</field>
                            <value name="LL_RESULT">
                              <block type="variables_get" id="^VeZ0%Xf|^Tm1.qwcj^Q">
                                <field name="VAR" id="v_result">result</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <next>
                          <block type="telemetry_addNumericData" id="~(R15KZTjgpeJ7~g_%(G">
                            <value name="KEY">
                              <block type="text" id="/kx(twC][*^a}9`M-`mT">
                                <field name="TEXT">Global Ta (%) - not range</field>
                              </block>
                            </value>
                            <value name="NUMBER">
                              <block type="llResult_getProperty_Number" id="[e~JPhlzw3}VYW7pItS_">
                                <field name="PROP">Ta</field>
                                <value name="LL_RESULT">
                                  <block type="variables_get" id="2dT@jD}0b{e4Of~SgREv">
                                    <field name="VAR" id="v_result">result</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="telemetry_addNumericData" id="^L3iKTvu7~oOXeu]k9T2">
                                <value name="KEY">
                                  <block type="text" id="W8l,/5wBEbz,E@l$Ba!F">
                                    <field name="TEXT">Color contours</field>
                                  </block>
                                </value>
                                <value name="NUMBER">
                                  <block type="lists_length" id="|%xy,*R:J$9D}uOr1@2{">
                                    <value name="VALUE">
                                      <block type="llResult_getProperty_Array" id="((!g44*1+5tGrZ#*}3c7">
                                        <field name="PROP">ColorResults</field>
                                        <value name="LL_RESULT">
                                          <block type="variables_get" id="QOk-40e1{oy-TAHD=.X;">
                                            <field name="VAR" id="v_result">result</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <next>
                                  <block type="comment" id="student_blue_contour">
                                    <field name="COMMENT">PICK A BALL-SIZED BLUE CONTOUR
Look through blue color results. Choose a contour within the camera's ball-height band (Y pixels 215 to 260) and allowed area range, not the entire blue floor. tx is the angle left or right; area estimates distance using 2.84 divided by the square root of area fraction. This estimate needs more real-world calibration.</field>
                                    <next>
                                      <block type="controls_if" id="blue_76">
                                        <value name="IF0">
                                          <block type="logic_operation" id="blue_51">
                                            <field name="OP">AND</field>
                                            <value name="A">
                                              <block type="logic_operation" id="blue_41">
                                                <field name="OP">AND</field>
                                                <value name="A">
                                                  <block type="logic_compare" id="fixed_valid_compare">
                                                    <field name="OP">EQ</field>
                                                    <value name="A">
                                                      <block type="text_join" id="fixed_valid_as_text">
                                                        <mutation items="2" />
                                                        <value name="ADD0">
                                                          <block type="text" id="fixed_empty_text">
                                                            <field name="TEXT" />
                                                          </block>
                                                        </value>
                                                        <value name="ADD1">
                                                          <block type="llResult_getProperty_Boolean" id="blue_36">
                                                            <field name="PROP">IsValid</field>
                                                            <value name="LL_RESULT">
                                                              <block type="variables_get" id="blue_35">
                                                                <field name="VAR" id="v_result">result</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <block type="text" id="fixed_true_text">
                                                        <field name="TEXT">true</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <block type="logic_compare" id="blue_40">
                                                    <field name="OP">LT</field>
                                                    <value name="A">
                                                      <block type="llResult_getProperty_Number" id="blue_38">
                                                        <field name="PROP">Staleness</field>
                                                        <value name="LL_RESULT">
                                                          <block type="variables_get" id="blue_37">
                                                            <field name="VAR" id="v_result">result</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <block type="math_number" id="blue_39">
                                                        <field name="NUM">250</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <block type="logic_operation" id="blue_50">
                                                <field name="OP">AND</field>
                                                <value name="A">
                                                  <block type="logic_compare" id="blue_45">
                                                    <field name="OP">EQ</field>
                                                    <value name="A">
                                                      <block type="llResult_getProperty_Number" id="blue_43">
                                                        <field name="PROP">PipelineIndex</field>
                                                        <value name="LL_RESULT">
                                                          <block type="variables_get" id="blue_42">
                                                            <field name="VAR" id="v_result">result</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <block type="math_number" id="blue_44">
                                                        <field name="NUM">0</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <block type="logic_compare" id="g1Ga`x2NgLl4@h{CM:_x">
                                                    <field name="OP">GT</field>
                                                    <value name="A">
                                                      <block type="lists_length" id="hEzJ{$2f`37ZKlr,HR*g">
                                                        <value name="VALUE">
                                                          <block type="llResult_getProperty_Array" id="b~zys)].jFL!%]!)=^/7">
                                                            <field name="PROP">ColorResults</field>
                                                            <value name="LL_RESULT">
                                                              <block type="variables_get" id="JdKKI%_f6)Xr$minzxY5">
                                                                <field name="VAR" id="v_result">result</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <block type="math_number" id="r9~yYF[i6LsOK4%0rc_;">
                                                        <field name="NUM">0</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <statement name="DO0">
                                          <block type="variables_set" id="ball_reset_area">
                                            <field name="VAR" id="v_area">area</field>
                                            <value name="VALUE">
                                              <block type="math_number" id="ball_zero_area">
                                                <field name="NUM">0</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="controls_forEach" id="ball_scan_contours">
                                                <field name="VAR" id="v_colorCandidate">colorCandidate</field>
                                                <value name="LIST">
                                                  <block type="llResult_getProperty_Array" id="ball_scan_results">
                                                    <field name="PROP">ColorResults</field>
                                                    <value name="LL_RESULT">
                                                      <block type="variables_get" id="ball_scan_result_var">
                                                        <field name="VAR" id="v_result">result</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <statement name="DO">
                                                  <block type="controls_if" id="ball_candidate_if">
                                                    <value name="IF0">
                                                      <block type="logic_operation" id="ball_candidate_and_1">
                                                        <field name="OP">AND</field>
                                                        <value name="A">
                                                          <block type="logic_compare" id="ball_area_better">
                                                            <field name="OP">GT</field>
                                                            <value name="A">
                                                              <block type="llResultTypesColorResult_getProperty_Number" id="ball_candidate_area_better">
                                                                <field name="PROP">TargetArea</field>
                                                                <value name="COLOR_RESULT">
                                                                  <block type="variables_get" id="ball_candidate_var_better">
                                                                    <field name="VAR" id="v_colorCandidate">colorCandidate</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <block type="variables_get" id="ball_best_area">
                                                                <field name="VAR" id="v_area">area</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <value name="B">
                                                          <block type="logic_operation" id="ball_candidate_and_2">
                                                            <field name="OP">AND</field>
                                                            <value name="A">
                                                              <block type="logic_compare" id="ball_area_limit">
                                                                <field name="OP">LTE</field>
                                                                <value name="A">
                                                                  <block type="llResultTypesColorResult_getProperty_Number" id="ball_candidate_area_limit">
                                                                    <field name="PROP">TargetArea</field>
                                                                    <value name="COLOR_RESULT">
                                                                      <block type="variables_get" id="ball_candidate_var_limit">
                                                                        <field name="VAR" id="v_colorCandidate">colorCandidate</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <block type="math_number" id="ball_max_area">
                                                                    <field name="NUM">0.75</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <block type="logic_operation" id="ball_candidate_and_3">
                                                                <field name="OP">AND</field>
                                                                <value name="A">
                                                                  <block type="logic_compare" id="ball_y_minimum">
                                                                    <field name="OP">GTE</field>
                                                                    <value name="A">
                                                                      <block type="llResultTypesColorResult_getProperty_Number" id="ball_candidate_y_min">
                                                                        <field name="PROP">TargetYPixels</field>
                                                                        <value name="COLOR_RESULT">
                                                                          <block type="variables_get" id="ball_candidate_var_y_min">
                                                                            <field name="VAR" id="v_colorCandidate">colorCandidate</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                    <value name="B">
                                                                      <block type="math_number" id="ball_min_y">
                                                                        <field name="NUM">215</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <block type="logic_compare" id="ball_y_maximum">
                                                                    <field name="OP">LTE</field>
                                                                    <value name="A">
                                                                      <block type="llResultTypesColorResult_getProperty_Number" id="ball_candidate_y_max">
                                                                        <field name="PROP">TargetYPixels</field>
                                                                        <value name="COLOR_RESULT">
                                                                          <block type="variables_get" id="ball_candidate_var_y_max">
                                                                            <field name="VAR" id="v_colorCandidate">colorCandidate</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                    <value name="B">
                                                                      <block type="math_number" id="ball_max_y">
                                                                        <field name="NUM">260</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <statement name="DO0">
                                                      <block type="variables_set" id="ball_assign_area">
                                                        <field name="VAR" id="v_area">area</field>
                                                        <value name="VALUE">
                                                          <block type="llResultTypesColorResult_getProperty_Number" id="ball_candidate_area_assign">
                                                            <field name="PROP">TargetArea</field>
                                                            <value name="COLOR_RESULT">
                                                              <block type="variables_get" id="ball_candidate_var_assign_area">
                                                                <field name="VAR" id="v_colorCandidate">colorCandidate</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="ball_assign_tx">
                                                            <field name="VAR" id="v_tx">tx</field>
                                                            <value name="VALUE">
                                                              <block type="llResultTypesColorResult_getProperty_Number" id="ball_candidate_tx_assign">
                                                                <field name="PROP">TargetXDegrees</field>
                                                                <value name="COLOR_RESULT">
                                                                  <block type="variables_get" id="ball_candidate_var_assign_tx">
                                                                    <field name="VAR" id="v_colorCandidate">colorCandidate</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </statement>
                                                  </block>
                                                </statement>
                                                <next>
                                                  <block type="controls_if" id="blue_69">
                                                    <value name="IF0">
                                                      <block type="logic_compare" id="blue_55">
                                                        <field name="OP">GTE</field>
                                                        <value name="A">
                                                          <block type="variables_get" id="ball_selected_area">
                                                            <field name="VAR" id="v_area">area</field>
                                                          </block>
                                                        </value>
                                                        <value name="B">
                                                          <block type="math_number" id="blue_54">
                                                            <field name="NUM">0.001</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <statement name="DO0">
                                                      <block type="variables_set" id="blue_57">
                                                        <field name="VAR" id="v_seen">seen</field>
                                                        <value name="VALUE">
                                                          <block type="logic_boolean" id="blue_56">
                                                            <field name="BOOL">TRUE</field>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="blue_68">
                                                            <field name="VAR" id="v_rangeInches">rangeInches</field>
                                                            <value name="VALUE">
                                                              <block type="math_arithmetic" id="blue_67">
                                                                <field name="OP">DIVIDE</field>
                                                                <value name="A">
                                                                  <block type="math_number" id="blue_64">
                                                                    <field name="NUM">2.84</field>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <block type="math_single" id="blue_66">
                                                                    <field name="OP">ROOT</field>
                                                                    <value name="NUM">
                                                                      <block type="variables_get" id="blue_65">
                                                                        <field name="VAR" id="v_area">area</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="comment" id="student_blue_lock">
                                                                <field name="COMMENT">STAY WITH THE SAME BALL
Once following a ball, reject a sudden jump in angle or contour size. A different blue patch should not steal the steering lock. If the match fails, seen becomes false and the drive stops immediately.</field>
                                                                <next>
                                                                  <block type="controls_if" id="tracking_reject_jump">
                                                                    <value name="IF0">
                                                                      <block type="logic_operation" id="tracking_reject_and">
                                                                        <field name="OP">AND</field>
                                                                        <value name="A">
                                                                          <block type="variables_get" id="tracking_active">
                                                                            <field name="VAR" id="v_tracking">tracking</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="B">
                                                                          <block type="logic_operation" id="tracking_reject_or">
                                                                            <field name="OP">OR</field>
                                                                            <value name="A">
                                                                              <block type="logic_compare" id="tracking_angle_jump">
                                                                                <field name="OP">GT</field>
                                                                                <value name="A">
                                                                                  <block type="math_single" id="tracking_angle_abs">
                                                                                    <field name="OP">ABS</field>
                                                                                    <value name="NUM">
                                                                                      <block type="math_arithmetic" id="tracking_angle_diff">
                                                                                        <field name="OP">MINUS</field>
                                                                                        <value name="A">
                                                                                          <block type="variables_get" id="tracking_current_tx">
                                                                                            <field name="VAR" id="v_tx">tx</field>
                                                                                          </block>
                                                                                        </value>
                                                                                        <value name="B">
                                                                                          <block type="variables_get" id="tracking_previous_tx">
                                                                                            <field name="VAR" id="v_lastTx">lastTx</field>
                                                                                          </block>
                                                                                        </value>
                                                                                      </block>
                                                                                    </value>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="B">
                                                                                  <block type="math_number" id="tracking_max_angle">
                                                                                    <field name="NUM">12</field>
                                                                                  </block>
                                                                                </value>
                                                                              </block>
                                                                            </value>
                                                                            <value name="B">
                                                                              <block type="logic_operation" id="tracking_area_outside">
                                                                                <field name="OP">OR</field>
                                                                                <value name="A">
                                                                                  <block type="logic_compare" id="tracking_area_too_small">
                                                                                    <field name="OP">LT</field>
                                                                                    <value name="A">
                                                                                      <block type="variables_get" id="tracking_current_area_low">
                                                                                        <field name="VAR" id="v_area">area</field>
                                                                                      </block>
                                                                                    </value>
                                                                                    <value name="B">
                                                                                      <block type="math_arithmetic" id="tracking_area_minimum">
                                                                                        <field name="OP">MULTIPLY</field>
                                                                                        <value name="A">
                                                                                          <block type="variables_get" id="tracking_previous_area_low">
                                                                                            <field name="VAR" id="v_lastArea">lastArea</field>
                                                                                          </block>
                                                                                        </value>
                                                                                        <value name="B">
                                                                                          <block type="math_number" id="tracking_min_ratio">
                                                                                            <field name="NUM">0.4</field>
                                                                                          </block>
                                                                                        </value>
                                                                                      </block>
                                                                                    </value>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="B">
                                                                                  <block type="logic_compare" id="tracking_area_too_large">
                                                                                    <field name="OP">GT</field>
                                                                                    <value name="A">
                                                                                      <block type="variables_get" id="tracking_current_area_high">
                                                                                        <field name="VAR" id="v_area">area</field>
                                                                                      </block>
                                                                                    </value>
                                                                                    <value name="B">
                                                                                      <block type="math_arithmetic" id="tracking_area_maximum">
                                                                                        <field name="OP">MULTIPLY</field>
                                                                                        <value name="A">
                                                                                          <block type="variables_get" id="tracking_previous_area_high">
                                                                                            <field name="VAR" id="v_lastArea">lastArea</field>
                                                                                          </block>
                                                                                        </value>
                                                                                        <value name="B">
                                                                                          <block type="math_number" id="tracking_max_ratio">
                                                                                            <field name="NUM">2.5</field>
                                                                                          </block>
                                                                                        </value>
                                                                                      </block>
                                                                                    </value>
                                                                                  </block>
                                                                                </value>
                                                                              </block>
                                                                            </value>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                    <statement name="DO0">
                                                                      <block type="variables_set" id="tracking_rejected">
                                                                        <field name="VAR" id="v_seen">seen</field>
                                                                        <value name="VALUE">
                                                                          <block type="logic_boolean" id="tracking_false">
                                                                            <field name="BOOL">FALSE</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </statement>
                                                                    <next>
                                                                      <block type="controls_if" id="tracking_update_if_seen">
                                                                        <value name="IF0">
                                                                          <block type="variables_get" id="tracking_seen">
                                                                            <field name="VAR" id="v_seen">seen</field>
                                                                          </block>
                                                                        </value>
                                                                        <statement name="DO0">
                                                                          <block type="variables_set" id="tracking_remember_tx">
                                                                            <field name="VAR" id="v_lastTx">lastTx</field>
                                                                            <value name="VALUE">
                                                                              <block type="variables_get" id="tracking_save_tx">
                                                                                <field name="VAR" id="v_tx">tx</field>
                                                                              </block>
                                                                            </value>
                                                                            <next>
                                                                              <block type="variables_set" id="tracking_remember_area">
                                                                                <field name="VAR" id="v_lastArea">lastArea</field>
                                                                                <value name="VALUE">
                                                                                  <block type="variables_get" id="tracking_save_area">
                                                                                    <field name="VAR" id="v_area">area</field>
                                                                                  </block>
                                                                                </value>
                                                                              </block>
                                                                            </next>
                                                                          </block>
                                                                        </statement>
                                                                      </block>
                                                                    </next>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </statement>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>
  </block>
  <block type="procedures_defnoreturn" id="blue_87" x="25" y="7050">
    <field name="NAME">applyPower</field>
    <comment pinned="false" h="80" w="160">FOUR MOTOR OUTPUTS
The full robot program checks wall sensors before these four motor writes. This teaching excerpt intentionally leaves out those checks and must not be run.</comment>
    <statement name="STACK">
      <block type="comment" id="student_blue_wheels">
        <field name="COMMENT">LEFT AND RIGHT COMMANDS REACH THE WHEELS
These four blocks send leftPower to both left motors and rightPower to both right motors. That is how a difference in power steers while moving forward. The FULL deployed mode also checks the three wall sensors here; this disabled lesson is not a substitute for the guarded robot code.</field>
        <next>
          <block type="dcMotor_setProperty_Number" id="blue_80">
            <field name="IDENTIFIER">front_left_driveAsDcMotor</field>
            <field name="PROP">Power</field>
            <data>{"IDENTIFIER":"front_left_drive"}</data>
            <value name="VALUE">
              <block type="variables_get" id="blue_79">
                <field name="VAR" id="v_leftPower">leftPower</field>
              </block>
            </value>
            <next>
              <block type="dcMotor_setProperty_Number" id="blue_82">
                <field name="IDENTIFIER">back_left_driveAsDcMotor</field>
                <field name="PROP">Power</field>
                <data>{"IDENTIFIER":"back_left_drive"}</data>
                <value name="VALUE">
                  <block type="variables_get" id="blue_81">
                    <field name="VAR" id="v_leftPower">leftPower</field>
                  </block>
                </value>
                <next>
                  <block type="dcMotor_setProperty_Number" id="blue_84">
                    <field name="IDENTIFIER">front_right_driveAsDcMotor</field>
                    <field name="PROP">Power</field>
                    <data>{"IDENTIFIER":"front_right_drive"}</data>
                    <value name="VALUE">
                      <block type="variables_get" id="blue_83">
                        <field name="VAR" id="v_rightPower">rightPower</field>
                      </block>
                    </value>
                    <next>
                      <block type="dcMotor_setProperty_Number" id="blue_86">
                        <field name="IDENTIFIER">back_right_driveAsDcMotor</field>
                        <field name="PROP">Power</field>
                        <data>{"IDENTIFIER":"back_right_drive"}</data>
                        <value name="VALUE">
                          <block type="variables_get" id="blue_85">
                            <field name="VAR" id="v_rightPower">rightPower</field>
                          </block>
                        </value>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>
  </block>
</xml>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Extra><OpModeMeta flavor="AUTONOMOUS" group="Study (disabled)" /><Enabled value="false" /></Extra>
