Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cli tools documentation #653

Merged
merged 17 commits into from
May 22, 2024
Merged

Conversation

CursedRock17
Copy link
Contributor

This Pull Request is a direct link to issue #550 which looks to improve documentation, specifically in CLI commands like tf2_echo. In this PR, all tools and documentation related to tf2_ros are put in one central place, hopefully https://docs.ros.org/.

Signed-off-by: CursedRock17 <[email protected]>
Signed-off-by: CursedRock17 <[email protected]>
Signed-off-by: CursedRock17 <[email protected]>
Signed-off-by: CursedRock17 <[email protected]>
Copy link
Contributor

@tfoote tfoote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried running this with rosdoc2 and I don't think that these are being picked up by sphinx in ROS 2 and rendered. I think this will need a rosdoc2.yaml config setup to pick up these resources.

- Pass the :class:`tf2_ros.Buffer` to the constructor of :class:`tf2_ros.TransformListener`.
- Optionally, pass a :class:`ros.NodeHandle` (otherwise TransformListener will connect to the node for the process).
- Optionally, specify if the TransformListener runs in its own thread or not.
* **tf2_ros::Buffer::transform** is the main method for applying transforms.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these still create links to the Doxygen content?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the loacl links are done through rst which puts them next to what we're trying to list. I assumed this would be the easiest thing to do when it came to overall documentation.
Here's a video of what it should look like:

Geometry2_Docs.mov

To recreate do the following in the terminal

  1. Clone the repo
  2. cd tf2_ros/docs
  3. make html
  4. rosdoc2 build --package-path ./..
  5. rosdoc2 open ./docs_output/tf2_ros/index.html
  6. Run it on the web so something like python3 -m http.server will work for localhost

Are packages like rosdoc2, exhale, and breathe able to run on the docs, or is this overengineered?

Signed-off-by: CursedRock17 <[email protected]>
@CursedRock17
Copy link
Contributor Author

I've recreated the rosdoc.yaml file in rosdoc2 terms so doxygen and sphinx content should be put out into the same file. As for the Links to the Doxygen content I have to rewrite those to be locally linked

tf2_ros/docs/source/cli_tools.rst Outdated Show resolved Hide resolved
tf2_ros/docs/source/cli_tools.rst Outdated Show resolved Hide resolved
tf2_ros/docs/source/cli_tools.rst Outdated Show resolved Hide resolved
tf2_ros/docs/source/index.rst Outdated Show resolved Hide resolved
tf2_ros/docs/source/index.rst Outdated Show resolved Hide resolved
tf2_ros/docs/source/cli_tools.rst Outdated Show resolved Hide resolved
tf2_ros/docs/source/cli_tools.rst Outdated Show resolved Hide resolved
tf2_ros/docs/source/cli_tools.rst Outdated Show resolved Hide resolved
tf2_ros/docs/source/cli_tools.rst Outdated Show resolved Hide resolved
tf2_ros/docs/source/cli_tools.rst Outdated Show resolved Hide resolved
Signed-off-by: CursedRock17 <[email protected]>
Signed-off-by: CursedRock17 <[email protected]>
Signed-off-by: CursedRock17 <[email protected]>
Signed-off-by: CursedRock17 <[email protected]>
Signed-off-by: CursedRock17 <[email protected]>
@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/nomenclature-of-tf-echo-and-tf-listener/36985/6

@ahcorde
Copy link
Contributor

ahcorde commented Apr 19, 2024

I made here some suggestions CursedRock17#1

Signed-off-by: CursedRock17 <[email protected]>

Removing exhale

Signed-off-by: CursedRock17 <[email protected]>

Fixing doxyfile

Signed-off-by: CursedRock17 <[email protected]>

Removing extra picture

Signed-off-by: CursedRock17 <[email protected]>
@CursedRock17 CursedRock17 force-pushed the cli_tools_documentation branch from bf86132 to 8e38be6 Compare April 21, 2024 18:08
Signed-off-by: CursedRock17 <[email protected]>
@CursedRock17
Copy link
Contributor Author

I went ahead and added those changes you suggested, along with getting the Sphinx and Doxygen docs working for both python and C++

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see these errors:

/home/ahcorde/ros2_rolling/src/ros2/geometry2/tf2_ros/doc/index.rst:8: WARNING: undefined label: 'exhale_class_classtf2__ros_1_1_transform_broadcaster'
/home/ahcorde/ros2_rolling/src/ros2/geometry2/tf2_ros/doc/index.rst:14: WARNING: undefined label: 'exhale_class_classtf2__ros_1_1_static_transform_broadcaster'
/home/ahcorde/ros2_rolling/src/ros2/geometry2/tf2_ros/doc/index.rst:20: WARNING: undefined label: 'exhale_class_classtf2__ros_1_1_buffer'
/home/ahcorde/ros2_rolling/src/ros2/geometry2/tf2_ros/doc/index.rst:20: WARNING: undefined label: 'exhale_class_classtf2__ros_1_1_buffer_interface'
/home/ahcorde/ros2_rolling/src/ros2/geometry2/tf2_ros/doc/index.rst:20: WARNING: undefined label: 'exhale_class_classtf2__ros_1_1_transform_listener'
/home/ahcorde/ros2_rolling/src/ros2/geometry2/tf2_ros/doc/index.rst:32: WARNING: undefined label: 'exhale_class_classtf2__ros_1_1_message_filter'

