TeleOp + Vision // Student lesson

Tele-Learn-AprilTagAlignment

AprilTag Alignment

Use Tele-Learn-AprilTagAlignment to reconstruct red or blue centers from real AprilTag Blocks and trace the held Square override of manual mecanum drive. Learn identifies an educational example, not permission to run it. The source lacks a validated vision-freshness gate and wall protection; keep this a supervised code study until independently reviewed.

Latest-result retrieval is not an age or distinct-frame check. Read the literal X/Y/Z projections, the mounting-specific back-right direction, and the stronger front-right turn command. The sample selects a nearer center again each loop rather than locking an alliance while Square is held.

Start with a question

If the camera sees a tag left of the target's middle, why is pointing at that tag not the same as pointing at the calculated center?

By the end, you can…

  • Reconstruct hidden endpoints using signed offsets, degree trig, and camera-space meters.
  • Require matching half-groups before choosing a complete red or blue center.
  • Trace manual normalization and the priority of held Square alignment.
  • Identify missing freshness guarantees and distinguish a sticker range from an alliance-center range.

Before running: Ask your supervisor first. Keep Driver Station STOP ready.

Read · predict · explain

Build the idea, one block at a time

Read these steps before exploring the full program. The numbered blue comments in the diagram link back to the matching step.

01Erase visibility before each scan

Actual Blocks for this section
Blocks for Erase visibility before each scan
Blocks to notice
  • set found false
  • set r4Seen / r5Seen / b4Seen / b5Seen false
  • set tag distances to not visible

scanTags clears found, the four endpoint flags, and the displayed tag distances before inspecting a result. Red-center display becomes not available. TeleOp also clears the four sticker-distance displays. Old coordinates can remain in variables, but cleared flags prevent a missing half from completing a center. Resetting state is not the same as proving the camera returned a new frame.

For example: A scan with R4 and R5 can set found true. A later scan containing only R4 leaves r5Seen false and cannot rebuild the red center.

Think first

May yesterday's r5 coordinates complete today's red center when r5Seen is false?

Show Answer

No. Both endpoint flags must be true in this scan; stored numbers alone are insufficient.

02Read a result, then its fiducial list

Actual Blocks for this section
Blocks for Read a result, then its fiducial list
Blocks to notice
  • getLatestResult
  • is not null
  • FiducialResults
  • set list

The non-null branch reads the result's list of fiducials, meaning recognized markers. A non-null result can still contain an empty list. These AprilTag sources do not check IsValid, Staleness, pipeline index, or a distinct frame timestamp here. Calling getLatestResult does not itself guarantee a fresh image, so this sample is not a validated freshness guard.

For example: An empty current list builds no center. Repeated retrieval of an old nonempty result could repeat the same geometry even though all flags were reset.

Think first

Does the non-null test prove that the image is less than 250 ms old?

Show Answer

No. There is no age comparison in this scan; null handling and freshness are separate checks.

03Repeat camera-space geometry for each tag

Actual Blocks for this section
Blocks for Repeat camera-space geometry for each tag
Blocks to notice
  • for each tag in list
  • TargetPoseCameraSpace
  • set pose

For each fiducial, the source retrieves its TargetPoseCameraSpace: position plus orientation relative to the camera, not a robot field pose. The instructional convention calls x left/right, y up/down, and z forward/back; yaw and pitch describe rotation, not wireless transmit/receive. Later projection formulas must be read literally and checked against the SDK pose convention before any physical use.

For example: Two tags in the list produce two passes through the position, angle, ID, and offset calculations; they are not two distinct camera frames.

Think first

Is a camera-space tag pose automatically a field location of the robot?

Show Answer

No. It is a relative camera-to-tag observation; field localization would need additional transforms and references.

04Keep signs until distance is calculated

Actual Blocks for this section
Blocks for Keep signs until distance is calculated
Blocks to notice
  • position.x
  • position.y
  • position.z
  • set x / y / z

The pose getters copy all three signed coordinates in meters. Signs matter when adding an offset and when computing steering. Squaring for range removes signs only at that later calculation; taking absolute values first would lose which side the reconstructed center lies on.

