From 7533edaeef7f1ea95d5a6584f0e3f395ddccbd34 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Tue, 7 May 2024 13:09:15 -0400 Subject: [PATCH] Remove Tf2 time tutorials for Python (#4384) * Small update for language in tf2 static transforms. * Small language fixups in tf2 broadcaster tutorials. * Small language updates in Writing a tf2 listener. * Small clarification in Add-a-frame tutorials. * Small updates to the Learning-about-tf2-and-time-cpp tutorial. * Remove the python tf2 tutorials. They have not worked for a very long time, and in point of fact with the current tf2_py code, they cannot work. Remove them until the time we actually fix the tf2_py code, at which point we can reintroduce them. Signed-off-by: Chris Lalancette (cherry picked from commit cb0e0be2d87b69e1acea0db2960ef4753a4290d9) --- source/Concepts/Intermediate/About-Tf2.rst | 4 +- .../Intermediate/Tf2/Adding-A-Frame-Cpp.rst | 4 +- .../Intermediate/Tf2/Adding-A-Frame-Py.rst | 5 +- .../Tf2/Learning-About-Tf2-And-Time-Cpp.rst | 20 +-- .../Tf2/Learning-About-Tf2-And-Time-Py.rst | 100 -------------- .../Tutorials/Intermediate/Tf2/Tf2-Main.rst | 6 +- .../Tf2/Time-Travel-With-Tf2-Py.rst | 122 ------------------ .../Tf2/Writing-A-Tf2-Broadcaster-Cpp.rst | 1 + .../Tf2/Writing-A-Tf2-Broadcaster-Py.rst | 2 +- .../Tf2/Writing-A-Tf2-Listener-Cpp.rst | 2 +- .../Tf2/Writing-A-Tf2-Listener-Py.rst | 2 +- .../Writing-A-Tf2-Static-Broadcaster-Cpp.rst | 6 +- .../Writing-A-Tf2-Static-Broadcaster-Py.rst | 6 +- 13 files changed, 28 insertions(+), 252 deletions(-) delete mode 100644 source/Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Py.rst delete mode 100644 source/Tutorials/Intermediate/Tf2/Time-Travel-With-Tf2-Py.rst diff --git a/source/Concepts/Intermediate/About-Tf2.rst b/source/Concepts/Intermediate/About-Tf2.rst index f43fceae6b4..a0506a79ba0 100644 --- a/source/Concepts/Intermediate/About-Tf2.rst +++ b/source/Concepts/Intermediate/About-Tf2.rst @@ -56,8 +56,8 @@ If you want to define static transforms in your tf2 tree, take a look at the "Wr You can also learn how to add fixed and dynamic frames to your tf2 tree in the "Adding a frame" :doc:`(Python) <../../Tutorials/Intermediate/Tf2/Adding-A-Frame-Py>` :doc:`(C++) <../../Tutorials/Intermediate/Tf2/Adding-A-Frame-Cpp>` tutorial. Once you are finished with the basic tutorials, you can move on to learn about tf2 and time. -The tf2 and time tutorial :doc:`(Python) <../../Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Py>` :doc:`(C++) <../../Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Cpp>` teaches the basic principles of tf2 and time. -The advanced tutorial about tf2 and time :doc:`(Python) <../../Tutorials/Intermediate/Tf2/Time-Travel-With-Tf2-Py>` :doc:`(C++) <../../Tutorials/Intermediate/Tf2/Time-Travel-With-Tf2-Cpp>` teaches the principles of time traveling with tf2. +The tf2 and time tutorial :doc:`(C++) <../../Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Cpp>` teaches the basic principles of tf2 and time. +The advanced tutorial about tf2 and time :doc:`(C++) <../../Tutorials/Intermediate/Tf2/Time-Travel-With-Tf2-Cpp>` teaches the principles of time traveling with tf2. Paper ----- diff --git a/source/Tutorials/Intermediate/Tf2/Adding-A-Frame-Cpp.rst b/source/Tutorials/Intermediate/Tf2/Adding-A-Frame-Cpp.rst index 27d4107689c..40c4e30f642 100644 --- a/source/Tutorials/Intermediate/Tf2/Adding-A-Frame-Cpp.rst +++ b/source/Tutorials/Intermediate/Tf2/Adding-A-Frame-Cpp.rst @@ -182,7 +182,7 @@ Finally, add the ``install(TARGETS…)`` section so ``ros2 run`` can find your e ~~~~~~~~~~~~~~~~~~~~~~~~~ Now let's create a launch file for this example. -With your text editor, create a new file called ``launch/turtle_tf2_fixed_frame_demo_launch.py``, and add the following lines: +With your text editor, create a new file called ``turtle_tf2_fixed_frame_demo_launch.py`` in the ``src/learning_tf2_cpp/launch`` directory, and add the following lines: .. code-block:: python @@ -469,7 +469,7 @@ Finally, add the ``install(TARGETS…)`` section so ``ros2 run`` can find your e 2.3 Write the launch file ~~~~~~~~~~~~~~~~~~~~~~~~~ -To test this code, create a new launch file ``launch/turtle_tf2_dynamic_frame_demo_launch.py`` and paste the following code: +To test this code, create a new launch file ``turtle_tf2_dynamic_frame_demo_launch.py`` in the ``src/learning_tf2_cpp/launch`` directory and paste the following code: .. code-block:: python diff --git a/source/Tutorials/Intermediate/Tf2/Adding-A-Frame-Py.rst b/source/Tutorials/Intermediate/Tf2/Adding-A-Frame-Py.rst index 9e548be9e24..62bf3d10bb6 100644 --- a/source/Tutorials/Intermediate/Tf2/Adding-A-Frame-Py.rst +++ b/source/Tutorials/Intermediate/Tf2/Adding-A-Frame-Py.rst @@ -160,7 +160,7 @@ Add the following line between the ``'console_scripts':`` brackets: ~~~~~~~~~~~~~~~~~~~~~~~~~ Now let's create a launch file for this example. -With your text editor, create a new file called ``launch/turtle_tf2_fixed_frame_demo_launch.py``, and add the following lines: +With your text editor, create a new file called ``turtle_tf2_fixed_frame_demo_launch.py`` in the ``src/learning_tf2_py/launch`` directory, and add the following lines: .. code-block:: python @@ -204,7 +204,6 @@ The last part of the code will add our fixed ``carrot1`` frame to the turtlesim name='fixed_broadcaster', ), - 1.4 Build ~~~~~~~~~ @@ -427,7 +426,7 @@ Add the following line between the ``'console_scripts':`` brackets: 2.3 Write the launch file ~~~~~~~~~~~~~~~~~~~~~~~~~ -To test this code, create a new launch file ``launch/turtle_tf2_dynamic_frame_demo_launch.py`` and paste the following code: +To test this code, create a new launch file ``turtle_tf2_dynamic_frame_demo_launch.py`` in the ``src/learning_tf2_py/launch`` directory and paste the following code: .. code-block:: python diff --git a/source/Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Cpp.rst b/source/Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Cpp.rst index a45a7f86552..4dd97756429 100644 --- a/source/Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Cpp.rst +++ b/source/Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Cpp.rst @@ -21,7 +21,7 @@ Background ---------- In previous tutorials, we recreated the turtle demo by writing a :doc:`tf2 broadcaster ` and a :doc:`tf2 listener `. -We also learned how to :doc:`add a new frame to the transformation tree <./Adding-A-Frame-Cpp>` and learned how tf2 keeps track of a tree of coordinate frames. +We also learned how to :doc:`add a new frame to the transformation tree ` and learned how tf2 keeps track of a tree of coordinate frames. This tree changes over time, and tf2 stores a time snapshot for every transform (for up to 10 seconds by default). Until now we used the ``lookupTransform()`` function to get access to the latest available transforms in that tf2 tree, without knowing at what time that transform was recorded. This tutorial will teach you how to get a transform at a specific time. @@ -29,11 +29,11 @@ This tutorial will teach you how to get a transform at a specific time. Tasks ----- -1 tf2 and time -^^^^^^^^^^^^^^ +1 Update the listener node +^^^^^^^^^^^^^^^^^^^^^^^^^^ -So let's go back to where we ended in the :doc:`adding a frame tutorial <./Adding-A-Frame-Cpp>`. -Go to ``learning_tf2_cpp`` package. +Let's go back to where we ended in the :doc:`adding a frame tutorial `. +Go to the ``learning_tf2_cpp`` package. Open ``turtle_tf2_listener.cpp`` and take a look at the ``lookupTransform()`` call: .. code-block:: C++ @@ -76,7 +76,7 @@ You will notice that it fails and outputs something similar to this: .. code-block:: console - [INFO] [1629873136.345688064] [listener]: Could not transform turtle1 to turtle2: Lookup would + [INFO] [1629873136.345688064] [listener]: Could not transform turtle2 to turtle1: Lookup would require extrapolation into the future. Requested time 1629873136.345539 but the latest data is at time 1629873136.338804, when looking up transform from frame [turtle1] to frame [turtle2] @@ -87,8 +87,8 @@ Firstly, each listener has a buffer where it stores all the coordinate transform Secondly, when a broadcaster sends out a transform, it takes some time before that transform gets into the buffer (usually a couple of milliseconds). As a result, when you request a frame transform at time "now", you should wait a few milliseconds for that information to arrive. -2 Wait for transforms -^^^^^^^^^^^^^^^^^^^^^ +2 Fix the listener node +^^^^^^^^^^^^^^^^^^^^^^^ tf2 provides a nice tool that will wait until a transform becomes available. You use this by adding a timeout parameter to ``lookupTransform()``. @@ -108,8 +108,8 @@ To fix this, edit your code as shown below (add the last timeout parameter): The ``lookupTransform()`` can take four arguments, where the last one is an optional timeout. It will block for up to that duration waiting for it to timeout. -3 Checking the results -^^^^^^^^^^^^^^^^^^^^^^ +3 Check the results +^^^^^^^^^^^^^^^^^^^ You can now build the package and run the launch file. diff --git a/source/Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Py.rst b/source/Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Py.rst deleted file mode 100644 index 8704c250eb6..00000000000 --- a/source/Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Py.rst +++ /dev/null @@ -1,100 +0,0 @@ -.. redirect-from:: - - Tutorials/Tf2/Learning-About-Tf2-And-Time-Py - -.. _LearningAboutTf2AndTimePy: - -Using time (Python) -=================== - -**Goal:** Learn to use the ``timeout`` in ``lookup_transform`` function to wait for a transform to be available on the tf2 tree. - -**Tutorial level:** Intermediate - -**Time:** 10 minutes - -.. contents:: Contents - :depth: 2 - :local: - -Background ----------- - -In previous tutorials, we recreated the turtle demo by writing a :doc:`tf2 broadcaster <./Writing-A-Tf2-Broadcaster-Py>` and a :doc:`tf2 listener <./Writing-A-Tf2-Listener-Py>`. -We also learned how to :doc:`add a new frame to the transformation tree <./Adding-A-Frame-Py>`. -Now we will learn more about the ``timeout`` argument which makes the ``lookup_transform`` wait for the specified transform for up to the specified duration before throwing an exception. -This tool can be useful to listen for transforms that are published at varying rates or those incoming source with unreliable networking and non negligible latency. -This tutorial will teach you how use the timeout in ``lookup_transform`` function to wait for a transform to be available on the tf2 tree. - -Tasks ------ - -1 Update the listener node -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Edit ``turtle_tf2_listener.py`` and remove the ``timeout=Duration(seconds=1.0)`` parameter that is passed to the ``lookup_transform()`` call on line 76. -It should look like shown below: - -.. code-block:: python - - trans = self._tf_buffer.lookup_transform( - to_frame_rel, - from_frame_rel, - now) - -Moreover, import additional exceptions that we will handle in the beginning of the file: - -.. code-block:: python - - from tf2_ros import LookupException, ConnectivityException, ExtrapolationException - -Edit the exception handling on line 81 by adding newly imported exceptions and ``raise`` statement to see the exception: - -.. code-block:: python - - except (LookupException, ConnectivityException, ExtrapolationException): - self.get_logger().info('transform not ready') - raise - return - -If you now try to run the launch file, you will notice that it is failing: - -.. code-block:: console - - ros2 launch learning_tf2_py turtle_tf2_demo_launch.py - -2 Fix the listener node -^^^^^^^^^^^^^^^^^^^^^^^ - -You now should notice that ``lookup_transform()`` is failing. It tells you that the frame does not exist or that the data is in the future. -To fix this, edit your code on line 76 as shown below (return the ``timeout`` parameter): - -.. code-block:: python - - trans = self._tf_buffer.lookup_transform( - to_frame_rel, - from_frame_rel, - now, - timeout=rclpy.duration.Duration(seconds=1.0)) - -The ``lookup_transform`` can take four arguments, where the last one is an optional timeout. -It will block for up to that duration waiting for it to timeout. - -.. note:: - - Once this change is made, remove the ``raise`` line from the ``except()`` block that we added above or the code will continue to fail. - -You can now run the launch file. - -.. code-block:: console - - ros2 launch learning_tf2_py turtle_tf2_demo_launch.py - -You should notice that ``lookup_transform()`` will actually block until the transform between the two turtles becomes available (this will usually take a few milli-seconds). -Once the timeout has been reached (one second in this case), an exception will be raised only if the transform is still not available. - -Summary -------- - -In this tutorial you learned more about the ``lookup_transform`` function and its timeout features. -You also learned how to catch and handle additional exceptions that can be thrown by tf2. diff --git a/source/Tutorials/Intermediate/Tf2/Tf2-Main.rst b/source/Tutorials/Intermediate/Tf2/Tf2-Main.rst index 5571f400033..4d0099403dc 100644 --- a/source/Tutorials/Intermediate/Tf2/Tf2-Main.rst +++ b/source/Tutorials/Intermediate/Tf2/Tf2-Main.rst @@ -27,9 +27,7 @@ If you want to learn both C++ and Python, you should go through the tutorials on Writing-A-Tf2-Listener-Cpp Adding-A-Frame-Py Adding-A-Frame-Cpp - Learning-About-Tf2-And-Time-Py Learning-About-Tf2-And-Time-Cpp - Time-Travel-With-Tf2-Py Time-Travel-With-Tf2-Cpp Debugging-Tf2-Problems Quaternion-Fundamentals @@ -65,12 +63,12 @@ Learning tf2 This tutorial teaches you how to add an extra fixed frame to tf2. -#. Using time :doc:`(Python) ` :doc:`(C++) `. +#. Using time :doc:`(C++) `. This tutorial teaches you to use the timeout in ``lookup_transform`` function to wait for a transform to be available on the tf2 tree. -#. Traveling in time :doc:`(Python) <./Time-Travel-With-Tf2-Py>` :doc:`(C++) <./Time-Travel-With-Tf2-Cpp>`. +#. Traveling in time :doc:`(C++) <./Time-Travel-With-Tf2-Cpp>`. This tutorial teaches you about advanced time travel features of tf2. diff --git a/source/Tutorials/Intermediate/Tf2/Time-Travel-With-Tf2-Py.rst b/source/Tutorials/Intermediate/Tf2/Time-Travel-With-Tf2-Py.rst deleted file mode 100644 index 71ac258449d..00000000000 --- a/source/Tutorials/Intermediate/Tf2/Time-Travel-With-Tf2-Py.rst +++ /dev/null @@ -1,122 +0,0 @@ -.. redirect-from:: - - Tutorials/Tf2/Time-Travel-With-Tf2-Py - -.. _TimeTravelWithTf2Py: - -Traveling in time (Python) -========================== - -**Goal:** Learn about advanced time travel features of tf2. - -**Tutorial level:** Intermediate - -**Time:** 10 minutes - -.. contents:: Contents - :depth: 2 - :local: - -Background ----------- - -In the previous tutorial, we discussed the :doc:`basics of tf2 and time <./Learning-About-Tf2-And-Time-Py>`. -This tutorial will take us one step further and expose a powerful tf2 trick: the time travel. -In short, one of the key features of tf2 library is that it is able to transform data in time as well as in space. - -This tf2 time travel feature can be useful for various tasks, like monitoring the pose of the robot for a long period of time or building a follower robot that will follow the "steps" of the leader. -We will use that time travel feature to look up transforms back in time and program ``turtle2`` to follow 5 seconds behind ``carrot1``. - -Time travel ------------ - -First, let's go back to where we ended in the previous tutorial :doc:`Using time <./Learning-About-Tf2-And-Time-Py>`. -Go to your ``learning_tf2_py`` package. - -Now, instead of making the second turtle go to where the carrot is now, we will make the second turtle go to where the first carrot was 5 seconds ago. -Edit the ``lookup_transform()`` call in ``turtle_tf2_listener.py`` file to - -.. code-block:: python - - when = self.get_clock().now() - rclpy.time.Duration(seconds=5.0) - try: - t = self.tf_buffer.lookup_transform( - to_frame_rel, - from_frame_rel, - when, - timeout=rclpy.duration.Duration(seconds=0.05)) - except TransformException as ex: - -Now if you run this, during the first 5 seconds, the second turtle would not know where to go because we do not yet have a 5-second history of poses of the carrot. -But what happens after these 5 seconds? Build the package as usual then let's just give it a try: - -.. code-block:: console - - ros2 launch learning_tf2_py turtle_tf2_fixed_frame_demo_launch.py - -.. image:: images/turtlesim_delay1.png - -You should now notice that your turtle is driving around uncontrollably like in this screenshot. Let's try to understand reason behind that behavior. - -#. In our code we asked tf2 the following question: "What was the pose of ``carrot1`` 5 seconds ago, relative to ``turtle2`` 5 seconds ago?". This means we are controlling the second turtle based on where it was 5 seconds ago as well as where the first carrot was 5 seconds ago. - -#. However, what we really want to ask is: "What was the pose of ``carrot1`` 5 seconds ago, relative to the current position of the ``turtle2``?". - -Advanced API for lookup_transform() ------------------------------------ - -To ask the tf2 that particular question, we will use an advanced API that gives us the power to say explicitly when to acquire the specified transformations. -This is done by calling the ``lookup_transform_full()`` method with additional parameters. -Your code now would look like this: - -.. code-block:: python - - when = self.get_clock().now() - rclpy.time.Duration(seconds=5.0) - try: - t = self.tf_buffer.lookup_transform_full( - target_frame=to_frame_rel, - target_time=rclpy.time.Time(), - source_frame=from_frame_rel, - source_time=when, - fixed_frame='world', - timeout=rclpy.duration.Duration(seconds=0.05)) - except TransformException as ex: - -The advanced API for ``lookup_transform_full()`` takes six arguments: - -#. Target frame - -#. The time to transform to - -#. Source frame - -#. The time at which source frame will be evaluated - -#. Frame that does not change over time, in this case the ``world`` frame - -#. Time to wait for the target frame to become available - -To sum up, tf2 does the following in the background. -In the past, it computes the transform from the ``carrot1`` to the ``world``. -In the ``world`` frame, tf2 time travels from the past to now. -And at the current time, tf2 computes the transform from the ``world`` to the ``turtle2``. - -Checking the results --------------------- - -Build the package as usual then let's run the simulation again, this time with the advanced time-travel API: - -.. code-block:: console - - ros2 launch learning_tf2_py turtle_tf2_fixed_frame_demo_launch.py - -.. image:: images/turtlesim_delay2.png - -And yes, the second turtle is directed to where the first carrot was 5 seconds ago! - -Summary -------- - -In this tutorial, you have seen one of the advanced features of tf2. -You learned that tf2 can transform data in time and learned how to do that with turtlesim example. -tf2 allowed you to go back in time and make frame transformations between old and current poses of turtles by using the advanced ``lookup_transform_full()`` API. diff --git a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.rst b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.rst index 61def5c5a1c..327118da26d 100644 --- a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.rst +++ b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.rst @@ -244,6 +244,7 @@ Finally, add the ``install(TARGETS…)`` section so ``ros2 run`` can find your e ^^^^^^^^^^^^^^^^^^^^^^^ Now create a launch file for this demo. +Create a ``launch`` folder in the ``src/learning_tf2_cpp`` directory. With your text editor, create a new file called ``turtle_tf2_demo_launch.py`` in the ``launch`` folder, and add the following lines: .. code-block:: python diff --git a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Py.rst b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Py.rst index 8729858b7b3..4ea31bc5eea 100644 --- a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Py.rst +++ b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Py.rst @@ -251,7 +251,7 @@ Add the following line between the ``'console_scripts':`` brackets: ^^^^^^^^^^^^^^^^^^^^^^^ Now create a launch file for this demo. -Create a ``launch`` folder in the ``src/learning_tf2_py`` directory +Create a ``launch`` folder in the ``src/learning_tf2_py`` directory. With your text editor, create a new file called ``turtle_tf2_demo_launch.py`` in the ``launch`` folder, and add the following lines: .. code-block:: python diff --git a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Listener-Cpp.rst b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Listener-Cpp.rst index ab2db7b3f95..e8d8ec1a9f0 100644 --- a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Listener-Cpp.rst +++ b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Listener-Cpp.rst @@ -274,7 +274,7 @@ Finally, add the ``install(TARGETS…)`` section so ``ros2 run`` can find your e 2 Update the launch file ^^^^^^^^^^^^^^^^^^^^^^^^ -Open the launch file called ``turtle_tf2_demo_launch.py`` with your text editor, add two new nodes to the launch description, add a launch argument, and add the imports. +Open the launch file called ``turtle_tf2_demo_launch.py`` in the ``src/learning_tf2_cpp/launch`` directory with your text editor, add two new nodes to the launch description, add a launch argument, and add the imports. The resulting file should look like: .. code-block:: python diff --git a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Listener-Py.rst b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Listener-Py.rst index ed6ee2e281a..f5be8737fe3 100644 --- a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Listener-Py.rst +++ b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Listener-Py.rst @@ -228,7 +228,7 @@ Add the following line between the ``'console_scripts':`` brackets: 2 Update the launch file ^^^^^^^^^^^^^^^^^^^^^^^^ -Open the launch file called ``turtle_tf2_demo_launch.py`` with your text editor, add two new nodes to the launch description, add a launch argument, and add the imports. +Open the launch file called ``turtle_tf2_demo_launch.py`` in the ``src/learning_tf2_py/launch`` directory with your text editor, add two new nodes to the launch description, add a launch argument, and add the imports. The resulting file should look like: .. code-block:: python diff --git a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.rst b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.rst index ab152b5cff6..afcc20fd95b 100644 --- a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.rst +++ b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.rst @@ -394,14 +394,14 @@ This tutorial aimed to show how ``StaticTransformBroadcaster`` can be used to pu In your real development process you shouldn't have to write this code yourself and should use the dedicated ``tf2_ros`` tool to do so. ``tf2_ros`` provides an executable named ``static_transform_publisher`` that can be used either as a commandline tool or a node that you can add to your launchfiles. -Publish a static coordinate transform to tf2 using an x/y/z offset in meters and roll/pitch/yaw in radians. -In our case, roll/pitch/yaw refers to rotation about the x/y/z-axis, respectively. +The following command publishes a static coordinate transform to tf2 using an x/y/z offset in meters and roll/pitch/yaw in radians. +In ROS 2, roll/pitch/yaw refers to rotation about the x/y/z-axis, respectively. .. code-block:: console ros2 run tf2_ros static_transform_publisher --x x --y y --z z --yaw yaw --pitch pitch --roll roll --frame-id frame_id --child-frame-id child_frame_id -Publish a static coordinate transform to tf2 using an x/y/z offset in meters and quaternion. +The following command publishes a static coordinate transform to tf2 using an x/y/z offset in meters and roll/pitch/yaw as a quaternion. .. code-block:: console diff --git a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Py.rst b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Py.rst index 10f10e34465..4ad22e592d6 100644 --- a/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Py.rst +++ b/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Py.rst @@ -413,14 +413,14 @@ This tutorial aimed to show how ``StaticTransformBroadcaster`` can be used to pu In your real development process you shouldn't have to write this code yourself and should use the dedicated ``tf2_ros`` tool to do so. ``tf2_ros`` provides an executable named ``static_transform_publisher`` that can be used either as a commandline tool or a node that you can add to your launchfiles. -Publish a static coordinate transform to tf2 using an x/y/z offset in meters and roll/pitch/yaw in radians. -In our case, roll/pitch/yaw refers to rotation about the x/y/z-axis, respectively. +The following command publishes a static coordinate transform to tf2 using an x/y/z offset in meters and roll/pitch/yaw in radians. +In ROS 2, roll/pitch/yaw refers to rotation about the x/y/z-axis, respectively. .. code-block:: console ros2 run tf2_ros static_transform_publisher --x x --y y --z z --yaw yaw --pitch pitch --roll roll --frame-id frame_id --child-frame-id child_frame_id -Publish a static coordinate transform to tf2 using an x/y/z offset in meters and quaternion. +The following command publishes a static coordinate transform to tf2 using an x/y/z offset in meters and roll/pitch/yaw as a quaternion. .. code-block:: console