Estimate motion and compare it with commands

Check whether a robot moved as intended using odometry and independent observation.

Exercise brief·Intermediate·4 min read

Opening the Python editor…

Requirements and learning goals

Before you start

  • The learn-go2 simulator from lesson 1
  • Git and coordinate-frame basics

You will be able to

  • Check whether a robot moved as intended using odometry and independent observation.

The browser exercise above works without extra setup. The project brief below assumes the listed prerequisites and gives you a task and checks to perform. Need a guided first project?

A command is not a measurement

estimates a robot's changing position and orientation from motion measurements. A wheeled robot may integrate wheel encoder readings; other robots combine joint, camera, or inertial measurements.

A controller compares a desired state with measured state and adjusts its output. If odometry is wrong, the controller can confidently steer to the wrong place. Comparing command, estimate, and observed movement helps separate control bugs from sensing bugs.

Keep your existing odometry publisher and controller. The CLI reads standard ROS messages; it does not change the motion model or control algorithm.

Add the manual controls

Start the same Go2 VM. In a new directory on your computer, download the teleoperation app. When Wendy asks where to run it, open Simulator and choose learn-go2.

git clone --depth 1 --filter=blob:none --sparse https://github.com/wendylabsinc/WendyOS.git ros-workshop
cd ros-workshop
git sparse-checkout set go/simulator/go2/examples/teleop
cd go/simulator/go2/examples/teleop
wendy run --no-restart

Keep that terminal open and open the printed URL. The app starts with zero velocity. Choose Enable controls, hold a direction briefly, and release it to request a stop. Space, Escape, or Stop / disable ends control. Keep the browser sandbox visible too. After a world reset, restart this app to obtain control again. See the teleoperation guide.

Find the measurement

In a second terminal, list the on learn-go2. Choose the same simulator whenever the device picker opens.

wendy device ros2 topics

Read one odometry message, then measure how often new ones arrive.

wendy device ros2 echo /odom --count 1
wendy device ros2 hz /odom

Stop the rate monitor with Ctrl+C. In the message, identify the timestamp, parent and child frames, position, and velocity. ROS convention uses meters and radians. Orientation is a quaternion, not three angles.

Compare a short movement

In the simulator's existing manual controls, move forward a short distance, then stop. Capture another odometry sample. Compare the position change with the simulator's independent pose display, using matching frames. Repeat with a turn.

Expect changing positions during movement and near-zero velocity after stopping. A steady publish rate is useful, but also check that timestamps advance. Repeated old data can look healthy in a rate monitor.

Checkpoint 1 of 2

The rate monitor reports a steady rate for /odom, but two samples echoed a few seconds apart carry the same timestamp. What should you conclude?

Commit to an answer. Every choice explains itself.

Why estimates drift

For a differential-drive robot, average wheel travel estimates forward distance. The difference in travel divided by wheel separation estimates the turn. For example, left travel of 0.10 m, right travel of 0.12 m, and separation of 0.40 m give 0.11 m of travel and 0.05 radians of turn.

Checkpoint 2 of 2

A differential-drive robot's left wheel travels 0.20 m and its right wheel 0.30 m. The wheel separation is 0.50 m. What does odometry estimate?

Commit to an answer. Every choice explains itself.

Wheel slip breaks that estimate. A wrong encoder sign or wheel size creates systematic errors. Test straight movement and rotation separately before tuning gains.

Stop / disable the controls, then stop the attached app with Ctrl+C. Run wendy vm stop learn-go2 when finished. The next lesson supplies a separate setup; this Go2 exercise has not installed a map server or planner.

Can you do each of these?

  • Check whether a robot moved as intended using odometry and independent observation.

0 of 2 checkpoints solved. Try checkpoint 1

Previous: Choose services, actions, and behavior states
All lessons in this topic
  1. 1. ROS 2 nodes, topics, and QoS
  2. 2. Understand coordinate frames and transforms
  3. 3. Choose services, actions, and behavior states
  4. 4. Estimate motion and compare it with commands
  5. 5. Separate mapping, localization, and navigation

Ask Wendy

Answers about Wendy and WendyOS

What would you like to know?

Ask about devices, development, and deployment.

Check linked docs for technical details.