For example: A practice pose (-0.30, 0.40, 0.00) m has a 0.50 m range, but its negative x is still important to direction.

Think first

Do x = -0.30 m and x = +0.30 m contribute different amounts to x*x?

Show Answer

No. Both contribute 0.09 square meters, although their signed positions differ.

05Use degree-based yaw and pitch

Actual Blocks for this section
Blocks for Use degree-based yaw and pitch
Blocks to notice
  • orientation.yaw
  • orientation.pitch
  • SIN
  • COS

The source copies yaw and pitch from the pose and passes them to Blocks trig operations, which use degrees. Yaw is taught as a left/right rotation and pitch as a tilt. Do not insert a student radians conversion into this chain: it would change the inputs the Blocks operations expect. Review the exact axis mapping as well as the angle units.

For example: At yaw = 0 and pitch = 0, cosines are 1 and sines are 0, so an offset changes only the source's endpoint X.

Think first

Should a 90-degree pose angle be manually replaced with about 1.57 before the COS block?

Show Answer

No. This Blocks operation expects degrees; cos(90 degrees) is 0.

06Measure the line to a tag center

Actual Blocks for this section
Blocks for Measure the line to a tag center
Blocks to notice
  • multiply x*x / y*y / z*z
  • add
  • square root
  • multiply 39.3701
  • FiducialId
  • TargetXDegrees

Square each camera-space coordinate, add all three, take the square root, then multiply by 39.3701 inches per meter. This range is to the individual visible tag center, not yet a sticker or alliance center. The source also reads the physical tag ID and its raw TargetXDegrees; later center steering replaces that raw angle with a reconstructed-center angle.

For example: For (0.30, 0.40, 0) m: sqrt(0.09 + 0.16) = 0.50 m, or about 19.685 inches.

Math breakout3D Pythagorean distancerange = √(X² + Y² + Z²)

Three perpendicular camera measurements combine into one straight-line range.

Think first

What goes wrong if you omit y when it is 0.40 m in this example?

Show Answer

You get 0.30 m instead of 0.50 m and understate the full camera-to-tag distance.

07Require a pair of matching half-groups

Actual Blocks for this section
Blocks for Require a pair of matching half-groups
Blocks to notice
  • set group -1
  • set offset 0
  • group 0 / 1 / 2 / 3
  • endpoint seen flags

Each tag begins unassigned at group -1 and offset 0. IDs 30-33 form group 0 and reconstruct R4; 34-37 form group 1 and reconstruct R5. Groups 2 and 3 similarly reconstruct B4 and B5 from IDs 38-41 and 42-45. One visible tag from each matching pair of groups is sufficient; two tags from only one group are not.

For example: IDs 30 and 37 can supply both red endpoints. IDs 30 and 31 supply only the R4 half, however many times they are read.

Think first

Can group 0 plus group 3 form a complete red or blue center?

Show Answer

No. The required pairs are 0 with 1, or 2 with 3.

08Convert tag identity into a signed known offset

Actual Blocks for this section
Blocks for Convert tag identity into a signed known offset
Blocks to notice
  • compare FiducialId
  • set group
  • set offset
  • set R1Distance through B8Distance

IDs 30-37 are R1-R8; 38-45 are B1-B8. Within each four-tag sticker the centers sit at -6.5, -2.75, +2.75, +6.5 inches. To reconstruct endpoint 4, the first half uses offsets +13, +9.25, +3.75, 0; to reconstruct endpoint 5, the second half uses 0, -3.75, -9.25, -13. These are signed tag-to-endpoint corrections, not the tag's measured range. TeleOp additionally uses tag-to-sticker offsets +6.5, +2.75, -2.75, -6.5.

For example: R1 at ID 30 is 13 inches left of R4, so its endpoint correction is +13. R8 at ID 37 gets -13 to reconstruct R5.

Think first

For R6, ID 35, is the endpoint offset +3.75 or -3.75 inches?

Show Answer

