robot.heading_drift_watchdog¶
Heading-drift watchdog: warn when the chassis rotates while nothing drives.
Between motion steps (servo-only phases, grabs) no controller ticks the drive, so external forces — an arm pushing off a game piece, a collision — can rotate the chassis on low-friction mecanum wheels without anything noticing. Later motion steps then inherit the heading error, which shows up as “cursed” snap corrections that are expensive to trace back.
This watchdog runs on its OWN daemon thread (never on the asyncio motion loop,
mirroring ContinuousLocalizationFusion): it polls the firmware IMU heading
and, while the "drive" resource is NOT held by any step, accumulates the
rotation since the drive was released. Crossing the threshold logs a WARNING
with the drifted angle, then re-arms so continued rotation warns again.
Purely diagnostic — it never commands anything.
Attributes¶
Classes¶
Functions¶
|
Start the watchdog, or return |
Module Contents¶
- class robot.heading_drift_watchdog.HeadingDriftWatchdog(robot: raccoon.robot.api.GenericRobot, imu, threshold_rad: float = DRIFT_WARN_RAD)¶
- robot.heading_drift_watchdog.start_heading_drift_watchdog(robot: raccoon.robot.api.GenericRobot) HeadingDriftWatchdog | None¶
Start the watchdog, or return
Nonewhen no IMU is available.