Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DLu committed Feb 6, 2025
1 parent f94bd87 commit c41bce7
Show file tree
Hide file tree
Showing 23 changed files with 315 additions and 161 deletions.
21 changes: 15 additions & 6 deletions plugins/ros_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
DIGITS = '([0-9])'
NOT_BREAK = r'[^!.?]'
BREAK = r'([!.?])'
PREFIXES = r'(Mr|St|Mrs|Ms|Dr|etc|vol|cf|et al|vs|eg|Proc)\.'
PREFIXES = r'(Mr|St|Mrs|Ms|Dr|etc|vol|cf|et al|vs|eg|Proc|Mon|Tue|Wed|Thu|Fri)\.'
SUFFIXES = r'(Inc|Ltd|Jr|Sr|Co)'
WEBSITES = r'\.(com|net|org|io|gov|edu|me|ros)'
EXTENSIONS = r'\.(xml|cfg|py|launch|frame_id|ini|md|log|h|cpp|bash|patch|gz|yaml|txt|NET|js|msg|srv|action|rst|exe|so|iso)'
MULTIPLE_DOTS = r'\.{2,}'
EXTENSIONS = r'\.(xml|cfg|py|launch|frame_id|ini|md|log|h|cpp|bash|patch|gz|yaml|txt|NET|js|msg|srv|action|rst|exe|so|iso|stl|idl)'
MULTIPLE_DOTS = r'(\.{2,})([^\.])'
STARTERS = r'(Mr|Mrs|Ms|Dr|Prof|Capt|Cpt|Lt|He\s|She\s|It\s|They\s|Their\s|Our\s|We\s|But\s|However\s|That\s|This\s|Wherever)'
ACRONYMS = r'([A-Z][.][A-Z][.](?:[A-Z][.])?)'
DIGITS_DOT_DIGITS = re.compile(DIGITS + '([.])' + DIGITS)
SINGLE_LETTER = re.compile(r'(\s[A-Za-z])(\.)(\s)')
ON_THE_INSIDE = re.compile(r'()' + BREAK + r'(["\)])')
DOT_PAREN = re.compile(r'\.( \()')