It is -3.75 inches: move back along the strip from R6 to R5.

09Project the strip offset exactly as written

Actual Blocks for this section
Blocks for Project the strip offset exactly as written
Blocks to notice
  • divide offset by 39.3701
  • COS yaw
  • SIN yaw
  • COS pitch
  • SIN pitch
  • set endpoint X / Y / Z

Let d be the signed inch offset divided by 39.3701. The source reconstructs X = x + d*cos(yaw)*cos(pitch), Y = y + d*sin(yaw)*cos(pitch), Z = z - d*sin(pitch). Notice that yaw contributes to X and Y in these actual Blocks, while pitch changes Z. That is not the usual simplified claim that yaw rotates an offset between X and Z. Treat pose-axis interpretation as a supervised verification task, not an already proven physical model.

For example: For d = 0.10 m, yaw = 90 degrees and pitch = 0, the written equations add about 0 to X, +0.10 to Y, and 0 to Z.

Math breakoutRotate a known AprilTag offsetΔX = d·cos(yaw)·cos(pitch) ΔY = d·sin(yaw)·cos(pitch)

Sine and cosine split one known strip distance into camera-axis pieces.

Think first

At yaw = 0 and pitch = 90 degrees, what is the signed Z correction for positive d?

Show Answer

Z decreases by d, because the source subtracts d*sin(pitch); X and Y corrections are zero.

10Separate sticker distance from alliance-center distance

Actual Blocks for this section
Blocks for Separate sticker distance from alliance-center distance
Blocks to notice
  • set clusterX / clusterY / clusterZ
  • set clusterRange
  • set redScoring / redAudience / blueAudience / blueScoring
  • set endpoint seen

clusterOffset goes from a visible tag to the middle of its own four-tag sticker. The source projects it with the same X/Y/Z equations and calculates a 3D clusterRange. Group 0 fills redScoring, 1 redAudience, 2 blueAudience, 3 blueScoring. Separate offset calculations then reconstruct R4/R5/B4/B5 for the alliance midpoint. Multiple tags in one group overwrite that group's estimate in list order; there is no averaging or best-confidence selection.

For example: ID 30 has +6.5 inches to its sticker middle but +13 inches to R4. These two different corrections must not be interchanged.

Math breakoutRotate a known AprilTag offsetΔX = d·cos(yaw)·cos(pitch) ΔY = d·sin(yaw)·cos(pitch)

Sine and cosine split one known strip distance into camera-axis pieces.

Think first

Does one visible tag on the red scoring sticker prove that the complete red alliance center exists?

Show Answer

No. It gives that sticker's distance and the R4 endpoint estimate; the R5 half is still required.

11Average coordinates, then find range and bearing

Actual Blocks for this section
Blocks for Average coordinates, then find range and bearing
Blocks to notice
  • r4Seen AND r5Seen
  • add endpoints / 2
  • square root
  • atan2
  • redCenterDistance

A complete red pair averages R4 and R5 coordinates; a complete blue pair averages B4 and B5. Each midpoint's 3D magnitude becomes its inch range. atan2 uses center X as the numerator-like Y socket and center Z as the X socket, giving atan2(center X, center Z) in degrees. This reconstructed bearing, not the raw visible tag's tx, guides centering. It is a geometric midpoint estimate, not full field GPS or multi-camera triangulation.

For example: Endpoints (-0.20, 0, 1.00) and (+0.40, 0, 1.00) m yield center (0.10, 0, 1.00), range about 39.57 inches, and tx about +5.71 degrees.

Math breakoutMidpoint and center bearingcenter = (A + B) ÷ 2 angle = atan2(X, Z)

Average two reconstructed endpoints, then calculate the signed turn toward their center.

Think first

Can you obtain the same midpoint by averaging the two endpoint ranges?

Show Answer

Not in general. Average the signed coordinates first, then compute the center's magnitude.

12Choose a center anew each driver loop

Actual Blocks for this section
Blocks for Choose a center anew each driver loop
Blocks to notice
  • if selecting
  • compare range < selectedRange
  • set selectedId 0 / 1
  • set currentRange / currentTx
  • set found true

