Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/create_interface_package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ The message file

.. note::

Here is a list of available `built-in types <https://docs.ros.org/en/humble/Concepts/About-ROS-Interfaces.html#field-types>`_ for ROS2 interfaces.
Here is a list of available `built-in types <https://docs.ros.org/en/jazzy/Concepts/Basic/About-Interfaces.html#field-types>`_ for ROS2 interfaces.

Let us create a message file to transfer inspirational quotes between Nodes. For example, the one below.

Expand Down
26 changes: 0 additions & 26 deletions docs/source/docker/troubleshooting.rst

This file was deleted.

1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ If you enjoyed this tutorial, please
gazebo/usage
gazebo/ros_gz_bridge
gazebo/custom_nodes
gazebo/other_content

.. toctree::
:caption: Navigation
Expand Down
2 changes: 1 addition & 1 deletion docs/source/interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ROS2 Interfaces (:program:`ros2 interface`)

If by now you haven't particularly fallen in love with :program:`ROS2`, fear not. Indeed, we haven't done much so far that couldn't be achieved more easily by other means.

:program:`ROS2` begins to shine most in its interprocess communication, through what are called `ROS2 interfaces <https://docs.ros.org/en/humble/Concepts/About-ROS-Interfaces.html>`_.
:program:`ROS2` begins to shine most in its interprocess communication, through what are called `ROS2 interfaces <https://docs.ros.org/en/jazzy/Concepts/Basic/About-Interfaces.html>`_.
In particular, the fact that we can easily interface Nodes written in Python and C++ is a strong selling point.

:code:`Messages` are one of the three types of ROS2 interfaces. This will most likely be the standard of communication between Nodes in your packages. We will also see the bidirectional :code:`Services` and :code:`Actions`.
Expand Down
8 changes: 4 additions & 4 deletions docs/source/parameters_and_launch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Parameters and launch files: creating configurable Nodes

The Nodes we have made in the past few sections are interesting because they take advantage of the interprocess communication provided by ROS2.

Other capabilities of ROS2 that we must take advantage of are `ROS2 parameters <https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Parameters/Understanding-ROS2-Parameters.html>`_ and `ROS2 launch files <https://docs.ros.org/en/humble/Tutorials/Intermediate/Launch/Launch-Main.html>`_. We can use them to modify the behavior of Nodes without having to modify their source code.
Other capabilities of ROS2 that we must take advantage of are `ROS2 parameters <https://docs.ros.org/en/jazzy/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Parameters/Understanding-ROS2-Parameters.html>`_ and `ROS2 launch files <https://docs.ros.org/en/jazzy/Tutorials/Intermediate/Launch/Creating-Launch-Files.html>`_. We can use them to modify the behavior of Nodes without having to modify their source code.

For Python users, that might sound less appealing than for users of compiled languages. However, users of your package might not want nor be able to modify the source code directly, if the package is installable or part of a larger system with multiple users.

Expand Down Expand Up @@ -74,7 +74,7 @@ Don't forget to declare the parameter!

.. note::

According to the `official documentation <https://docs.ros.org/en/humble/Concepts/Basic/About-Parameters.html>`_, it is possible to work with undeclared parameters, but
According to the `official documentation <https://docs.ros.org/en/jazzy/Concepts/Basic/About-Parameters.html>`_, it is possible to work with undeclared parameters, but
I recommend against this for basic usage.

It's easy to forget it, but :code:`Node.get_parameter()` will not work if the parameter was not first declared with :code:`Node.declare_parameter()`. Don't forget it!
Expand All @@ -101,7 +101,7 @@ Continuously-obtained parameters

.. note::

According to the `official documentation <https://docs.ros.org/en/humble/Concepts/Basic/About-Parameters.html>`_, it is possible to assign
According to the `official documentation <https://docs.ros.org/en/jazzy/Concepts/Basic/About-Parameters.html>`_, it is possible to assign
callbacks to manage changes in parameters. It is not the best-documented feature and has some caveats, so we will skip that for now.

For parameters that we obtain continuously through the lifetime of the Node, we can, for example, declare them in the :code:`__init__` method, like so
Expand Down Expand Up @@ -133,7 +133,7 @@ Truly configurable: using :file:`_launch.py` files
However, my experience with these so far has been quite positive, because when using Python we have access to an entire ecosystem of tools to make the launch files
smarter, whereas with the :abbr:`XML (Extensible Markup Language)`\ -based ones, if possible at all, we had to add hack on top of hack to achieve the same.

Differently from ROS1, in ROS2 we can use Python launch files. They are quite powerful, well documented, and mentioned first `in the official documentation <https://docs.ros.org/en/humble/Tutorials/Intermediate/Launch/Creating-Launch-Files.html>`_, so we will use them instead of :abbr:`XML (Extensible Markup Language)` or :abbr:`YAML (YAML ain't markup language)` files.
Differently from ROS1, in ROS2 we can use Python launch files. They are quite powerful, well documented, and mentioned first `in the official documentation <https://docs.ros.org/en/jazzy/Tutorials/Intermediate/Launch/Creating-Launch-Files.html>`_, so we will use them instead of :abbr:`XML (Extensible Markup Language)` or :abbr:`YAML (YAML ain't markup language)` files.

