Add velocity_decay to Omnidirectional3D to prevent drift when odom goes silent#34
Add velocity_decay to Omnidirectional3D to prevent drift when odom goes silent#34bkanator wants to merge 1 commit into
Conversation
3fa9dfd to
16233dd
Compare
There was a problem hiding this comment.
Pull request overview
Adds configurable exponential velocity decay to the Omnidirectional3D motion model to reduce drift when velocity observations stop, while preserving existing behavior by default.
Changes:
- Adds
velocity_decayparameter parsing, validation, storage, and propagation through Omnidirectional3D constraints. - Updates prediction functions and analytical Jacobians to apply decay to linear/angular velocity.
- Adds prediction tests for zero decay, velocity reduction, and decay-factor Jacobians.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
fuse_models/src/omnidirectional_3d.cpp |
Reads and forwards velocity_decay into prediction and constraints. |
fuse_models/src/omnidirectional_3d_state_kinematic_constraint.cpp |
Stores decay on the constraint and passes it to the cost function. |
fuse_models/include/fuse_models/omnidirectional_3d.hpp |
Documents and stores the new model parameter. |
fuse_models/include/fuse_models/omnidirectional_3d_state_kinematic_constraint.hpp |
Extends constructor/serialization with decay. |
fuse_models/include/fuse_models/omnidirectional_3d_state_cost_function.hpp |
Extends cost function with decay propagation. |
fuse_models/include/fuse_models/omnidirectional_3d_predict.hpp |
Applies decay in prediction and Jacobians. |
fuse_models/test/test_omnidirectional_3d_predict.cpp |
Adds tests for decay behavior and Jacobian scaling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2a0796b to
d91cb4c
Compare
Steps to ship after merge (from Josh)Both Humble and Jazzy are built from the `humble` branch, so this single PR covers both distros.
|
d91cb4c to
7331d02
Compare
|
tested by
Step 2 — Install deps and build: Step 3 — Launch (source user_ws FIRST so it overrides the Step 4 — RViz (new terminal, same sourcing order): |
7331d02 to
2fe220f
Compare
…ft when odom goes silent
2fe220f to
6a675ca
Compare
|
here is the video from testing that verified both fixing velocity and acceleration drift does not make the yellow arrow move after robot is stopped and nav2 controller is deactivated. fuse_no_drift-2026-06-03_10.46.45.mp4 |
|
@henrygerardmoore griz recommended you get eyes on this, it is for closing https://github.com/PickNikRobotics/moveit_pro/issues/18070 and that issue shows the initial video where the bug is, and then the video after the fix |
Summary
When a nav2 controller deactivates, wheel odom stops publishing. Without a correcting velocity source, `Omnidirectional3D` propagates the last known velocity indefinitely, causing unbounded position drift in the fuse estimate.
Adds a `velocity_decay` parameter (1/s, default `0.0`) to `Omnidirectional3D`. Predicted velocity and acceleration are multiplied by `exp(-k * dt)` each step. At `k=1.0` (20 Hz), velocity and acceleration decay to ~zero in ~3s. Default `0.0` preserves existing behavior.
Decaying acceleration alongside velocity is necessary: a non-zero acceleration state maintains a non-zero steady-state velocity through `vel2 = (vel1 + acc*dt) * decay_factor`, causing sustained drift even after velocity appears to decay.
Updates analytical Jacobians and Boost serialization (versioned, backward compatible with v0 archives).
Claude agent checks