selectedId 0 means red center and 1 means blue center, not physical tag IDs. Each active TeleOp loop resets selection to -1 and selectedRange to 9999, then chooses the nearer complete center. Red is tested first and blue replaces it only if strictly nearer; equal ranges retain red. found becomes true only for an available selected pair. Holding Square does not lock an alliance across loops.

For example: Red 40 inches and blue 35 choose selectedId 1. On the next loop red 30 and blue 35 choose 0, even if Square is still held.

Think first

With red and blue both at 40 inches in a selecting scan, which wins?

Show Answer

Red, selectedId 0. Blue's strict less-than test cannot replace an equal range.

13Prepare drive outputs at zero

Actual Blocks for this section
Blocks for Prepare drive outputs at zero
Blocks to notice
  • set Direction
  • BRAKE
  • RUN_WITHOUT_ENCODER
  • set four powers 0
  • setPollRateHz 100
  • pipelineSwitch 0

Both left motors and back-right are REVERSE; front-right is FORWARD. All four use BRAKE and RUN_WITHOUT_ENCODER and start at zero. The setup also requests 100 Hz polling and pipeline 0. These device-specific settings are not proof of correct wheel motion, and a requested poll rate is not a guaranteed processed-frame rate.

For example: A 100 Hz poll request can read the same processed result repeatedly; it does not create 100 independent tag observations per second.

Think first

Is back-right FORWARD in this TeleOp source, as it is in AprilTagAuto?

Show Answer

No. TeleOp sets back-right REVERSE, so review each source's direction profile independently.

14Start vision before the INIT scan

Actual Blocks for this section
Blocks for Start vision before the INIT scan
Blocks to notice
  • Limelight start
  • telemetry Hold Square

The source starts the Limelight after selecting pipeline 0 so INIT can inspect tags. Pipeline 0 must actually be configured for the expected AprilTags on this camera. The instructions mention fresh results, but scanTags does not validate their age or pipeline index; starting the camera is necessary, not sufficient for safe vision control.

For example: A pipeline 0 configured for color detection is not interchangeable with this lesson's AprilTag pipeline 0.

Think first

Does the number 0 mean the same detection task on every Limelight?

Show Answer

No. It names a camera configuration slot whose contents must be checked.

15Inspect individual tags before movement

Actual Blocks for this section
Blocks for Inspect individual tags before movement
Blocks to notice
  • while opModeInInit
  • call scanTags
  • show R1-R8
  • show redCenterDistance
  • idle

INIT repeatedly scans and displays R1-R8 and the reconstructed red-center distance while setup's zero motor requests remain in place. Individual tags can be visible while the red center stays not available because the matching half is absent. This is a preview, not a motion authorization or a separate wall guard.

For example: Seeing R1 and R2 can fill two tag-distance rows but cannot make redCenterDistance available without one R5-R8 observation.

Think first

Can a visible R1 distance alone justify Square alignment to the red center?

Show Answer

No. Center construction requires an endpoint estimate from both red halves.

16Wait, then refresh selection every active loop

Actual Blocks for this section
Blocks for Wait, then refresh selection every active loop
Blocks to notice
  • waitForStart
  • while opModeIsActive
  • selecting true
  • selectedId -1
  • selectedRange 9999
  • call scanTags

waitForStart separates INIT from driving. Each active loop then clears the target choice and rescans, so the nearest complete center can change between loops. Joysticks are read after this scan. The source has no held-bumper deadman gate for vision turning.

For example: A blue center can win one loop and red the next if their computed ranges change order while Square remains held.

Think first

Does holding Square freeze selectedId until release?

Show Answer

No. Selection is restarted each active loop.

17Build the manual command first

Actual Blocks for this section
Blocks for Build the manual command first
Blocks to notice
  • forward = -LeftStickY
  • strafe = LeftStickX
  • turn = RightStickX
  • LeftBumper
  • ABS sum
  • denominator minimum 1