@@ -39,7 +39,7 @@ Exceptions
.. exception:: tf2.InvalidArgumentException

subclass of :exc:`TransformException`.
Raised when the arguments to the method are called improperly formed. An example of why this might be raised is if an argument is nan.
Raised when the arguments to the method are called improperly formed. An example of why this might be raised is if an argument is nan.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Raised when the arguments to the method are called improperly formed. An example of why this might be raised is if an argument is nan.
Raised when the arguments to the method are called improperly formed. An example of why this might be raised is if an argument is nan.


ros2 run turtlesim turtle_teleop_key

Now using tf2_echo to take a look at the different transformations occuring between two frames
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Now using tf2_echo to take a look at the different transformations occuring between two frames
Now using tf2_echo to take a look at the different transformations occurring between two frames


1. tf2_echo
^^^^^^^^^^^
tf2_echo is the simplest tool to look at the numeric values of a specific transform. tf2_echo takes two arguments: the source frame and the target frame. The output of tf2_echo is the target frame in comparison to the source frame. E.g. to get the transformation from turtle1 to turtle2, set up the turtlesim example with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tf2_echo is the simplest tool to look at the numeric values of a specific transform. tf2_echo takes two arguments: the source frame and the target frame. The output of tf2_echo is the target frame in comparison to the source frame. E.g. to get the transformation from turtle1 to turtle2, set up the turtlesim example with:
``tf2_echo`` is the simplest tool to look at the numeric values of a specific transform. ``tf2_echo`` takes two arguments: the source frame and the target frame. The output of ``tf2_echo`` is the target frame in comparison to the source frame. E.g. to get the transformation from turtle1 to turtle2, set up the turtlesim example with:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`rqt_tf_tree <https://github.com/ros-visualization/rqt_tf_tree/tree/master>`_ provides a GUI to inspect tf tree during runtime.

A simple tree from the tutorial in 1. tf2_echo looks like:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A simple tree from the tutorial in 1. tf2_echo looks like:
A simple tree from the tutorial in 1. ``tf2_echo`` looks like:


2. tf2_monitor
^^^^^^^^^^^^^^
tf2_monitor can give you a lot of detailed information about a specific transformation you care about. The monitor will break down the chain between two frames into individual transforms, and provide statistics about timing, broadcasters, etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tf2_monitor can give you a lot of detailed information about a specific transformation you care about. The monitor will break down the chain between two frames into individual transforms, and provide statistics about timing, broadcasters, etc.
``tf2_monitor`` can give you a lot of detailed information about a specific transformation you care about. The monitor will break down the chain between two frames into individual transforms, and provide statistics about timing, broadcasters, etc.


ros2 run tf2_ros static_transform_publisher [--x X] [--y Y] [--z Z] [--yaw Yaw] [--pitch Pitch] [--roll Roll] --frame_id Frame --child_frame_id Child_Frame

Static_transform_publisher can also publish a static coordinate transform to tf2 using an x/y/z offset in meters and quaternion.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Static_transform_publisher can also publish a static coordinate transform to tf2 using an x/y/z offset in meters and quaternion.
``static_transform_publisher`` can also publish a static coordinate transform to tf2 using an x/y/z offset in meters and quaternion.


ros2 run tf2_ros static_transform_publisher [--x X] [--y Y] [--z Z] [--qx QX] [--qy QY] [--qz QZ] [--qw QW] --frame_id Frame --child_frame_id Child_Frame

Static_transform_publisher is designed both as a command-line tool for manual use, as well as for use within roslaunch files for setting static transforms. For example:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Static_transform_publisher is designed both as a command-line tool for manual use, as well as for use within roslaunch files for setting static transforms. For example:
``static_transform_publisher`` is designed both as a command-line tool for manual use, as well as for use within roslaunch files for setting static transforms. For example:

'Miscellaneous'),
]

# Configuration for breathe to link doxygen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ?

1.3 Filtering Transforms
------------------------

tf2_ros provides a feature which allows to pass only the messages once there is transform data available. This follows the pattern from the message_filters package. Here is a brief list of functions that the user is most likely to use.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tf2_ros provides a feature which allows to pass only the messages once there is transform data available. This follows the pattern from the message_filters package. Here is a brief list of functions that the user is most likely to use.
``tf2_ros`` provides a feature which allows to pass only the messages once there is transform data available. This follows the pattern from the ``message_filters`` package. Here is a brief list of functions that the user is most likely to use.

1.4 Exceptions
--------------

Here is the list of exceptions that can be thrown by tf2_ros and are inherited from tf2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Here is the list of exceptions that can be thrown by tf2_ros and are inherited from tf2.
Here is the list of exceptions that can be thrown by ``tf2_ros`` and are inherited from tf2.

Signed-off-by: CursedRock17 <[email protected]>
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made these changes to be able to get the links

tf2_ros/doc/index.rst Outdated Show resolved Hide resolved
tf2_ros/doc/index.rst Outdated Show resolved Hide resolved
tf2_ros/doc/index.rst Outdated Show resolved Hide resolved
tf2_ros/doc/index.rst Outdated Show resolved Hide resolved
Signed-off-by: CursedRock17 <[email protected]>
@ahcorde
Copy link
Contributor

ahcorde commented May 21, 2024

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: CursedRock17 <[email protected]>
@ahcorde
Copy link
Contributor

ahcorde commented May 22, 2024

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit c9ca2ca into ros2:rolling May 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants