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:
- Work through ROS2 basics.
- Read Using git in this module.
- Work through ROS2 on your own machine if you plan to work outside the university labs.
- 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:
- Find the
COMP4034/srcfolder in your home directory on the lab machine. - Open a terminal at that location.
- Type
code .into that terminal. - 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. - Go to VSCode, press
ctrl+shift+pon 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 buildfromros2_ws - Once your code is built, you need to run
source install/setup.bashfromros2_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