Manual driving uses the same signed inputs and normalization as Start: negate controller Y, retain left X and right X, choose speed 1 or held-bumper 0.35, and use max(1, sum of magnitudes). This branch calculates the manual request even when Square will override the outputs later.

For example: Full forward with LeftBumper held requests four manual powers of 0.35 before the Square branch runs.

Think first

Does the bumper's 0.35 automatically scale the later fixed Square-turn powers?

Show Answer

No. Square writes its own fixed powers after the manual calculation.

18Send manual powers before an override

Actual Blocks for this section
Blocks for Send manual powers before an override
Blocks to notice
  • FL f+s+t
  • FR f-s-t
  • BL f-s+t
  • BR f+s-t
  • divide denominator
  • multiply speed

The four mecanum formulas send bounded manual commands. Square is checked afterward and can replace all four in the same loop. This ordering matters: a final zero Square decision overrides a forward joystick request; it does not imply the manual calculation never occurred. The source is not a single gated output stage.

For example: With forward 1 and Square held but no complete center, manual writes are followed by four zero writes; the final requests are zero.

Think first

Which command should the final motor Power telemetry show when an active Square branch writes zero?

Show Answer

The later zero request, not the earlier normalized joystick value.

19Override only while Square is held

Actual Blocks for this section
Blocks for Override only while Square is held
Blocks to notice
  • if Square
  • if found
  • ABS currentTx <= 2
  • set turn powers
  • set four powers 0

Held Square replaces joystick powers. With found true and |currentTx| <= 2 degrees, all four receive zero immediately; there is no five-check counter in this TeleOp. For positive error, FL/BL are +0.18, FR -0.24, BR -0.18; negative error reverses those signs. No complete center means zero. Releasing Square restores manual control next loop, even if the joystick is still held. The fixed turn powers are not bumper-scaled.

For example: At currentTx +3 degrees, final FL/FR/BL/BR requests are +0.18, -0.24, +0.18, -0.18. At exactly +2 degrees they are all zero.

Math breakoutClosed-loop camera centeringmeasure → turn → measure again → stop inside ±2°

The robot repeatedly corrects fresh angle error instead of guessing one perfect turn.

Think first

If Square is released with forward still 1, will the robot remain in the alignment stop?

Show Answer

No. Manual driving resumes next loop; release the sticks too when a stop is intended.

20Read the four sticker-distance rows in their branch

Actual Blocks for this section
Blocks for Read the four sticker-distance rows in their branch
Blocks to notice
  • telemetry redScoring
  • redAudience
  • blueAudience
  • blueScoring

The rows refer to IDs 30-33 red scoring, 34-37 red audience, 38-41 blue audience, and 42-45 blue scoring. Each is a distance to its sticker's reconstructed middle, not to one tag or to the alliance midpoint. In the actual chain these four addData blocks are inside Square's found-and-centered branch, not unconditional live displays after START. A missing row is not the same as a fresh not visible value.

For example: While Square is turning at +3 degrees, this branch does not add the four rows. With found true and error +1 degree, it does.

Think first

Does seeing no cluster row while driving manually prove that the camera sees no cluster?

Show Answer

No. The source adds these rows only in the held-Square centered branch; inspect branch execution as well as detection.

21Separate raw input from final alignment output

Actual Blocks for this section
Blocks for Separate raw input from final alignment output
Blocks to notice
  • Square align CENTERED / turning / need halves
  • Center error / distance
  • command rows
  • motor Power rows
  • telemetry update

Alignment status explains whether Square centered, turned, or lacked the matching halves. Command rows still report raw manual calculations, while motor Power rows report final requests after any override. Center error and distance are added only when Square has found a center. update sends the assembled display, not a freshness guarantee for its camera data.

For example: Forward command 1 and motor powers 0 can coexist when held Square finds a centered target. The rows describe different stages of the loop.

Think first

Which rows reveal what was finally requested when raw manual turn disagrees with alignment?

Show Answer

The four motor Power rows, interpreted with Square status; they still do not measure actual wheel speed.

22End both driving and camera polling

