(Murilo’s) ROS2 Tutorial#
Note
If you’re looking for the official documentation, this is NOT it. For the official ROS documentation, refer to this link.
Hint
You can download this tutorial as a PDF 📀.
🧑⚖️ License
This tutorial is licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International.
The example code have their own License headers, usually MIT Licensed.
Attention
AI training with this content must follow the license restrictions. In particular, please refer to the excerpt below.
If AI training data includes the NonCommercial restriction, then following the NC restriction would require that all stages, from copying the data during training to sharing the trained model, must not be for commercial gain.
Following the NoDerivatives restriction would require that ND-licensed content not be used as training data.
📖 About this tutorial
ROS2 Jazzy tutorials by Murilo M. Marinho, focusing on Ubuntu 24.04 x64 LTS and the programming practices of successful state-of-the-art robotics implementations such as the SmartArmStack also used in the AISciencePlatform.
These tutorials have been the backbone of EEEN62021 Software for Robotics, one of the units of the MSc Robotics at the University of Manchester.
🤟 Using this tutorial
This is a tutorial that supposes that the user will follow it linearly. Some readers can skip the Preamble if they are somewhat already comfortable in Python and Ubuntu. Otherwise, all steps can be considered as dependent on the prior ones, starting from ROS2 Setup.
It is expected that the user will be working directly on an Ubuntu machine. Docker images are available but no compatibility with host systems other than Ubuntu have been attempted.
❤️ Ways to show love
If you enjoyed this tutorial, please
⭐ star the repository or,
contribute with feedback to the issue tracker.
🔍 Quick overview
- Preamble: Ubuntu and Python
A few tips on Ubuntu terminal and checking your Python installation.
- Preamble: Python Best Practices
A quick memory refresher for the Python stuff useful in ROS2.
- ROS2 Setup (⭐start here⭐)
Installing ROS2 and setting up its environment for use.
- ROS2 Python Package/Build
Creating our first ROS2 package with ament_python and building it with colcon.
- ROS2 Python Node
Creating
rclpyNodes and figuring out what all that means.
- ROS2 Python Library
Create Python librarys and importing/using it in another ament_python package.
- ROS2 Interfaces
ROS2 interfaces, i.e., messages
.msg, services.srv, and actions.action. Creating custom interface packages with ament_cmake.
- ROS2 Messages in Python
Writing and using ROS2 messages, publishers, and subscribers.
- ROS2 Parameter/Launch
Making configurable ROS2 Nodes using parameters and launch files.
- ROS2 Services in Python
Writing ROS2 services, service servers, and service clients.
- ROS2 Actions in Python
Writing ROS2 actions, action servers, and action clients.
- Frame Transformations
Frame transformations, the
TransformStampedmessage, andtf2.
- Gazebo and ROS2
Gazebo installation, basic usage, and integration examples with ROS2.
- nav2
nav2installation, basic usage, and integration examples with custom ROS2 nodes.
- Cybersecurity
Cybersecurity, networking, and public-key cryptography in a context of robotic systems.
Disclaimers#
By reading and/or using this tutorial in total or in part, you agree to these terms.
ANYTHING ON THIS TUTORIAL–EVEN THINGS THAT ACTUALLY WORK–IS ENTIRELY FICTIONAL. SOME MEMES ARE ATTEMPTED….POORLY. THE TUTORIAL CONTAINS MISPLACED MOVIE REFERENCES AND DUE TO ITS LOW-HANGING FRUIT HUMOUR, IT SHOULD NOT BE READ BY ANYONE.
Disclaimer
All advice, comments, and terrible memes in this tutorial are my own and not endorsed by anyone or anything else mentioned herein. It’s not even endorsed by me.
Disclaimer
THIS TUTORIAL AND RELATED SOFTWARE ARE PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND/OR TUTORIAL, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Changelog#
2025/08-2025/12#
Updated to ROS2 Jazzy.
Updated theme to
sphinx_book_theme.Moved ROS2 parameter and launch to before the services.
Added a section about ROS2 Actions.
Added a section mostly about
tf2.Added a section mostly about Gazebo.
Added a section about
nav2.Added a section about cybersecurity.