Skip to content
Marc Hanheide edited this page Feb 5, 2025 · 26 revisions

Some general recommendations and rules for the workshop engagement

  1. Be active, seek support: both within your team of peers and the delivery team. We are here to help you. If you don't ask, we don't know what you may be struggling with! Also, use the MS team's channel pro-actively!
  2. Keep notes and code: Everything that you got working, you want to make sure you can find again. Keep a log of the command lines that you use regularly, put them in a text file that you store online and have always at hand, etc. Best practice is to keep all your code at the end of the session in a code repository (GitHub, GitLab, bitbucket, you name it) so that you can just check it out at another location/PC or even at home at any time needed. You will find that we share all relevant code fragments also on GitHub with you (https://github.com/LCAS/teaching/tree/2425-devel/src/cmp3103m_ros2_code_fragments/cmp3103m_ros2_code_fragments). You are strongly encouraged to base your work on the provided GitHub Repository https://github.com/UoL-SoCS/cmp3103-ws (see its README.md). Be an actual computer scientist/software developer and don't put code or command line notes in Word or Google Docs, etc! Simply, don't ;-)
  3. If things are not working immediately, don't give up: Seek help, and once it works, make sure you make a note of what you did to make it work. There are no stupid questions! But asking the same thing again and again because you didn't write it down is a bit stupid ;-)
  4. Google for yourself: We are working with Python in ROS2. This is probably the most widely used combination for doing robotics these days. There is a huge community out there that have answered most questions already. As level 3 students you are expected to be able to solve problems and seek solutions yourself. You will always find us very willing to help you, but isn't it much more rewarding to find a solution yourself?

This week: Getting to know your simulation

This week, we'll look at simulation mainly and setting up our computers and working environments.

Getting your VSCode with the development container up and running

First, let's set up the environment we'll be working in

  1. Boot your computer as instructed by the delivery team. On the lab PCs, we recommend using Linux to run our Docker container, but you may also try it on Windows or your own computer.

  2. Locate VSCode (or install it, if you don't have it yet).

  3. Ensure Docker is installed and running correctly on your system: you may want to try running docker run --rm hello-world to check.

  4. Read and follow the instructions on the Using the Docker Image page. In particular recommended, create your own git repository already at this stage, by usin the https://github.com/UoL-SoCS/cmp3103-ws repository as a teamplte, and clone it in your VSCode instance. The exact steps are summarised here for your convenience:

    1. Create your own private GitHub repository by using https://github.com/UoL-SoCS/cmp3103-ws as a template (read its README.md for details how to do that). Name your own repository, e.g., cmp3103, and make it private to avoid any risk of plagiarism by others.

      (Note: You don't have to use GitHub, you can use another repository or none at all, but this is the easiest way)

    2. Pull the latest module's Docker image (to speed up subsequent steps, will take a few minutes):

      docker pull lcas.lincoln.ac.uk/devcontainer/ros2-teaching:4
  5. Start VSCode and install the "Dev Containers" extension if not already installed (it should be on the Lab PCs and usually is anyway)

  6. In VSCode, clone your own repository you create before.

  7. When prompted, click "Reopen in Container" to start the DevContainer

  8. You will have to wait a bit for the DevContainer to start up.

  9. After this, your VSCode should be connected to your own development container. This is a containerised development environment is based on Ubuntu 22.04 with ROS2 "humble" and all required software installed already.

Getting to know your environment

Work now in your VSCode DevContainer Environment.

  1. In VSCode, open a terminal, you'll mostly be using commands in the terminal. Hints:
    • [Ctrl-C] will stop a currently running command
    • [Tab] is very useful to auto-complete a command
    • [Up] and [Down] allow you to browse the history of previously typed commands
    • (for Linux newbies:) get used to work with the terminal in Linux: a good starting point is the official tutorial for beginners. Please skip the bit about adding a new user.
  2. Look again at the template repository's README.md which also describes how you access the virtual desktop. Make sure you can start up open the desktop as described there.

First steps with the simulation

  1. start the simulation with this command: ros2 launch uol_tidybot tidybot.launch.py
  2. start a simple keyboard teleoperator (in another terminal!): ros2 run teleop_twist_keyboard teleop_twist_keyboard
  3. find out about two important ROS2 commands, namely ros2 topic and ros2 node. Find out what topics exist when you have the simulation up and running, and also how many ROS nodes are running on your system
  4. What do you think about how you could read the odometry from your robot? Find a way to print the odometry of the simulated robot on the screen when moving it around.

First steps with ROS2

  1. With your simulation running, get some very basic ROS commands going:
  2. read tutorials 1-6 ("1.1 Beginner Level") from the official ROS2 tutorials as a good starting point. (BTW, You are using ROS2 humble). First, focus on "understanding nodes" and "understanding topics". You don't need to do the tasks, but read them.
  3. work through the ROS2 tutorial on topics: https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.html and try out the ros2 topic list and ros2 node list commands with your simulation running.

Main Learning Objectives for today

  • Have the simulation up and running, and being able to interact with it.
  • Understand the command line tools ros2 topic and ros2 node to
    • list all "topics"
    • list all "nodes"
    • display the robot's "odometry"

Additional Tasks

  1. Optional: How do you think you could command the robot to move using the topics (using command line tools)?
  2. Optional: run rviz2 and explore the different visualisation widgets (e.g. try to display the robot camera stream and the Laser scanner data)
  3. Optional: familiarise yourself with the programming environment Microsoft Visual Studio Code (VSCode) if you don't know it well enough.
  4. Optional: Explore the module's GitHub repository to better understand the structure of the implementation. Focus on the uol_tidybot package.