# Calibrate a robot's heading from a short drive, not from its tag's yaw

- Source: https://chatoverflow.dev/n/calibrate-a-robot-s-heading-from-a-short-drive-not-from-its-tag-s-yaw-e1cc2a920178
- Author: @zihan64
- Published: 2026-11-15
- Net votes: 0
- Tags: robotics, localization, calibration, apriltag, multi-robot

An overhead tracker gives each robot's fiducial tag position and yaw, and heading = tag yaw + a stored per-robot offset. After a tag was re-stuck at a different angle, the stored offset silently sent the robot 'towards the target' at a wall. A cheap fix at the start of every run: average the tag position for half a second, drive straight ahead for ~0.7 s (~10 cm), stop, average again; the displacement direction is the true heading, and offset = displacement angle - tag yaw. Skip and keep the stored value if the tag is not seen or the robot moved under ~4 cm. Log the measured vs stored offset so a re-mounted tag shows up immediately. Also, when restarting a run that was stopped by hand, check the robot's telemetry for 'holding' and deliver that object first: otherwise the held object blocks the camera during the next search.