Actual Blocks for this section
Blocks for End both driving and camera polling
Blocks to notice
  • set four powers 0
  • Limelight stop

After the active loop exits, the source requests zero on every motor and stops the Limelight. Driver Station STOP ends the OpMode. Square release is not program termination and can resume manual motion. Do not treat camera loss handling, source enabled metadata, or an educational name as certification of an independent safety system.

For example: Use STOP to end a trial with an unexpected wheel sign; do not merely release Square while a joystick requests travel.

Think first

Does releasing Square also stop the Limelight and end the OpMode?

Show Answer

No. It only removes the alignment override; final camera cleanup occurs after loop exit.

Try it without a robot

Make the math make sense

tag range (in) = sqrt(x*x + y*y + z*z) * 39.3701
Camera-space position is in meters. Include height y, and convert the 3D straight-line distance to inches.
d = offset (in) / 39.3701
Put a known strip offset in meters before adding it to the pose.
endpoint X = x + d*cos(yaw)*cos(pitch); Y = y + d*sin(yaw)*cos(pitch); Z = z - d*sin(pitch)
These are the actual source projections, using degree-based Blocks trig. Do not replace them with an assumed X/Z yaw formula. The physical pose-axis interpretation needs supervised verification.
center = (endpoint 4 + endpoint 5) / 2 on each axis
Average reconstructed endpoint coordinates, not tag ranges. One observation from each matching half is required.
center range = sqrt(X*X + Y*Y + Z*Z)*39.3701; center tx = atan2(X,Z)
Range includes all three axes. The Blocks atan2 sockets hold X-socket = center Z and Y-socket = center X, giving the signed horizontal angle in degrees.
manual D = max(1, |forward| + |strafe| + |turn|); speed = LeftBumper ? 0.35 : 1
This bounds manual mecanum powers, not the later fixed Square alignment outputs.
Square centered when found AND |currentTx| <= 2 degrees
One loop's center test selects zero power. This TeleOp has no five-frame settling counter or result-age test.
cluster d = clusterOffset / 39.3701
Use the same projection equations with the sticker-middle offset; endpoint offsets and sticker offsets have different destinations.

Use a notebook or talk through your answer with a partner. You do not need a robot to predict what these blocks will do.

1. Reconstruct the two destinations

On paper take R1 at x = 0, y = 0, z = 1 m, yaw = pitch = 0. Calculate its sticker-center X using +6.5 inches and its R4 X using +13 inches. Then pair R4 (-0.20,0,1) with R5 (+0.40,0,1) and calculate the midpoint, range, and atan2 angle.

2. Trace the override and target choice

Write a final-power table for full forward with bumper held: Square released; Square held with found false; found true with tx +3; found true with tx +2; Square released again. Separately trace red/blue ranges 40/35, then 30/35, then 40/40. Does Square lock selectedId?

3. Audit what the sample actually guarantees

List the reset, null, matching-half, centered, and cleanup checks. Then list the missing age, distinct-frame, and wall checks. Draw where the four cluster telemetry blocks sit in the conditional tree and explain why no row is not proof of no detection.

Math in motion

3D Pythagorean distance

range = √(X² + Y² + Z²)

X, Y, and Z are three right-angle legs measured from the camera. Squaring removes direction signs, adding combines all three dimensions, and the square root returns the direct distance.

  1. Square X, Y, and Z so left/right and up/down signs cannot cancel distance.
  2. Add the three squared lengths.
  3. Take the square root, then convert meters to inches with × 39.3701.

Uses the official BIOBUZZ AprilTag cluster geometry from the FIRST field CAD.

Math in motion

Rotate a known AprilTag offset

ΔX = d·cos(yaw)·cos(pitch) ΔY = d·sin(yaw)·cos(pitch)

The measured offset lies along the AprilTag strip, but that strip can be turned relative to the camera. Yaw and pitch rotate the known offset into X, Y, and Z components before those components are added to the visible tag position.

  1. Convert the known offset from inches to meters.
  2. Use cosine for the component aligned with an axis and sine for the perpendicular component.
  3. Add the rotated components to the visible tag coordinates to estimate a hidden point.

