Lab 2 Part 1 will ask you to program your robot to perform a few maneuvers using open loop control. The instructions at the end of this assignment are one way to do this but not the only way. You will be graded on whether your code, demo, video, and other submissions meet the specifications below, not on following the instructions exactly.
This lab requires that you create:
The goal of this part of the 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:
Submit a PDF to Blackboard with the following information:
Demonstrate each pattern class and also turn in to Blackboard:
Submit a PDF to Blackboard with the following information.
Demonstrate odometry of each pattern.
5 points: Package creation
25 points Line pattern
25 points Circle pattern
25 points Square pattern
20 points: Answers to questions
10 points Algorithm
10 points Implementation
15 points Accuracy (scaled to your peers)
15 points Demo
$ chmod +x <node_name>
<launch> <group ns="$(env VEHICLE_NAME)"> START YOUR NODE HERE </group> <include file="$(find fsm)/launch/fsm_node.launch"> <arg name="veh" value="$(env VEHICLE_NAME)"/> <arg name="param_file_name" value="lane_following"/> </include> </launch>
This will start your node inside the namespace for your robot.
$ dts devel build -H <duckiebot_name>.local --pull
The first time this command runs it may take a while. To get some additional feedback, you may want to run this first to download the core docker containers:
$ docker -H <duckiebot_name>.local pull duckietown/dt-core:daffy-arm32v7
$ dts devel run -H <duckiebot_name>.local -s -M --cmd bash
The -s flag copies your repo to the /code folder on the robot so that it can be mounted by the -M flag and you do not need to rebuild for every small change.
$ dts start_gui_tools <duckiebot_name>
to figure out what is going on using standard ROS tools.
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.