Introduction presentation for the Robot Operating System (ROS).
Newcastle Racing AI (NRAI) team
ROS is a set of software libraries and tools for building robot applications.
It spans from drivers to state-of-the-art algorithms, and includes powerful developer tools, including streamlined build systems and package managers.
ROS started as a personal project of Keenan Wyrobek and Eric Berger while at Stanford.
ROS development began in 2007, with an exponential growth in the following years.
Loading diagram...
In the ❤️ of the many developers that made it possible.
Being open source, you can find the source code on Github.
No time to reinvent the wheel!
Loading diagram...
Loading diagram...
ROS1 is the original version, now deprecated.
A lot of changes between ROS1 and ROS2; they are not compatible.
ROS1 | ROS2 |
---|---|
C++03 | C++11/14 |
Python2 | Python3.5+ |
XML launch | Python launch |
Master node | Distributed |
catkin | colcon |
Distro | Release | EOL | Ubuntu |
---|---|---|---|
Kilted Kaiju | 2025 | 2026 | 24.04 |
Jazzy Jalisco | 2024 | 2029 | 24.04 |
Iron Irwini | 2023 | 2024 | 22.04 |
Humble Hawksbill | 2022 | 2027 | 22.04 |
Galactic Geochelone | 2021 | 2022 | 20.04 |
Foxy Fitzroy | 2020 | 2023 | 20.04 |
We will follow the official Humble tutorial, focusing only on the most relevant parts.
ROS uses a set of utilities that may differ from the ones installed on your machine or the ones used by other ROS distro. To avoid conflicts, you need to source the version of ROS you want to use.
# Every time you open the terminal
source /opt/ros/humble/setup.bash
Alternatively, put the same comment in the ~/.bashrc
file
# One time
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
To make sure everything is set up properly, run the turtle_sim
node
ros2 run turtlesim turtlesim_node
Opening another terminal, run the controller node
ros2 run turtlesim turtle_teleop_key
Play around with the turtle and try to draw a rectangle.
Leaving the nodes running, open another terminal to gather some information.
ros2 node list
ros2 topic list
ros2 service list
ros2 action list
If a GUI is available, a complete overview can be achieved with
# ROS network
rqt_graph
# Log messages
ros2 run rqt_console rqt_console
What makes ROS extensible is the ability to create packages.
Packages can then be shared between other users, avoiding the need to reinvent the wheel every time.
workspace_folder/
└── src/
├── cpp_package_1/
│ ├── CMakeLists.txt
│ ├── include/cpp_package_1/
│ ├── package.xml
│ └── src/
├── py_package_1/
│ ├── package.xml
│ ├── resource/py_package_1
│ ├── setup.cfg
│ ├── setup.py
│ └── py_package_1/
├── ...
└── cpp_package_n/
├── CMakeLists.txt
├── include/cpp_package_n/
├── package.xml
└── src/
This is a Capture the Flag (CTF) challenge, borrowed from cybersecurity competitions.
Each challenge hides a flag somewhere. Complete the challenge and claim the flag for your team.
The first team to submit the most flags wins the challenge.
The first challenges are the simplest. Use this information to your advantage.
The challenge 1 node keeps spamming its topic with the flag you are looking for.
Find the right topic and read the flag.
ros2 run nrai-ctf challenge1
The challenge 2 node has some math questions for you.
Answer correctly to all of them and it might give you the flag.
ros2 run nrai-ctf challenge2
The challenge 3 node just wants to play table tennis.
Reply to its services correctly 10 times in a row to obtain the flag.
The node will wait for your PONG
on the /challenge_3_pong
topic to start sending messages.
Server | Correct reply |
---|---|
PING | PONG |
PONG | PING |
ros2 run nrai-ctf challenge3
The challenge 4 node is very polite.
Ask for the flag with a service and you will get it.
ros2 run nrai-ctf challenge4
There is no time to waste!
The challenge 5 node will wait for a 0 Int32
message on /challenge_5_answer
.
After that, it will start sending Vector3
messages on /challenge_5_question
.
# Vector3 message on the `/challenge_5_question` topic
x: 4.0 # Counter of the current question
y: 10.0 # First addend
z: 29.0 # Second addend
# Expected result: 39
Sum the two addends and return the result back on /challenge_5_answer
.
After 100 correct and fast answers, you will get your flag on /challenge_5_topic
.
ros2 run nrai-ctf challenge5