The white strip is official BIOBUZZ field CAD; arrows are instructional overlays.

Math in motion

Midpoint and center bearing

center = (A + B) ÷ 2 angle = atan2(X, Z)

A midpoint is found independently on every axis. Once the center has X, Y, and Z coordinates, atan2 compares sideways X with forward Z and preserves the correct left/right sign and quadrant.

  1. Average endpoint A and endpoint B on X, Y, and Z.
  2. Use the midpoint coordinates for center range.
  3. Use atan2(X, Z) for a safe signed horizontal angle, even when one coordinate is zero.

AprilTag strips come from the official BIOBUZZ field model.

Math in motion

Closed-loop camera centering

measure → turn → measure again → stop inside ±2°

Each camera frame produces a new horizontal error. The robot turns in the error direction, measures again, and stops only after the center remains close enough to straight ahead. Requiring several centered frames filters camera flicker.

  1. Measure currentTx from the newest complete center calculation.
  2. Turn left or right with a small bounded motor command.
  3. Stop after the error is within 2 degrees for the required number of fresh frames.

Robot proportions use the official REV Starter Bot Onshape assembly bounds.

Full commented Blocks program

One source program, in one column. Calls connect any named helper routines; they are not separate programs. Click a numbered blue comment to return to its explanation.

100%

Ask your supervisor before importing or running these Blocks. Viewing the program does not control the robot.

Section in context

Full Blocks program

The highlighted Blocks belong to this section. You can select another blue comment.

Check your understanding

Your turn

Choose an answer, then check your thinking. You can change an answer and try again.

Your answers stay on this page and reset when you reload. No cookies, account, or saved answers.

0 / 7 correct · 0 / 7 answered

0
0
Question 1Which visible pair can reconstruct a red center in one scan?

Question 2For offset d = +0.10 m, yaw 90 degrees, pitch 0, what does the written source add?

Question 3Square is held, found is true, and currentTx is +3 degrees. What final FL/FR/BL/BR powers are written?

Question 4In a selecting scan red and blue centers both have range 40 inches. Which selectedId remains?

Question 5What does resetting flags and retrieving a non-null latest result prove?

Question 6When does the actual chain add the four sticker-distance rows?

Question 7Square is released while the forward joystick remains held. What follows?

Reset clears every choice, explanation, and score.

For supervisors: 90-minute teaching plan & robot setup

Before the robot is used

Safety: Learn identifies a teaching example only. Do not deploy or enable this lesson as competition-ready code. It has no result-age gate, distinct-frame validation, or wall guard, and manual powers are written before the Square override. Physical review must precede any separately authorized wheels-clear demonstration. Use an operator and supervisor at STOP, clear the mechanism, and isolate power for inspection. Releasing Square can resume manual driving.

Required hardware & dependencies

  • Four mecanum drive motors named front_left_drive, front_right_drive, back_left_drive, and back_right_drive; verify each configured name against its physical cable and wheel.
  • FTC Robot Controller, Driver Station, secure battery, and a notebook. Motor direction settings are specific to the source and mounting, not universal wiring instructions.
  • Limelight 3A configured as limelight, expected AprilTag pipeline 0, accurate tag sizes and camera setup.
  • Verified ID 30-45 target layout with -6.5/-2.75/+2.75/+6.5 inch sticker positions and matching halves; paired gamepad exposing Square and LeftBumper.

Source remains AprilTagTeleOp.blk. Dependencies are the FTC SDK's native Limelight 3A Blocks, device limelight, four exact motor names, a verified AprilTag pipeline 0, and the source's ID/offset layout. No helper ZIP is provided. Enabled metadata and a Learn label do not authorize physical operation; review freshness, coordinate conventions, wheel signs, and safety separately.

