ROS 2 kinematic_guard catches mismatches before hard E-stop
Watch /cmd_vel and /odom to detect execution collapse early
Most mobile robot stacks rely on timeouts: if /cmd_vel stops arriving, the base driver halts the robot. But timeouts only detect silence, not physically inconsistent motion. A robot can receive fresh commands while slipping on a wet floor, suffering odometry drift, or reacting to bursty Wi-Fi replays. ros2_kinematic_guard bridges that gap by comparing command velocity against measured odometry over a short sliding window. When the residual exceeds a threshold, it emits a structured JSON diagnostic with fields like causalAlignment (ALIGNED/BROKEN) and dominantCause (WHEEL_SLIP, LOCALIZATION_JUMP, etc.). In guard mode, it can clamp or brake the outgoing command before the safety-rated E-stop is forced to act.
The package runs as an inline topic filter: Nav2 or teleop publishes to /cmd_vel, the guard publishes to /safe_cmd_vel for the base driver. No modifications to planners, behavior trees, or proprietary drivers are needed. Three modes allow staged deployment: observe (log only), passthrough (wiring test), and guard (active intervention). The README includes a 5-minute demo using a lightweight mock robot that injects wheel slip—no Gazebo or Isaac Sim required. For persistent fault debugging, setting slip_duration_sec:=9999.0 holds the condition stationary. This pre-E-stop diagnostic layer aims to reduce unforced hard stops, mechanical stress, and post-incident debugging time in production AMR/AGV fleets.
- Detects kinematic mismatches (wheel slip, odometry drift, localization jumps, stale command bursts) that standard timeouts miss.
- Operates as an inline topic filter with three modes: observe (passive), passthrough (wiring test), guard (active brake/resync).
- No code changes to Nav2, planners, or drivers; demo runs with a mock robot (no simulation required).
Why It Matters
Early detection of execution collapse reduces unforced E-stops, improving uptime and reducing mechanical stress in AMR/AGV deployments.