From 6119553e3dde96b5f54759a6361f30221ac9e9f8 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 15 Oct 2021 11:01:30 -0400 Subject: [PATCH] Add a release note for the static_transform_publisher args. (#2015) * Add a release note for the static_transform_publisher args. Signed-off-by: Chris Lalancette --- source/Releases/Release-Humble-Hawksbill.rst | 17 +++++++++++++++++ .../Writing-A-Tf2-Static-Broadcaster-Cpp.rst | 8 +++++--- .../Tf2/Writing-A-Tf2-Static-Broadcaster-Py.rst | 8 +++++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/source/Releases/Release-Humble-Hawksbill.rst b/source/Releases/Release-Humble-Hawksbill.rst index 4e2a6637ab..6a9b10c723 100644 --- a/source/Releases/Release-Humble-Hawksbill.rst +++ b/source/Releases/Release-Humble-Hawksbill.rst @@ -303,6 +303,23 @@ The previous enumerators are still available, but are now deprecated and will pr All code that uses the ``TF2Error`` enumerator should be updated to use the new ``TF2`` prefixed errors. See https://github.com/ros2/geometry2/pull/349 for more details. +More intuitive command-line arguments for static_transform_publisher +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +The ``static_transform_publisher`` program used to take arguments like: ``ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 1 foo bar``. +The first three numbers are the translation x, y, and z, the next 4 are the quaternion x, y, z, and w, and the last two arguments are the parent and child frame IDs. +While this worked, it had a couple of problems: + +* The user had to specify *all* of the arguments, even if only setting one number +* Reading the command-line to figure out what it was publishing was tricky + +To fix both of these issues, the command-line handling has been changed to use flags instead, and all flags except for ``--frame-id`` and ``--child-frame-id`` are optional. +Thus, the above command-line can be simplified to: ``ros2 run tf2_ros static_transform_publisher --frame-id foo --child-frame-id bar`` +To change just the translation x, the command-line would be: ``ros2 run tf2_ros static_transform_publisher --x 1.5 --frame-id foo --child-frame-id bar``. + +The old-style arguments are still allowed in this release, but are deprecated and will print a warning. +They will be removed in future releases. +See https://github.com/ros2/geometry2/pull/392 for more details. Known Issues ------------ diff --git a/source/Tutorials/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.rst b/source/Tutorials/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.rst index a8845f7514..f31ebd1503 100644 --- a/source/Tutorials/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.rst +++ b/source/Tutorials/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.rst @@ -421,13 +421,13 @@ In our case, roll/pitch/yaw refers to rotation about the x/y/z-axis, respectivel .. code-block:: console - ros2 run tf2_ros static_transform_publisher x y z yaw pitch roll frame_id child_frame_id + 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. .. code-block:: console - ros2 run tf2_ros static_transform_publisher x y z qx qy qz qw frame_id child_frame_id + ros2 run tf2_ros static_transform_publisher --x x --y y --z z --qx qx --qy qy --qz qz --qw qw --frame-id frame_id --child-frame-id child_frame_id ``static_transform_publisher`` is designed both as a command-line tool for manual use, as well as for use within ``launch`` files for setting static transforms. For example: @@ -441,10 +441,12 @@ Publish a static coordinate transform to tf2 using an x/y/z offset in meters and Node( package='tf2_ros', executable='static_transform_publisher', - arguments = ['0', '0', '1', '0', '0', '0', 'world', 'mystaticturtle'] + arguments = ['--x', '0', '--y', '0', '--z', '1', '--yaw', '0', '--pitch', '0', '--roll', '0', '--frame-id', 'world', '--child-frame-id', 'mystaticturtle'] ), ]) +Note that all arguments except for ``--frame-id`` and ``--child-frame-id`` are optional; if a particular option isn't specified, then the identity will be assumed. + Summary ------- diff --git a/source/Tutorials/Tf2/Writing-A-Tf2-Static-Broadcaster-Py.rst b/source/Tutorials/Tf2/Writing-A-Tf2-Static-Broadcaster-Py.rst index fc2a9da045..b84eb8e9d7 100644 --- a/source/Tutorials/Tf2/Writing-A-Tf2-Static-Broadcaster-Py.rst +++ b/source/Tutorials/Tf2/Writing-A-Tf2-Static-Broadcaster-Py.rst @@ -388,13 +388,13 @@ In our case, roll/pitch/yaw refers to rotation about the x/y/z-axis, respectivel .. code-block:: console - ros2 run tf2_ros static_transform_publisher x y z yaw pitch roll frame_id child_frame_id + 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. .. code-block:: console - ros2 run tf2_ros static_transform_publisher x y z qx qy qz qw frame_id child_frame_id + ros2 run tf2_ros static_transform_publisher --x x --y y --z z --qx qx --qy qy --qz qz --qw qw --frame-id frame_id --child-frame-id child_frame_id ``static_transform_publisher`` is designed both as a command-line tool for manual use, as well as for use within ``launch`` files for setting static transforms. For example: @@ -408,10 +408,12 @@ Publish a static coordinate transform to tf2 using an x/y/z offset in meters and Node( package='tf2_ros', executable='static_transform_publisher', - arguments = ['0', '0', '1', '0', '0', '0', 'world', 'mystaticturtle'] + arguments = ['--x', '0', '--y', '0', '--z', '1', '--yaw', '0', '--pitch', '0', '--roll', '0', '--frame-id', 'world', '--child-frame-id', 'mystaticturtle'] ), ]) +Note that all arguments except for ``--frame-id`` and ``--child-frame-id`` are optional; if a particular option isn't specified, then the identity will be assumed. + Summary -------