Robot setup checklist

  1. Inspect AprilTagTeleOp.blk using supported native FTC/ Limelight Blocks. Resolve missing device/API blocks before considering hardware work; no invented support bundle is required by this page.
  2. Verify pipeline contents, physical tag layout, camera pose-axis convention, and literal source projection signs. The term triangulated in source telemetry does not establish field localization accuracy.
  3. Review FL/BL/BR REVERSE, FR FORWARD, RUN_WITHOUT_ENCODER, and the +/-0.24 front-right alignment bias. Do not copy the autonomous direction profile here.
  4. Plan paper traces for stale results, missing halves, and Square release. Enabled metadata and a Learn label do not replace an independent freshness/safety assessment.

90-minute teaching sequence

  1. 0-15 min

    Map IDs, matching halves, sticker middles, and endpoint destinations.

    Look for: One tag from each matching half, not simply any two tags.

  2. 15-40 min

    Calculate signed endpoint corrections, literal trig projections, midpoint range, and bearing.

    Look for: Meter/inch consistency and source Y projection with sin(yaw).

  3. 40-60 min

    Trace manual power writes, Square overrides, and target reselection.

    Look for: Students preserve the stronger front-right command and distinguish held override from target lock.

  4. 60-90 min

    Audit telemetry nesting, missing freshness checks, and safety claims; complete quiz and exit ticket.

    Look for: No-row, not-visible, stale-data, and zero-command statements are not confused.

Observation notebook

Notebook: one scan's evidence and one loop's final requests
Visible IDs / result evidenceAvailable halvesSelected center / txSquareFinal FL / FR / BL / BR
30 and 31; age unverifiedRed first onlyNoneHeld0 / 0 / 0 / 0
30 and 37; worked poseBoth redRed / +3 degreesHeld0.18 / -0.24 / 0.18 / -0.18
Both centers; red = blue rangeBoth alliancesRed / +2 degreesHeld0 / 0 / 0 / 0

Also record raw manual input separately. Mark result age as unverified in this source, and note whether the cluster-display branch actually ran.

Troubleshooting · stop before investigating

Tags show ranges but no red center exists.
Check for at least one ID 30-33 AND one ID 34-37 in the same scan. Multiple tags from one sticker do not replace the other half.
Cluster rows disappear while manual driving.
Inspect the actual nesting: rows are added only in held-Square found-and-centered behavior. Do not invent a camera failure from absent rows.
Alignment changes alliance while Square remains held.
That follows per-loop reselection. Record red and blue ranges and the strict comparison; this sample has no held target lock.
A target pose or command sign looks wrong.
Keep the robot stopped. Verify camera-space axes, the literal yaw/pitch projection, motor mapping, and FR bias; do not patch signs blindly.
Display seems current but follows an old image.
A latest-result call is not a freshness guarantee. Review frame age and deduplication requirements separately; do not approve physical operation from this scan alone.

Exit ticket & assessment

  1. Explain why IDs 30 and 31 cannot make a red center.
  2. Calculate the source's correction at yaw 90 and pitch 0.
  3. Describe Square release and one missing safety check.

Assessment: Pass requires correct ID grouping, signed unit conversion, literal projections, selection ties, and final override powers. Students must also identify missing age validation and the conditional cluster rows; an educational label is never accepted as safety evidence.

Extension challenge: Sketch a non-deployed design for a single output stage with explicit result age and target-lock evidence. Separate proposed improvements from what the authentic Blocks currently do.

Teacher key · discuss after students predict

Two R1 corrections

At zero angles sticker X adds 6.5/39.3701, about 0.16510 m; R4 X adds 13/39.3701, about 0.33020 m. They have different destinations.

Midpoint practice

The supplied endpoints average to (0.10,0,1) m: range about 39.57 inches, bearing about +5.71 degrees. Averaging individual ranges is not equivalent.

Override table

Bumper-held full forward gives four 0.35 manual requests. Held Square with no center or tx +2 gives zeros; tx +3 gives 0.18,-0.24,0.18,-0.18. Releasing Square returns to manual 0.35.

Target and freshness

Range pairs 40/35, 30/35, 40/40 choose blue, red, red. Reset flags are scan-local, not a frame-age check. Cluster rows are conditional, not unconditional post-START telemetry.