Lab 3 Robot Odometry

Objectives

The goal of this lab is for you to develop a ROS node that estimates robot odometry on the Duckiebot. This odometry will not be exact because the robot will not do exactly what we tell it to do, but let’s try to get close. In this lab, you should:

  • Create one new node in your odometry package (from Homework 6) to calculate the current position of the robot based on its motion. This node should subscribe to either the wheel encoder data (if you have a DB19) or the wheel velocities (either DB18 or DB19) and publish a Pose2D message with the current calculated estimate of the robot’s (x, y, theta) pose. See below for technical details.
  • Create three new launch files that each start your odometry node with a pattern made in Lab 2:
    • 1m straight line
    • 1m circle
    • 1m square
  • Test each pattern on your Duckietown mats at least three times and report the final position that your odometry node calculates for each test.

Submission Instructions

Submit a PDF to Blackboard with the following information.

Answers to the questions:

  1. Provide a link to your repo and the tag that corresponds to this code
  2. For the straight line test:
    1. Report measured vs calculated (by your odometry node) positions for the three trials
    2. A screen recording of one trial clearly showing
      1. The live output from your odometry node (using rostopic echo or output to terminal)
      2. The view from rqt_image_view
    3. A recording of the robot’s motion on the mat during the recorded trial
  3. For the circle test:
    1. Report measured vs calculated (by your odometry node) positions for the three trials
    2. A screen recording of one trial clearly showing
      1. The live output from your odometry node (using rostopic echo or output to terminal)
      2. The view from rqt_image_view
    3. A recording of the robot’s motion on the mat during the recorded trial
  4. For the square test:
    1. Report measured vs calculated (by your odometry node) positions for the three trials
    2. A screen recording of one trial clearly showing
      1. The live output from your odometry node (using rostopic echo or output to terminal)
      2. The view from rqt_image_view
    3. A recording of the robot’s motion on the mat during the recorded trial
  5. A description of any problems you had completing this lab.

For ALL videos: screen recordings do not need to be synced with external recordings, but PLEASE cut the video to the relevant portion. Outside of extenuating circumstances, each video should be approximately one minute or less in length.

Post in #demonstrations on slack and also turn in:

  1. Link to the video of an attempt at the 1m straight line along with the measured vs caculated pose
  2. Link to the video of an attempt at the 1m circle pattern along with the measured vs caculated pose
  3. Link to the video of an attempt at the 1m square pattern along with the measured vs caculated pose

Rubric

  • Algorithm: 25 points
  • Implementation: 30 points
    • Correct constants found on robot: 10 points
    • ROS package setup: 5 points
    • ROS node implementation: 15 points
  • Accuracy (scaled to your peers): 15 points
  • Demo videos: 30 points (submitted to Blackboard and slack)

Technical Details

There are two ways to complete this lab, depending on if you have a DB18 or a DB19:

DB18: Assume that the vehicle is performing the commands exactly as ordered and integrate the wheel velocities provided by the topic
wheels_driver_node/wheels_cmd. This approach can also be done on the DB19, it is your choice. You will need to perform some experiments to determine the correspondence between the numbers given here and the actual speed of the wheels.

DB19: Use the wheel encoder data provided by left_wheel_encoder_node/tick and right_wheel_encoder_node/tick. You will need to find the correspondence of ticks to each wheel movement in real-life. You will then need to record each tick as they come in and, likely using a timer, calculate odometry using both.

Find the correspondence between the data from the Duckiebot (using either method) and real-world measurements. Drive your robot around and record how the values change. You may find that the size of your wheels and the baseline distance between the wheels is important. You can use keyboard control or directly publish to the command topic to make your vehicle drive at a constant speed.

When you complete your node, test it thoroughly. You may find that the robot has a consistent bias in one direction or another. You may need to add a scaling factor to one or more components of the input or output. You are free to do this, as long as the same scaling factors are present in all trials.