Overview

The goals for this section:

  1. Learn how to use ROS Parameters.
  2. Run heading controller on hardware.

Setup

Task 1.1 — Cleanup. Remove directory ~/autonomy_ws if it exists. This may be leftover from a previous section.

Task 1.2 — Directories. Create the base directory structure for your group’s ROS workspace, ~/autonomy_ws/src.

Task 1.3 — Clone and Branch. Clone your group’s GitHub repo to the src/ directory, and create a new branch called section4.

Task 1.4 — Copy homework repo. You will be using the code you wrote in HW1 to control the TurtleBot. Copy the autonomy_repo ROS package (of any of your group members) inside of your group's git repository.

Task 1.5 — Build. Navigate back to the root of your workspace, ~/autonomy_ws/, and build your ROS workspace using colcon build --symlink-install.

Testing your HW

Task 2.1 — Launch simulator. Firstly, we will test out your HW1 code before you can test it out on the actual robot. Just like in HW1, start the TurtleBot simulator by:

ros2 launch asl_tb3_sim root.launch.py

Task 2.2 — Launch your heading controller. In a new terminal, source your workspace, and then run:

source ~/autonomy_ws/install/setup.bash
ros2 launch autonomy_repo heading_control.launch.py

Task 2.3 — Generate plot. Open p3_plot.py from your autonomy_repo/scripts folder and edit the path in line 63 to match the path of your autonomy_repo/plots folder:

filename = Path("src/<repo>/autonomy_repo/plots/p3_output.png")

Then in a new terminal, navigate to the root of your workspace, source your workspace again, and run:

cd ~/autonomy_ws
source install/setup.bash
ros2 run autonomy_repo p3_plot.py