# RST Formatting Patterns
Expand All @@ -51,23 +52,31 @@ def split_into_sentences(text):
"""

text = ' ' + text + ' '
text = re.sub('Lu!!', f'Lu{EXCLAM}{EXCLAM}', text)

# Convert nonbreaking punctuation to special characters
for pattern in [DIGITS_DOT_DIGITS, SINGLE_LETTER,
HYPERLINK, BACKTICK, LIST_PREFIX, TRAILING_FORMATTING
]:
HYPERLINK, BACKTICK, LIST_PREFIX, TRAILING_FORMATTING,
ON_THE_INSIDE,
]:
m = pattern.search(text)
while m:
text = text.replace(m.group(0), m.group(1) + SP_LOOKUP[m.group(2)] + m.group(3))
m = pattern.search(text)

text = re.sub(MULTIPLE_DOTS, lambda match: DOT * len(match.group(1)) + match.group(2), text)

for pattern in [PREFIXES, SUFFIXES]:
text = re.sub(pattern, '\\1' + DOT, text)
for pattern in [DOT_PAREN, WEBSITES, EXTENSIONS]:
text = re.sub(pattern, DOT + '\\1', text)

text = re.sub(MULTIPLE_DOTS, lambda match: DOT * len(match.group(0)) + STOP, text)
text = re.sub('Ph\.D\.', f'Ph{DOT}D{DOT}', text)
text = re.sub('i\.e\.', f'i{DOT}e{DOT}', text)

text = re.sub('Steven!', f'Steven{EXCLAM}', text)
text = re.sub('vd\. Hoorn', f'vd{DOT} Hoorn', text)

text = re.sub(ACRONYMS + ' ' + STARTERS,
f'\\1{STOP} \\2',
text)
Expand Down
4 changes: 2 additions & 2 deletions source/How-To-Guides/Ament-CMake-Python-Documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ In this case, it is ``my_project``, or ``${PROJECT_NAME}``.
.. warning::

Calling ``rosidl_generate_interfaces`` and ``ament_python_install_package`` in the same CMake project does not work.
See this `Github issue <https://github.com/ros2/rosidl_python/issues/141>`_ for more info. It is best practice to instead
separate out the message generation into a separate package.
See this `Github issue <https://github.com/ros2/rosidl_python/issues/141>`_ for more info.
It is best practice to instead separate out the message generation into a separate package.

Then, another Python package that correctly depends on ``my_project`` can use it as a normal Python module:

Expand Down
3 changes: 2 additions & 1 deletion source/How-To-Guides/Installing-on-Raspberry-Pi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ After flashing the OS, `install Docker <https://docs.docker.com/engine/install/d

The official ROS 2 Docker images can be found `here <https://hub.docker.com/_/ros/tags>`__.

You may choose from ros-core, ros-base, or perception. See `here <https://www.ros.org/reps/rep-2001.html>`__ for more information on these variants.
You may choose from ros-core, ros-base, or perception.
See `here <https://www.ros.org/reps/rep-2001.html>`__ for more information on these variants.

Fetch and run an image:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ Run a minimal example of 2 C++ nodes (1 topic subscriber ``listener``, 1 topic p
Run two nodes in two separate docker containers
-----------------------------------------------

Open a terminal. Run the image in a container in interactive mode and launch a topic publisher (executable ``talker`` from the package ``demo_nodes_cpp``) with ``ros2 run``:
Open a terminal.
Run the image in a container in interactive mode and launch a topic publisher (executable ``talker`` from the package ``demo_nodes_cpp``) with ``ros2 run``:

.. code-block:: bash
docker run -it --rm osrf/ros:{DISTRO}-desktop ros2 run demo_nodes_cpp talker
Open a second terminal. Run the image in a container in interactive mode and launch a topic subscriber (executable ``listener`` from the package ``demo_nodes_cpp``) with ``ros2 run``:
Open a second terminal.
Run the image in a container in interactive mode and launch a topic subscriber (executable ``listener`` from the package ``demo_nodes_cpp``) with ``ros2 run``:

.. code-block:: bash
Expand Down
3 changes: 2 additions & 1 deletion source/How-To-Guides/Using-Python-Packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Using Python Packages with ROS 2
Installing via ``rosdep``
-------------------------

The fastest way to include third-party python packages is to use their corresponding rosdep keys, if available. ``rosdep`` keys can be checked via:
The fastest way to include third-party python packages is to use their corresponding rosdep keys, if available.
``rosdep`` keys can be checked via:

* https://github.com/ros/rosdistro/blob/master/rosdep/base.yaml
* https://github.com/ros/rosdistro/blob/master/rosdep/python.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ You should have already read the :doc:`DDS and ROS middleware implementations pa
Specifying RMW implementations
------------------------------

To have multiple RMW implementations available for use you must have installed the ROS 2 binaries and any additional dependencies for specific RMW implementations, or built ROS 2 from source with multiple RMW implementations in the workspace (the RMW implementations are included in the build by default if their compile-time dependencies are met). See :doc:`Install DDS implementations <../Installation/DDS-Implementations>`.
To have multiple RMW implementations available for use you must have installed the ROS 2 binaries and any additional dependencies for specific RMW implementations, or built ROS 2 from source with multiple RMW implementations in the workspace (the RMW implementations are included in the build by default if their compile-time dependencies are met).
See :doc:`Install DDS implementations <../Installation/DDS-Implementations>`.

----

Expand Down Expand Up @@ -79,7 +80,8 @@ Troubleshooting
Checking the Current RMW
^^^^^^^^^^^^^^^^^^^^^^^^

To check the RMW that is currently in use you simply check the ``RMW_IMPLEMENTATION`` environment variable. On Linux systems ``printenv`` prints the full list of environment variables.
To check the RMW that is currently in use you simply check the ``RMW_IMPLEMENTATION`` environment variable.
On Linux systems ``printenv`` prints the full list of environment variables.
Other operating systems will have other procedures for viewing environment variables.
If ``RMW_IMPLEMENTATION`` is not in the environment it is safe to assume you are using the default for your ROS distro, otherwise the current RMW is the value listed.
The default RMW for each ROS Distro can be found in `REP-2000 <https://www.ros.org/reps/rep-2000.html#platforms-by-distribution>`_.
Expand Down Expand Up @@ -140,7 +142,8 @@ If you receive an error message similar to below when running RTI Connext on OSX
[D0062|ENABLE]DDS_DomainParticipantPresentation_reserve_participant_index_entryports:!enable reserve participant index
[D0062|ENABLE]DDS_DomainParticipant_reserve_participant_index_entryports:Unusable shared memory transport. For a more in- depth explanation of the possible problem and solution, please visit https://community.rti.com/kb/osx510.
This error is caused by an insufficient number or size of shared memory segments allowed by the operating system. As a result, the ``DomainParticipant`` is unable to allocate enough resources and calculate its participant index which causes the error.
This error is caused by an insufficient number or size of shared memory segments allowed by the operating system.
As a result, the ``DomainParticipant`` is unable to allocate enough resources and calculate its participant index which causes the error.

You can increase the shared memory resources of your machine either temporarily or permanently.

Expand Down
6 changes: 4 additions & 2 deletions source/Related-Projects/Nvidia-ROS2-Projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ ROS Projects
------------
* `Isaac ROS Nvblox <https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nvblox>`__ : Hardware-accelerated 3D scene reconstruction and Nav2 local costmap provider using nvblox.
* `Isaac ROS Object Detection <https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_object_detection>`__ : Deep learning model support for object detection including DetectNet.
* `Isaac ROS DNN Inference <https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_dnn_inference>`__ : This repository provides two NVIDIA GPU-accelerated ROS 2 nodes that perform deep learning inference using custom models. One node uses the TensorRT SDK, while the other uses the Triton SDK.
* `Isaac ROS DNN Inference <https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_dnn_inference>`__ : This repository provides two NVIDIA GPU-accelerated ROS 2 nodes that perform deep learning inference using custom models.
One node uses the TensorRT SDK, while the other uses the Triton SDK.
* `Isaac ROS Visual SLAM <https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_visual_slam>`__ : This repository provides a ROS 2 package that estimates stereo visual inertial odometry using the Isaac Elbrus GPU-accelerated library.
* `Isaac ROS Argus Camera <https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_argus_camera>`__ : This repository provides monocular and stereo nodes that enable ROS developers to use cameras connected to Jetson platforms over a CSI interface.
* `Isaac ROS image_pipeline <https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_image_pipeline>`__ : This metapackage offers similar functionality as the standard, CPU-based image_pipeline metapackage, but does so by leveraging the Jetson platform's specialized computer vision hardware.
* `Isaac ROS Common <https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common>`__ : Isaac ROS common utilities for use in conjunction with the Isaac ROS suite of packages.
* `Isaac ROS AprilTags <https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_apriltag>`__ : ROS 2 node uses the NVIDIA GPU-accelerated AprilTags library to detect AprilTags in images and publish their poses, ids, and additional metadata.
* `ROS and ROS 2 Docker Images <https://github.com/NVIDIA-AI-IOT/ros2_jetson/tree/main/docker>`__ : Docker images for easy deployment on the NVIDIA Jetson platform, consisting of ROS 2, PyTorch, and other important machine learning libraries.
* `ROS and ROS 2 DockerFiles <https://github.com/dusty-nv/jetson-containers>`__: Dockerfiles for ROS 2 based on l4t which all you to build your own Docker image.
* `ROS 2 Packages for PyTorch and TensorRT <https://github.com/NVIDIA-AI-IOT/ros2_torch_trt>`__: ROS 2 packageis for classification and object detection tasks using PyTorch and NVIDIA TensorRT. This tutorial is a good starting point AI integration with ROS 2 on NVIDIA Jetson.
* `ROS 2 Packages for PyTorch and TensorRT <https://github.com/NVIDIA-AI-IOT/ros2_torch_trt>`__: ROS 2 packageis for classification and object detection tasks using PyTorch and NVIDIA TensorRT.
This tutorial is a good starting point AI integration with ROS 2 on NVIDIA Jetson.
* `ROS / ROS 2 Packages for Accelerated Deep Learning Nodes <https://github.com/dusty-nv/ros_deep_learning>`__: Deep learning image recognition, object detection, and semantic segmentation inference nodes and camera/video streaming nodes for ROS/ROS 2 using the `jetson-inference <https://github.com/dusty-nv/jetson-inference>`__ library and `NVIDIA Hello AI World tutorial <https://developer.nvidia.com/embedded/twodaystoademo>`__.
* `ROS 2 Package for Human Pose Estimation <https://github.com/NVIDIA-AI-IOT/ros2_trt_pose>`__: A ROS 2 package for human pose estimation.
* `ROS 2 Package for Hand Pose Estimation and Gesture Classification <https://github.com/NVIDIA-AI-IOT/ros2_trt_pose_hand>`__: A ROS 2 package for real-time hand pose estimation and gesture classification using TensorRT.
Expand Down
28 changes: 19 additions & 9 deletions source/Related-Projects/Visualizing-ROS-2-Data-With-Foxglove.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ It's available in the browser or as a standalone desktop app and is free for ind
Installation
------------

To use Foxglove, you'll need to `create an account <https://app.foxglove.dev/signup>`__. It's free and all you need is a valid email address.
To use Foxglove, you'll need to `create an account <https://app.foxglove.dev/signup>`__.
It's free and all you need is a valid email address.

Once you've created an account, you can use Foxglove on the web by opening Google Chrome and navigating to `app.foxglove.dev <https://app.foxglove.dev>`__.

To use the desktop app for Linux, macOS, or Windows, download it directly from the `Foxglove website <https://foxglove.dev/download>`__.

.. note::

Foxglove uses specific features of Google Chrome. While some features may work, other browsers are not supported. For the best experience, we recommend using Chrome or the desktop app.
Foxglove uses specific features of Google Chrome.
While some features may work, other browsers are not supported.
For the best experience, we recommend using Chrome or the desktop app.

Connect to a live data source
-----------------------------
Expand All @@ -36,9 +39,11 @@ Once you have the bridge installed, launch it with:
ros2 launch foxglove_bridge foxglove_bridge_launch.xml
With the bridge running on your robot, you're ready to connect view data in Foxglove. Make sure you are on the same network as your robot, open Foxglove (web or desktop) and click "Open connection".
With the bridge running on your robot, you're ready to connect view data in Foxglove.
Make sure you are on the same network as your robot, open Foxglove (web or desktop) and click "Open connection".

Select the option for "Foxglove WebSocket" and enter your robot's WebSocket URL. The default is ``ws://localhost:8765``, however you can read about configuration options for the ROS Foxglove bridge `here <https://docs.foxglove.dev/docs/connecting-to-data/ros-foxglove-bridge#configuration-1>`__.
Select the option for "Foxglove WebSocket" and enter your robot's WebSocket URL.
The default is ``ws://localhost:8765``, however you can read about configuration options for the ROS Foxglove bridge `here <https://docs.foxglove.dev/docs/connecting-to-data/ros-foxglove-bridge#configuration-1>`__.

.. note::

Expand All @@ -47,7 +52,8 @@ Select the option for "Foxglove WebSocket" and enter your robot's WebSocket URL.
View and replay recorded data
-----------------------------

If you'd rather visualize recorded data, you can use Foxglove to replay ROS 2 ``.mcap`` as well as older ROS 2 ``.db3``, and ROS 1 ``.bag`` files. Foxglove is particularly convenient for recorded data because it does not require ROS 2 to be running to view data.
If you'd rather visualize recorded data, you can use Foxglove to replay ROS 2 ``.mcap`` as well as older ROS 2 ``.db3``, and ROS 1 ``.bag`` files.
Foxglove is particularly convenient for recorded data because it does not require ROS 2 to be running to view data.

Use the :doc:`ros2 bag command line tool <../Tutorials/Beginner-CLI-Tools/Recording-And-Playing-Back-Data/Recording-And-Playing-Back-Data>` to record data from your robot to a ``.mcap`` file:

Expand All @@ -73,7 +79,8 @@ We've highlighted some particularly useful ones below:
3D panel: View 3D data and visualization markers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Open the panel settings by clicking the gear icon in the upper right. Choose the topics you want to display via the topic picker on the left, and configure each topic's visualization settings in the "Edit topic settings" menu.
Open the panel settings by clicking the gear icon in the upper right.
Choose the topics you want to display via the topic picker on the left, and configure each topic's visualization settings in the "Edit topic settings" menu.

Publish marker messages to add primitive shapes (arrows, spheres, etc.) and more complex visualizations (occupancy grids, point clouds, etc.) to your 3D panel's scene.

Expand All @@ -97,7 +104,8 @@ Reference the `docs <https://foxglove.dev/docs/visualization/panels/diagnostics>
Image panel: View camera feed images
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Display raw and compressed images, as well as compressed videos, with 2D annotations like text labels, circles, and points. Superimpose 3D markers for additional context.
Display raw and compressed images, as well as compressed videos, with 2D annotations like text labels, circles, and points.
Superimpose 3D markers for additional context.

.. image:: foxglove/image.png
:width: 500 px
Expand All @@ -121,7 +129,8 @@ Plot panel: Plot arbitrary values over time

Plot arbitrary numeric values from topic `message paths <https://docs.foxglove.dev/docs/visualization/message-path-syntax>`__ .

When playing back local or remote data files, this panel will preload the data belonging to the specified topic message paths for the whole playback timeline. Current playback time is indicated by a vertical gray bar.
When playing back local or remote data files, this panel will preload the data belonging to the specified topic message paths for the whole playback timeline.
Current playback time is indicated by a vertical gray bar.

.. image:: foxglove/plot.png
:width: 500 px
Expand All @@ -134,7 +143,8 @@ Raw Messages panel: View incoming topic messages

Inspect a particular `message path <https://docs.foxglove.dev/docs/visualization/message-path-syntax>`__ in your data source.

As new messages are received for a given path, the collapsible tree will show just the latest message. You will be able to expand and collapse keys, and have those changes persist across playback.
As new messages are received for a given path, the collapsible tree will show just the latest message.
You will be able to expand and collapse keys, and have those changes persist across playback.

.. image:: foxglove/raw-messages.png
:width: 500 px
Expand Down
Loading

0 comments on commit c41bce7

Please sign in to comment.