Home - RobotTeaching/COMP4034 GitHub Wiki

Welcome to the COMP4034 wiki!

This is your lab guide for the module, where you will find a set of Practicals to work through to learn how to control the TurtleBot with ROS2. We recommend keeping your own notes as you go, such as commands that worked, problems you hit and how you fixed them, as they will be useful for your coursework and revision.

We have also created an interactive guide to help you follow the lecture materials: Interactive Robotics Material

Where do I start?

Before your first lab:

  1. Work through ROS2 basics.
  2. Read Using git in this module.
  3. Work through ROS2 on your own machine if you plan to work outside the university labs.
  4. Read Using real robots before you use the physical robots.

The Practicals: Throughout the module, there will be 5 Practicals we will expect you to complete, increasing in complexity and importance. Practicals will be assessed during the lab sessions. The last Practical will also involve a written report. Below you will find a table with more details:

Practical Released Due by (12pm) Weight
P0 (Intro) 6 OCT N/A 0%
P1 (Twist) 7 OCT 20 OCT 10%
P2 (Behaviours) 20 OCT 3 NOV 20%

[!NOTE] Check Moodle for more details on assessment.

IMPORTANT: Lab safety

Follow lab safety procedures at all times. Students who do not may be asked to leave the lab, which could affect their grade. If you have any questions about safety, ask a lab demonstrator. The key points are:

  • Keep walkways clear (tuck bags and cables away)
  • No food and drink in the lab
  • Put your robot on the raised box before turning it on so the wheels are off the ground
  • Be aware of people and robots moving around you
  • Alert other arena users before stepping in
  • Keep long hair and clothes away from moving parts
  • Do not hot plug batteries: turn your robot off at the switch before unplugging
  • LiPos should be taken from the "charged" bag, and put into the "discharged" bag after use

[!CAUTION]

Generative AI policy

You should not copy and paste large chunks of code from any AI tool, as this constitutes false authorship and is an academic offense. During assessments we expect you to explain all code you submit. Failure to do so may result with a zero mark.

Using ROS in the labs (Docker quick-start guide)

The lab machines in B85 use a Docker image to run ROS2 Humble on Ubuntu 22.04. To get the Docker image working, you need to do the following:

  1. Find the COMP4034/src folder in your home directory on the lab machine.
  2. Open a terminal at that location.
  3. Type code . into that terminal.
  4. Once VSCode has opened, go back to the terminal and type xhost +local:docker. This lets the container open GUI windows such as Gazebo and RViz.
  5. Go to VSCode, press ctrl+shift+p on your keyboard, then search for "Dev Containers: Rebuild and Reopen in Container". The first build can take a few minutes, so please be patient.

Your VSCode is now running the Docker container. To use ROS2, open a terminal inside VSCode (View > Terminal). The terminal prompt should start with ros2_ws, which is the root of your ROS2 workspace.

  • You should put your code, such as the files you clone from this GitHub, into ros2_ws/src
  • You should build your code from the root directory, only run colcon build from ros2_ws
  • Once your code is built, you need to run source install/setup.bash from ros2_ws
  • You should run your code (e.g. using ros2 run ...) from the root directory (ros2_ws)

Using ROS outside of the labs

You have several options for working outside your scheduled lab sessions:

University machines: You can use the A32 machines outside the scheduled B85 lab sessions.

Your own machine: You can also run the ROS2 simulation environment on your own machine. See ROS2 on your own machine.

Important: You do not need to install ROS2 directly on your computer if you use the provided Docker environment. Please note that we can only support the lab machines and the provided Docker setup.

Discussions tab

We invite you to use the Discussions tab (next to the Wiki tab) to discuss issues relating to your work on the practical lab tasks. TAs will check this tab regularly to pick up questions. If you have a question, it's likely another classmate does too, so don't be afraid to ask! Please also help by answering each other's questions. We will use your questions and answers to build an FAQ for this module.

Troubleshooting

Something not working? See Troubleshooting.

COMP4034 Quote Book

"That's not an error, that's how you know it's working!" - Adrian