(Once) create the :file:`launch` folder
---------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/publishers_and_subscribers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Then
- A program that sends (publishes) information to the topic has one or more :code:`Publisher` \(s).
- A program that reads (subscribes) information from a topic has one or more :code:`Subscriber` \(s).

Each Node can have any number of :code:`Publishers` and :code:`Subscribers` and a combination thereof, connecting to an arbitrary number of Nodes. This forms part of the connections in the so-called `ROS graph <https://docs.ros.org/en/humble/Concepts.html#quick-overview-of-ros-2-concepts>`_. An example is shown below.
Each Node can have any number of :code:`Publishers` and :code:`Subscribers` and a combination thereof, connecting to an arbitrary number of Nodes. This forms part of the connections in the so-called `ROS graph <https://docs.ros.org/en/jazzy/Concepts/Basic.html>`_. An example is shown below.

Diagram
-------
Expand Down Expand Up @@ -165,7 +165,7 @@ The publisher must be created with the :code:`Node.create_publisher(...)` method
|:code:`topic` | The topic through which the communication will occur. Can be arbitrarily chosen, but to make sense :code:`/amazing_quote`. |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:code:`qos_profile` | The simplest interpretation for this parameter is the maximum number of messages that will be stored in a buffer if your node (including :code:`spin(...)`) takes too long to process them. |
| | (See more on `docs for QoSProfile <https://docs.ros.org/en/humble/Concepts/About-Quality-of-Service-Settings.html>`_.) |
| | (See more on `docs for QoSProfile <https://docs.ros.org/en/jazzy/Concepts/Intermediate/About-Quality-of-Service-Settings.html>`_.) |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

.. warning::
Expand Down
4 changes: 2 additions & 2 deletions docs/source/python_node_explained.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Use a :code:`Timer` for periodic work (when using :code:`rclpy.spin()`)

If the code relies on :code:`rclpy.spin()`, a Timer must be used for periodic work.

In its most basic usage, periodic tasks in ROS2 must be handled by a `Timer <https://github.com/ros2/rclpy/blob/humble/rclpy/src/rclpy/timer.hpp>`_.
In its most basic usage, periodic tasks in ROS2 must be handled by a `Timer <https://github.com/ros2/rclpy/blob/jazzy/rclpy/src/rclpy/timer.hpp>`_.

To do so, have the node create it with the :code:`create_timer()` method, as follows.

Expand All @@ -60,7 +60,7 @@ In ROS2, the logging methods, i.e. :code:`self.get_logger().info()`, are methods
Where the ROS2 magic happens: :code:`rclpy.init()` and :code:`rclpy.spin()`
----------------------------------------------------------------------------

All the ROS2 magic happens in some sort of :code:`spin()` method. It is called this way because the :code:`spin()` method will constantly loop (or spin) through **items of work**, e.g. scheduled Timer callbacks. All the **items of work** will only be effectively executed when an **executor** runs through it. For simple Nodes, such as the one in this example, the **global** executor is implicitly used. You can read a bit more about that `here <https://docs.ros2.org/foxy/api/rclpy/api/init_shutdown.html>`_.
All the ROS2 magic happens in some sort of :code:`spin()` method. It is called this way because the :code:`spin()` method will constantly loop (or spin) through **items of work**, e.g. scheduled Timer callbacks. All the **items of work** will only be effectively executed when an **executor** runs through it. For simple Nodes, such as the one in this example, the **global** executor is implicitly used. You can read a bit more about that `here <https://docs.ros.org/en/jazzy/p/rclpy/api/execution_and_callbacks.html>`_.

Anyhow, the point is that nothing related to ROS2 will happen unless the two following methods are called. First, :code:`rclpy.init()` is going to initialize a bunch of ROS2 elements behind the curtains, whereas :code:`rclpy.spin()` will `block <https://en.wikipedia.org/wiki/Blocking_(computing)>`_ the program and, well, **spin** through Timer callbacks forever. There are alternative ways to :code:`spin()`, but we will not discuss them right now.

Expand Down
4 changes: 0 additions & 4 deletions docs/source/the_pycharm_dependencies_warning.rst

This file was deleted.

3 changes: 0 additions & 3 deletions docs/source/the_section_is_optional.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/transformations/tf2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ previous step. We will call ``lookup_transform`` and it will need the parent fra
and the time of lookup. We add exception handling in case the transform is not available or not available
in the time requested.

The object created with ``rclpy.time.Time()`` is `equivalent to a time of zero <https://github.com/ros2/rclpy/blob/938f4968bc742a77169e5d73d46619db34dbcc50/rclpy/rclpy/time.py#L43>`_, and ``lookup_transform`` `returns the latest transformation available <https://docs.ros2.org/foxy/api/tf2_ros/classtf2__ros_1_1Buffer.html#a3ab502cc1e8b608957a96ad350815aee>`_.
The object created with ``rclpy.time.Time()`` is `equivalent to a time of zero <https://github.com/ros2/rclpy/blob/938f4968bc742a77169e5d73d46619db34dbcc50/rclpy/rclpy/time.py#L43>`_, and ``lookup_transform`` `returns the latest transformation available <https://docs.ros.org/en/jazzy/p/tf2_ros/generated/classtf2__ros_1_1Buffer.html>`_.

.. literalinclude:: ../../../ros2_tutorial_workspace/src/python_package_that_uses_tf2/python_package_that_uses_tf2/tf2_listener_node.py
:language: python
Expand Down
Loading