This plugin simulates realistic odometry drift for differential drive robots in Gazebo Fortress. It adds autoregressive noise to wheel velocities, causing drift to accumulate over time, which mimics real-world conditions like wheel slip and misalignment.
- Gradual Drift: Adds cumulative noise to wheel velocities, simulating drift over time.
- Realistic Dynamics: Reflects how small errors can build up in real-world robot navigation.
I created this to test my localization and sensor fusion system, thought it might help others as well.
- Add bounded drift limits
- impulsive noise (random jerks)
- lateral drift to simulate external forces.
The plot above shows a comparison between ground truth and the noisy odometry data, as you can see accumulating drift over time.
- Clone the repository:
git clone <repository_url> cd <repository_name>
- Build the plugin
- Set the environment variable:
export GZ_SIM_SYSTEM_PLUGIN_PATH=$GZ_SIM_SYSTEM_PLUGIN_PATH:<path_to_plugin_build>
- Configure the plugin in your URDF::
In your robot’s URDF file, add the plugin configuration. By default, noisy odometry data will be published to the /odom topic. If you also want the ground truth (without noise), set <odom_gt_topic>odom_gt</odom_gt_topic> under the plugin tag in the URDF as shown:
<plugin filename="DiffDriveNoise" name="gz::sim::systems::DiffDriveNoise"> ... <odom_gt_topic>odom_gt</odom_gt_topic> ... </plugin>
- Start the simulation: Run your Gazebo simulation as usual. You’ll receive noisy odometry on the /odom topic, and if configured, the true odometry on the /odom_gt topic.