"ROS 2 from Scratch" by Edouard Renard is a practical guide to mastering the Robot Operating System 2 (ROS 2). This book eschews abstract theory, offering a hands-on approach to building robotics applications using Python and C++. Beginners will learn fundamental ROS 2 concepts like nodes, topics, services, and actions, progressing to more advanced topics such as TFs, URDF, RViz, and Gazebo simulation. Through step-by-step instructions and real-world examples, readers will create a custom robot and develop scalable applications. Whether you're a student, hobbyist, or engineer, this book provides the essential skills to confidently navigate the world of ROS 2 and create your own robotic projects.
4.7 / 4 ratings
Review ROS 2 from Scratch
"ROS 2 from Scratch" by Edouard Renard completely exceeded my expectations. As someone who's dabbled in robotics but felt intimidated by ROS, this book was a lifeline. I appreciated the incredibly friendly and approachable tone throughout. It felt like a patient tutor guiding me, not a condescending expert lecturing me. The author clearly understands the challenges beginners face and addresses them head-on. There's no fluff, no unnecessary jargon, just clear, concise explanations paired with practical, hands-on exercises.
What truly sets this book apart is its emphasis on applied learning. Instead of getting bogged down in abstract theory, Renard dives straight into building projects. The step-by-step approach is masterful; each concept is carefully introduced, explained with relatable analogies, and then immediately reinforced through practical examples in both Python and C++. This iterative learning process made the often complex concepts of ROS 2 surprisingly digestible. I found myself confidently tackling nodes, topics, services, and actions, things that had previously seemed hopelessly arcane.
The book's structure is also impeccable. It starts with a clear introduction to ROS 2, explaining its purpose and benefits without overwhelming the reader. It then methodically builds upon foundational concepts, smoothly transitioning into more advanced topics like TFs, URDF, RViz, and Gazebo. Each chapter is well-organized and easy to navigate, making it simple to refer back to specific sections as needed. I especially appreciated the inclusion of numerous diagrams and illustrations, which greatly enhanced my understanding of the underlying mechanisms.
The inclusion of a complete project that incorporates all the learned concepts was invaluable. Building a custom robot in simulation, from creating the URDF model to controlling it in Gazebo, solidified my understanding in a way that simply reading wouldn't have achieved. It provided a tangible demonstration of how all the different parts of ROS 2 work together to create a functional robotic system.
I also want to highlight the quality of the explanations. The analogies used are clever and effective, bridging the gap between complex technical ideas and everyday understanding. The author’s experience as both an engineer and educator shines through in the meticulous attention to detail and the clear articulation of often-confusing concepts.
I initially approached ROS 2 with apprehension, fearing its complexity. However, thanks to Renard's masterful teaching, I now feel confident in my ability to create and develop my own ROS 2 applications. This isn't just a book; it's a comprehensive guide that empowers you to confidently navigate the world of robotics. If you're a beginner looking for a clear, concise, and engaging introduction to ROS 2, look no further – this is the book for you. Highly recommended!
Information
Dimensions: 0.84 x 7.5 x 9.25 inches
Language: English
Print length: 380
Publication date: 2024
Publisher: Packt Publishing
Book table of contents
Preface
Part 1: Getting Started with ROS 2
Introduction to ROS 2 - What Is ROS 2?
Installing and Setting Up ROS 2
Which ROS 2 distribulion lo choose
What is ROS?
When to use ROS
ROS versus ROS 2
Why ROS?
LTS and non-ITS distributions
How to use ROS distribution
Installing the OS (Ubuntu)
The relationship between ROS and Ubunlu
Installing Ubuntu 24,04 nalively
Installing Ubuntu 24O4on a VM
Installing ROS 2 on Ubuntu
Uncovering ROS 2 Core Concepts
Running your first node
Introspecting the nodes with rqt_graph
Running 2D robot simulation
Topics
Running topic publisher and subscriber
More experimentation with topics
Services
Running service server and client
More experimentation with services
Part 2: Developing with ROS 2 - Python and C++
Writing and Building ROS 2 Node
Technical requirements
Creating and setting ROS 2 package
Creating workspace
Sourcing the workspace
Creating package
Writing a Python node
Running the node
Improving the node and callback
Creating a C++ node
Inspecting your nodes
Writing a C++ node
Building and running the node
Changing the node name
Summary
Topics
Sending and Receiving Messages between Nodes
What is ROS 2 topic?
Introspecting topics with rqt_graph
publisher and subscriber
'Ihe ros2 topic command line
Multiple publishers and subscribers
Changing topic name al runtime
Multiple publishers and subscribers inside node
Replaying topic dala wỉth bugs
Creating custom interface
Wrapping things for topic
Writing topic publisher
Using existing interfaces
Writing topic publisher
Creating neW topicinterface
Writing C++ publisher
Topic challenge closed loop
Writing topic subscriber
control
Writing Python subscriber
Challenge
Writing C++ subscriber
Solution
Running the Python and C++ nodes together
Summary
Additional tools to handle topics
Services
ClientIServer Interaction between Nodes
Whal is a ROS service?
Creating cuslom scrvice inlerlace
server and client
Finding existing intertace tor our service
Multiple clients for Url service
Creating neW service interface
Another service example with robolics
Writing service server
Wrapping things
Python service
C++ service server
introspecling services
Python service client
Service challenge
Running the client and server nodes
Challenge
Ctt service client
Solution
Additional tools to handle services
Sunmary
Actions
When Services Are Not Enough
What isa ROS 2 action?
Writing
Python action client
Why aclions?
Creating an action client
How do actions work?
Writing
Ct+ action client
Wrapping
advantage of
Creating
custom action interface
all the action mechanisms
Defining the application and
Adding the feedback mechanism
the intertace we need
Adding the cance
mechanism
Creating
action interlace
Additional tools to handle actions
an action server
Lisling and introspecling actions
Writing
Python action server
Sending
from the Terminal
Writing
Ctt action server
Topics and services inside actions
Writing
an aclion client
Sunmary
Parameters
Making Nodes More Dynamic
What is a ROS 2 parameter?
Providing parameters at runtime
Why parameters?
Paramcters with C++
Erample of
node
with parameters
Storing parameters in YAML files
ROS
parameters
wrapping
Loading parameters
YAML file
parameters in your nodes
Parameters for multiple nodes
Declarings gelling, and
paramcters
Recapping all parameters data types
with Python
Copyrighted Material
Table of Contents
Additional tools for handling parameters
Updating parameters with parameter callbacks
Getting parameters' values trom the terminal
Exporting parameters into YAML
Sctting Parameters value from the termninal
Parameter services
Parameter challenge
Summary
Launch Files
Starting All Your Nodes at Once
What is ROS 2 launch file?
XML versus Python for launch files
Why launch files?
Configuring nodes inside launch file
Fxample ofa launch file with seven nodes
Creating and installing an XML launch file
Renaming nodes and communications
Parameters in launch file
Setting up package for launch files
Namespaces
Writing XML launch file
Launch file challenge
Installing and starting launch file
Creating Python launch file
or Python for launch files?
Summary
Writing Python launch file
Part 3: Creating and Simulating a Custom Robot with ROS 2
Discovering TFs with RViz
Technical requirements
What are TFs?
Visualizing robot model in RViz
Links
Installation and setup TFs
Starting RViz with robol model
Relationship between [Fs
Copyrighted Material
Table of Contents
Creating URDF for a Robot
Creating URDF with link
Writing URDF for a mobile robot
Setting URDF file
Creating link
Customizing the link visual
Adding the casler wheel
The process of assembling links and
joints
Improving the URDF with Xacro
Ster adding seconda link
Ster adding joint
Ster the joint origin
Xacro macros
setting up the joint type
Including Xacro tile in another file
Step the visuul origin
Summary
Recap the process lo lollow every lime
Publishing TFs and Packaging the URDF
Understanding how lo publish TFs
Creating package t0 install with our URDF
the URDF
Ihe robot_state publisher node
Adding nel workspace
Inputs for the robot_stale_publisher
Creating description package
Recap how to publish TFs
Installing the URDF and other files
Starting all nodes from the terminal
Writing launch file to publish TFs and visualize the robot