71Chapter 71 of 74
Odometry Comparison
Introduction
Chapter 69 wrote a noisy controller: a copy of the simple controller that adds a small random number to every wheel angle it reads and publishes its own odometry on bumperbot_controller/odom_noisy. Chapter 70 started it from controller.launch.py, so it now runs next to the simple controller, which publishes the exact odometry on bumperbot_controller/odom.
This chapter puts the two odometries side by side. No code changes. In six terminals the robot is simulated, the two odometries are plotted in PlotJuggler, and the two frames are watched in RViz, first with the robot standing still and then while it is driven with the joystick. The noise is easy to see: the exact numbers stay calm, the noisy numbers vibrate.
Chapters 69 and 70 must already be built and working, and the joystick launch file of chapter 44 must exist. The commands use ROS 2 Jazzy, as in your notes: replace jazzy with the name of your distribution if it is different.
Where the pieces come from
| Idea | Where it was met | Section |
| starting the simulation and the controllers | chapters 43 and 70 | Start the Gazebo simulation |
| the noisy controller and its odometry topic | chapters 69 and 70 | the noisy node and its launch file |
| RViz with the fixed frame odom and the TF display | chapter 49 | Set the fixed frame, Add the TF display and Show the frame names |
| driving the robot with the joystick | chapter 44 | Connect and launch the joystick and Teleoperate the BumperBot |
| why odometry is never exact | chapter 60 | When odometry goes wrong |
Starting the robot
Terminal 1: build
Open a terminal and build the workspace:
cd bumperbot_wscolcon build![A terminal after colcon build. Five packages are finished and the last line reads Summary: 5 packages finished [3.15s].](/uploads/2026/11/image-101.png)
What you should see
Starting >>> bumperbot_msgs
Starting >>> bumperbot_controller
Starting >>> bumperbot_cpp_examples
Starting >>> bumperbot_description
Finished <<< bumperbot_description [0.26s]
Finished <<< bumperbot_cpp_examples [0.36s]
Finished <<< bumperbot_controller [0.95s]
Finished <<< bumperbot_msgs [0.99s]
Starting >>> bumperbot_py_examples
Finished <<< bumperbot_py_examples [1.97s]
Summary: 5 packages finished [3.15s]Terminal 2: the simulation
Open a second terminal, source the workspace and start Gazebo with the robot:
. install/setup.bashros2 launch bumperbot_description gazebo.launch.py
Terminal 3: the controllers
Open a third terminal, source the workspace and launch the controllers. This also starts the simple controller and the noisy controller (chapter 70):
. install/setup.bashros2 launch bumperbot_controller controller.launch.py use_simple_controller:=false
Plotting the two odometries
Terminal 4: install PlotJuggler
PlotJuggler draws graphs of ROS 2 topics. Open a fourth terminal and install it:
sudo apt-get install ros-jazzy-plotjuggler*
When the installation is finished, start it in the same terminal:
ros2 run plotjuggler plotjuggler
Connect PlotJuggler to ROS 2
PlotJuggler opens with an empty graph:

- In the Streaming panel, open the list of data sources and choose ROS2 Topic Subscriber.

- Click Start.

- A list of topics opens. Select
/bumperbot_controller/odomand/bumperbot_controller/odom_noisy, then click OK.

Put the two speeds in the graph
The topics appear in the Timeseries list on the left. Open the exact odometry and drag its linear speed into the graph. The path is the same every time: odom, then twist, then twist again, then linear, then x.

Do the same for the noisy odometry: open odom_noisy, then twist, twist, linear and drag x into the same graph.

The robot is standing still, so the real speed is 0. The exact odometry says about 0. The noisy odometry jumps up and down around 0 by several centimetres per second. The robot did not move: the noise is only in the numbers of the noisy node. The picture below shows where this size of jumps comes from:
Watching the frames in RViz
Terminal 5: start RViz
Open a fifth terminal, source the workspace and start RViz:
. install/setup.bashrviz2
Set up RViz
The numbers match the yellow numbers in the picture below.
- Change the Fixed Frame to
odom. - Click Add and add the TF display.
- Open the options of TF and tick Show Names.
- Open Frames.
- Tick base_footprint.
- Tick base_footprint_noisy.

The two frames start in the same place. When the robot moves, base_footprint follows the exact odometry and base_footprint_noisy follows the noisy one. Watch the noisy frame:
Driving with the joystick
Terminal 6: the joystick
Open a sixth terminal, source the workspace and launch the joystick teleoperation of chapter 44:
. install/setup.bashros2 launch bumperbot_controller joystick_teleop.launch.py
Connect the joystick and start driving. Watch the graph in PlotJuggler and the two frames in RViz while the robot moves:
The real robot moves in Gazebo as before. Both odometries follow it, but the noisy one also jitters on top. Later chapters use probability tools and filtering to deal with this kind of noise.
Remember
- The simple controller publishes the exact odometry on
bumperbot_controller/odomand the noisy controller publishes the noisy one onbumperbot_controller/odom_noisy. Both start fromcontroller.launch.py. - PlotJuggler (ROS2 Topic Subscriber, then Start) draws the topics. Plot
twist,twist,linear,xof both odometries in one graph to compare them. - With the robot standing still the exact speed stays near 0 and the noisy speed vibrates around it. The robot is not moving: the noise lives in the numbers of the noisy node.
- A small noise on the wheel angles becomes a big jump in the speed, because the speed is a change of angle divided by a short time.
- In RViz, with the fixed frame odom and both frames ticked,
base_footprintfollows the exact odometry andbase_footprint_noisyfollows the noisy one and vibrates. - The joystick launch file drives the robot while both odometries are watched. Noise like this is the reason the next chapters turn to probability tools and filtering.