So, you’ve decided to learn ROS2. Great!
And now, you wonder where to start.
That’s quite normal to feel lost at the beginning. ROS is not an easy subject. It’s big and diverse, and you won’t become an expert in 2 days.
In this post I’ll give you some tips about what you should focus on to gain practical knowledge quickly.
I won’t detail everything, but instead give you some guidelines you can follow, and which will help you during your learning journey.
What is ROS2? (very quickly)
The first confusion comes here: ROS means Robot Operating System, but… it’s not an operating system.
You may have heard words such as “middleware” or “framework”. Well, yes it’s something like that. It provides a framework that developers (you) can follow to write scalable, distributed robotics applications, without reinventing the wheel.
ROS2 is the successor of ROS1. It’s a completely new version of ROS, but using the same core concepts.
Explaining what is ROS exactly would be quite long and complicated. Instead, let’s see what you get from ROS. As you make progress, every day you’ll gain more understanding of what is ROS.
ROS mainly brings you 4 things:
- A framework to help you create a distributed application, with communication between the subparts (nodes) of your application.
- Tools to help you develop your robot faster: logging, 3D visualization, graphs, plotting, etc.
- 3rd party plugins containing complete functionalities, that you can easily plug to your application.
- An online community focused on open source robotics projects.
Why should you learn ROS2?
Well, ROS2 can help you in many ways:
- This will help you write more robust, modular, and scalable robotics applications.
- You don’t need to reinvent the tooling and plumbing. Just focus on the core of your application, ROS2 takes care of the rest.
- When you know how to develop with ROS, you can easily switch between projects in no time. You worked on a mobile base, and now you’re writing a software for a drone? Well, no problem, you can use the same foundation for both robots.
- ROS2 will speed up development time for your robotics projects, especially during prototyping and testing phases.
- ROS2 will help you get a foot into the robotics world. You can experiment with many existing robots (in real world or simulation).
- More and more companies hire ROS developers. This is a good opportunity for you!
I’ll stop the list here, but there’s definitely more to it!
Prerequisites to learn ROS2
In order to learn ROS2 you need to have some existing knowledge in computer science and programming.
No need to be an expert, but if you know nothing about programming you’ll be lost.
First you need to know how to use a terminal and command line tools. It’s better if you have already used an Unix OS such as Ubuntu.
Then you need some programming basics. The main 2 languages for ROS2 are Python and Cpp.
You can totally start with only one language and build a ROS2 project. But in the end it will be better to know both Cpp and Python, as both will be required to create a complete and efficient application.
If you only know Python, no problem: just start with it, learn ROS2, and later on you can learn Cpp and see how to use it with ROS2.
If you know Cpp (intermediate level), I assume you can handle Python, at least the basics.
All in all, nothing replaces a strong programming foundation, no matter which language you use. This is maybe the best investment you can make on yourself before you learn ROS2.
Start with the basics and ROS2 core functionalities
The first thing you’ll need to do is to install ROS2 and set up the environment.
Then, to me, the best way to start is to go hand in hand with:
- Experimenting with existing ROS2 projects and seeing how they work to understand the concepts.
- Starting to write your own code to understand how to apply the concepts in your own application.
Here are the main concepts and tools you’ll need to learn:
- Launch files
And while you learn that, you’ll also learn how to:
- Build your nodes.
- Execute them.
- Use command line tools.
- Debug with plugins, such as rqt_graph.
For your first practice exercises, there is an overly simplified robotics project you can use: ROS2 Turtlesim. This is just a 2D simulation of a mobile robot (with a turtle’s shape), and it’s perfect to learn basic concepts.
Explore intermediate subjects and tools
Once you’re confident with the ROS2 core, you have a good foundation that you can use in any ROS2 project. With this knowledge you can already write a complete application.
Now, let’s go further.
First, you can continue working on more advanced core ROS2 functionalities:
- Lifecycled nodes
- Running different nodes on multiple machines
- 3D visualization tools such as Rviz, Gazebo
There is no particular order, and the complete list is much, much longer. From here what you learn mostly depends on the situation and your projects.
If you want/need to progress on SLAM for mobile robots, or on robotic arm manipulation, or even on integrating a camera in a drone, well, that will require a different learning path. You can’t learn everything, you’ll have to choose what knowledge you need first.
One great thing with ROS: you can start using real robots without actually having to buy the hardware. For example, you can run a complete simulated environment with the TurtleBot3 robot. This robot is a mobile base capable of SLAM and navigation. For any common robotics application you can find an existing open source project with ROS.
Create your own ROS2 Project
Only one way you can truly improve in ROS after having an intermediate level: create your own ROS2 project.
This may be for a complete new custom robot, or you could work on improving an existing package. You could wrap a non-ROS code base in order to connect a robot to the ROS ecosystem. Possibilities are endless.
But one thing is certain: working on a project is one of the best ways to learn more.
Share with the ROS2 community
ROS2 is open source, and one of its main strengths is the community behind it.
Don’t hesitate to read other people’s code. You’ll find many ROS2 packages available on GitHub. Whether they have a permissive license or not, nothing prevents you from reading the code to learn more. That’s a great way to improve.
Also, don’t hesitate to share your own work, on GitHub, forums, etc. You may get invaluable feedback on your code, and see if what you tried to do could be interesting for other people as well.
ROS2 online course – learn ROS2 step by step
One problem many people have when learning ROS2 is that there is no clear path. So you have to find that path by yourself, and this takes time.
You’ll need to spend many hours experimenting, searching for documentation on the Internet. Which is great if you have plenty of time and want to go the hard way, learning all by yourself.
But what if you don’t have a lot of time or if you prefer to be guided while learning?
Well, I have created an online course to learn ROS2, with this in mind: teaching you the most important things, step by step, and always with a practical view. This will help you get started much quicker without the pain of always searching what you should learn next.
Learn ROS2: time for you to start
Learning ROS2 will be quite a journey, but a journey that is worth the time investment.
What you’ve seen in this post is what you need to know in order to call yourself a ROS developer. Start with the fundamentals, experiment on other ROS robots, and then continue your learning depending on what project you’re working on.
Now it’s time for you to take action. No matter how you want to learn: all by yourself, with books, online courses, workshops, and so on, the important thing is that you make some real progress.
Well, time for me to wish you a happy ROS2 learning!