build details

Show: section status errors & todos local changes recent changes last change in-page changes feedback controls

Calibration - Wheels

Modified 2021-10-26 by tanij

You can make your robot move as described in Unit C-9 - Operation - Make it Move.

Calibrate the wheels of the Duckiebot such that it goes in a straight line when you command it to. Set the maximum speed of the Duckiebot.

Want to learn more about odometry and odometry calibration? Check out our massive open online course resources: video, theory, activities and exercises.

Step 1: Make your robot move

Modified 2021-10-26 by tanij

Follow instructions in Unit C-9 - Operation - Make it Move to make your robot move with keyboard control, and keep the terminal open.

Step 2: See how the robot really moves

Modified 2021-10-26 by tanij

There is a lot going on between pressing ↑ on the keyboard and your Duckiebot moving. To get a better view of what is going on, we need another terminal, but ran closer to where the action is happening:

laptop $ dts start_gui_tools hostname

Duckietown uses ROS to move data around. To determine if the command above worked, type:

$ rostopic list

You should see a list of ROS topics currently active on your Duckiebot. If you know ROS, here you can use ROS commands at will. If you are not familiar with ROS, note that each of these topics might carry messages, i.e., actual data. You can, e.g., “listen” to the data inside each topic. For example:

$ rostopic echo /!hostname/camera_node/image/compressed

will show you incoming images as the Duckiebot sees them!

Keep this terminal open. We will use it to perform the wheel calibration.

Step 3: Perform the calibration

Modified 2021-10-26 by tanij

Calibrating the trim parameter

Modified 2021-10-26 by tanij

The trim parameter is set to 0.00 by default, under the assumption that both motors and wheels are perfectly identical. You can change the value of the trim parameter by running the command:

duckiebot-container $ rosparam set /hostname/kinematics_node/trim trim value

Use some tape to create a straight line on the floor (Figure 13.1).

Straight line useful for wheel calibration

Place your Duckiebot on one end of the tape. Make sure that the Duckiebot is perfectly centered with respect to the line.

Command your Duckiebot to go straight for about 2 meters. Observe the Duckiebot from the point where it started moving and annotate on which side of the tape the Duckiebot drifted (Figure 13.2).

Left/Right drift

Measure the distance between the center of the tape and the center of the axle of the Duckiebot after it traveled for about 2 meters (Figure 13.3).

Make sure that the ruler is orthogonal to the tape.

Measure the amount of drift after 2 meters run

If the Duckiebot drifted by less than 10 centimeters you can stop calibrating the trim parameter. A drift of 10 centimeters in a 2 meters run is good enough for Duckietown. If the Duckiebot drifted by more than 10 centimeters, continue with the next step.

If the Duckiebot drifted to the left side of the tape, decrease the value of r , by running, for example:

duckiebot-container $ rosparam set /hostname/kinematics_node/trim -0.1

If the Duckiebot drifted to the right side of the tape, increase the value of r , by running, for example:

duckiebot-container $ rosparam set /hostname/kinematics_node/trim 0.1

Repeat this process until the robot drives straight.

Want to learn more about odometry and odometry calibration? Check out our massive open online course resources: video, theory, activities and exercises.

Calibrating the gain parameter

Modified 2021-04-06 by Vincenzo

The gain parameter is set to 1.00 by default. You can change its value by running the command:

duckiebot-container $ rosparam set /hostname/kinematics_node/gain gain value

Store the calibration

Modified 2021-04-06 by Vincenzo

When you are all done, save the parameters by running:

duckiebot-container $ rosservice call /hostname/kinematics_node/save_calibration

The first time you save the parameters, this command will create the file

Final check to make sure it’s stored

Modified 2021-10-26 by tanij

The calibration result is saved on your Duckiebot:

/data/config/calibrations/kinematics/hostname.yaml

You can view or download the calibration file using the Dashboard running at http://hostname.local under File Manager in the sidebar on the left, navigating to config/calibrations/kinematics/hostname.yaml.

Additional information

Modified 2021-10-26 by tanij

There are additional parameters you can to play around with to get a better driving experience. You can learn about odometry and odometry calibration here: video, theory, activities and exercises.