Skip to content

Fuse chassis MegaTag2 while enabled once the disabled seed is confirmed - #156

Merged
allengregoryiv merged 1 commit into
2026-offseason-botfrom
feat/vision-chassis-mt2-after-seed
Sep 19, 2026
Merged

allengregoryiv merged 1 commit into
2026-offseason-botfrom
feat/vision-chassis-mt2-after-seed

Conversation

@allengregoryiv

Copy link
Copy Markdown
Member

Summary

Stacked on #155; merge that first.

The chassis cameras fused MegaTag1 translation while enabled. MT1's translation moves with its own heading solve, and our own logs show two-tag MT1 heading has a 15 deg tail, which at three metres is a quarter metre sideways. MegaTag2 pins heading to the one we push and solves translation alone, so it is far steadier on the move. More than half the repos in the vision teardown fuse MT2. The catch is that MT2 is worthless if the pushed heading is wrong, which is exactly the situation before the disabled seeding has run.

  • While disabled: the MT1 seed runs as before. Vision now also watches for the seed to hold: 50 consecutive seeded loops (about 1 s) from two or more tags, with the camera's heading inside 3 deg peak to peak. Then Vision/PoseSeedConfirmed goes true. Progress is at Vision/SeedConfirmProgress. The gross heading correction also confirms the seed.
  • While enabled: chassis cameras fuse MT2 translation once confirmed, MT1 translation until then (unchanged behaviour). The turret camera is unchanged (MT2). Heading is still never fused while enabled.
  • Vision/ChassisUseMT2 dashboard boolean (default true) turns the switch off without a deploy so the two sources can be A/B'd Friday. Vision/ChassisSource in the log says which one each estimate came from.
  • The MT2 path now applies the same 5 deg tilt gate and maxZErrorMeters height gate as MT1, read from the same frame's MT1 3-D solve, since MT2 only publishes a 2-D pose.
  • MT2 pose is now logged at 10 Hz for all three cameras, not just the turret.

docs/tools/vision.md updated.

Test plan (Friday night)

  • ./gradlew build passes (done locally).
  • Power on in front of tags, stay disabled. Vision/SeedConfirmProgress should climb to 50 and Vision/PoseSeedConfirmed go true within a couple of seconds of a chassis camera seeing two tags. If it never confirms, check Vision/<cam>/TagCount (needs 2+) and whether the MT1 heading is wandering more than 3 deg.
  • Enable. Vision/ChassisSource should read MT2. Drive around and compare Vision/BackLeftLL/MT1Pose vs MT2Pose against the odometry pose on the field widget; MT2 should be the calmer one.
  • Flip Vision/ChassisUseMT2 off on the dashboard mid-session: Vision/ChassisSource should read MT1 next loop. Flip it back.
  • Enable before the seed confirms (cameras still booting): Vision/ChassisSource must read MT1, and the not-seeded alert should show while disabled.
  • Shots: with MT2 on, Vision/SecondsSinceAcceptedEstimate should stay small while driving, and shots should land at least as well as before. If they land worse with MT2 on and better with it off, leave it off and bring the logs home.

🤖 Generated with Claude Code

@allengregoryiv
allengregoryiv requested a review from a team as a code owner September 16, 2026 02:49
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: dfb0b105-95b6-4409-9be1-5f74e6168dae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Project516
Project516 added this pull request to stack #160 September 16, 2026 12:46
@Project516
Project516 force-pushed the feat/vision-chassis-mt2-after-seed branch from 8ec01af to 651fe67 Compare September 16, 2026 13:33
Base automatically changed from fix/vision-gates-measured-turret-omega to 2026-offseason-bot September 19, 2026 01:47
The chassis cameras fused MegaTag1 translation while enabled. MT1 solves
heading from tag geometry and its translation moves with that heading;
at two tags the heading has a 15 deg tail, which at three metres is a
quarter metre sideways. MegaTag2 pins heading to the one the robot
pushes and solves translation alone, so it is far steadier on the move,
but it is only as good as the pushed heading, and before the disabled
seeding has run that heading is whatever the robot powered on with.

So: while disabled, the MT1 seed runs as before, and Vision now watches
for it to hold. seedConfirmLoops consecutive seeded loops from two or
more tags, with the camera's heading inside seedConfirmSpreadDeg peak to
peak, sets poseSeedConfirmed. From then on the chassis cameras fuse MT2
translation while enabled; until then they fuse MT1 as before. The gross
heading correction also confirms the seed. Heading is still never fused
from either while enabled.

Vision/ChassisUseMT2 on the dashboard turns the switch off without a
deploy, so the two sources can be compared at an event, and
Vision/ChassisSource logs which one every estimate came from.

The MT2 path now applies the same tilt and height gates as the MT1 path,
read from the same frame's MegaTag1 3-D solve, since MT2 only publishes
a 2-D pose.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@allengregoryiv
allengregoryiv force-pushed the feat/vision-chassis-mt2-after-seed branch from 651fe67 to 34630f3 Compare September 19, 2026 01:47
@allengregoryiv
allengregoryiv merged commit 821fdf3 into 2026-offseason-bot Sep 19, 2026
2 checks passed
@Project516
Project516 deleted the feat/vision-chassis-mt2-after-seed branch September 26, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant