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
4 changes: 2 additions & 2 deletions source/Concepts/Basic/About-Command-Line-Tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ The main entry point for the tools is the command ``ros2``, which itself has var

To see all available sub-commands run:

.. code-block:: bash
.. code-block:: console

ros2 --help
$ ros2 --help

Examples of sub-commands that are available include:

Expand Down
16 changes: 8 additions & 8 deletions source/Concepts/Intermediate/About-RQt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ The tools can still run in a traditional standalone method, but RQt makes it eas

You can run any RQt tools/plugins easily by:

.. code-block:: bash
.. code-block:: console

rqt
$ rqt

This GUI allows you to choose any available plugins on your system.
You can also run plugins in standalone windows.
For example, RQt Python Console:

.. code-block:: bash
.. code-block:: console

ros2 run rqt_py_console rqt_py_console
$ ros2 run rqt_py_console rqt_py_console

Users can create their own plugins for RQt with either ``Python`` or ``C++``.
To see what RQt plugins are available for your system, run:

.. code-block:: bash
.. code-block:: console

ros2 pkg list
$ ros2 pkg list

And then look for packages that start with ``rqt_``.

Expand All @@ -46,9 +46,9 @@ System setup
Installing From debs
^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash
.. code-block:: console

sudo apt install ros-{DISTRO}-rqt*
$ sudo apt install ros-{DISTRO}-rqt*


RQt Components Structure
Expand Down
8 changes: 4 additions & 4 deletions source/How-To-Guides/Ament-CMake-Documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,11 @@ A recommended best practice when defining environment hooks is to place them wit

Inside your created ``hooks`` folder, create a ``my_package.sh.in`` as follows:

.. code-block:: bash
.. code-block:: console

export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
export RMW_FASTRTPS_USE_QOS_FROM_XML=1
export FASTRTPS_DEFAULT_PROFILES_FILE="$COLCON_CURRENT_PREFIX/my_dds_profile.xml"
$ export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
$ export RMW_FASTRTPS_USE_QOS_FROM_XML=1
$ export FASTRTPS_DEFAULT_PROFILES_FILE="$COLCON_CURRENT_PREFIX/my_dds_profile.xml"

In the same folder, create a ``my_package.dsv.in`` file as follows:

Expand Down
28 changes: 14 additions & 14 deletions source/How-To-Guides/Building-ROS-2-with-Tracing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,41 +47,41 @@ To remove the tracepoints, (re)build ``tracetools`` and set the ``TRACETOOLS_TRA

.. group-tab:: Source installation

.. code-block:: bash
.. code-block:: console

cd ~/ros2_{DISTRO}
colcon build --packages-select tracetools --cmake-clean-cache --cmake-args -DTRACETOOLS_TRACEPOINTS_EXCLUDED=ON
$ cd ~/ros2_{DISTRO}
$ colcon build --packages-select tracetools --cmake-clean-cache --cmake-args -DTRACETOOLS_TRACEPOINTS_EXCLUDED=ON

.. group-tab:: Binary installation

Clone the ``ros2_tracing`` repository into your workspace and build:

.. code-block:: bash
.. code-block:: console

cd ~/ws
git clone https://github.com/ros2/ros2_tracing.git -b {DISTRO} src/ros2_tracing
colcon build --packages-select tracetools --cmake-args -DTRACETOOLS_TRACEPOINTS_EXCLUDED=ON
$ cd ~/ws
$ git clone https://github.com/ros2/ros2_tracing.git -b {DISTRO} src/ros2_tracing
$ colcon build --packages-select tracetools --cmake-args -DTRACETOOLS_TRACEPOINTS_EXCLUDED=ON

Building without instrumentation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To completely remove both tracepoints and function calls, :doc:`build ROS 2 from source <../Installation/Alternatives/Ubuntu-Development-Setup>` and set the ``TRACETOOLS_DISABLED`` CMake option to ``ON``:

.. code-block:: bash
.. code-block:: console

cd ~/ros2_{DISTRO}
colcon build --cmake-args -DTRACETOOLS_DISABLED=ON --no-warn-unused-cli
$ cd ~/ros2_{DISTRO}
$ colcon build --cmake-args -DTRACETOOLS_DISABLED=ON --no-warn-unused-cli

Validating
----------

Validate that tracing is disabled:

.. code-block:: bash
.. code-block:: console

cd ~/ws
source install/setup.bash
ros2 run tracetools status
$ cd ~/ws
$ source install/setup.bash
$ ros2 run tracetools status

It should print out:

Expand Down
28 changes: 14 additions & 14 deletions source/How-To-Guides/Configure-ZeroCopy-loaned-messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ The requirements for loaned messages are that the message type is a Plain Old Da

We can run the demo by running the ``ros2 run demo_nodes_cpp talker_loaned_message`` executable (don't forget to source the setup file first):

.. code-block:: bash
.. code-block:: console

$ ros2 run demo_nodes_cpp talker_loaned_message
[INFO] [1741063656.446278828] [loaned_message_talker]: Publishing: '1.000000'
Expand All @@ -167,7 +167,7 @@ We can run the demo by running the ``ros2 run demo_nodes_cpp talker_loaned_messa
If the RMW implementation does not support loaned messages, all the messages will be allocated with the allocator instance provided by the publisher.
We can try that by executing ``RMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 run demo_nodes_cpp talker_loaned_message``.

.. code-block:: bash
.. code-block:: console

$ RMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 run demo_nodes_cpp talker_loaned_message
[INFO] [1741064109.676860153] [rclcpp]: Currently used middleware cannot loan messages. Local allocator will be used.
Expand Down Expand Up @@ -198,37 +198,37 @@ You can set the environment variable with the following command:

.. code-block:: console

export ROS_DISABLE_LOANED_MESSAGES=1
$ export ROS_DISABLE_LOANED_MESSAGES=1

To maintain this setting between shell sessions, you can add the command to your shell startup script:

.. code-block:: console

echo "export ROS_DISABLE_LOANED_MESSAGES=1" >> ~/.bashrc
$ echo "export ROS_DISABLE_LOANED_MESSAGES=1" >> ~/.bashrc

.. group-tab:: macOS

.. code-block:: console

export ROS_DISABLE_LOANED_MESSAGES=1
$ export ROS_DISABLE_LOANED_MESSAGES=1

To maintain this setting between shell sessions, you can add the command to your shell startup script:

.. code-block:: console

echo "export ROS_DISABLE_LOANED_MESSAGES=1" >> ~/.bash_profile
$ echo "export ROS_DISABLE_LOANED_MESSAGES=1" >> ~/.bash_profile

.. group-tab:: Windows

.. code-block:: console

set ROS_DISABLE_LOANED_MESSAGES=1
$ set ROS_DISABLE_LOANED_MESSAGES=1

If you want to make this permanent between shell sessions, also run:

.. code-block:: console

setx ROS_DISABLE_LOANED_MESSAGES 1
$ setx ROS_DISABLE_LOANED_MESSAGES 1


Subscriptions
Expand All @@ -244,34 +244,34 @@ To enable *Loaned Messages* on subscription, you need to set the environment var

.. code-block:: console

export ROS_DISABLE_LOANED_MESSAGES=0
$ export ROS_DISABLE_LOANED_MESSAGES=0

To maintain this setting between shell sessions, you can add the command to your shell startup script:

.. code-block:: console

echo "export ROS_DISABLE_LOANED_MESSAGES=0" >> ~/.bashrc
$ echo "export ROS_DISABLE_LOANED_MESSAGES=0" >> ~/.bashrc

.. group-tab:: macOS

.. code-block:: console

export ROS_DISABLE_LOANED_MESSAGES=0
$ export ROS_DISABLE_LOANED_MESSAGES=0

To maintain this setting between shell sessions, you can add the command to your shell startup script:

.. code-block:: console

echo "export ROS_DISABLE_LOANED_MESSAGES=0" >> ~/.bash_profile
$ echo "export ROS_DISABLE_LOANED_MESSAGES=0" >> ~/.bash_profile

.. group-tab:: Windows

.. code-block:: console

set ROS_DISABLE_LOANED_MESSAGES=0
$ set ROS_DISABLE_LOANED_MESSAGES=0

If you want to make this permanent between shell sessions, also run:

.. code-block:: console

setx ROS_DISABLE_LOANED_MESSAGES 0
$ setx ROS_DISABLE_LOANED_MESSAGES 0
8 changes: 4 additions & 4 deletions source/How-To-Guides/DDS-tuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Reduce the value, for example, to 3s, by running:

.. code-block:: console

sudo sysctl net.ipv4.ipfrag_time=3
$ sudo sysctl net.ipv4.ipfrag_time=3

Reducing this parameter's value also reduces the window of time where no fragments are received.
The parameter is global for all incoming fragments, so the feasibility of reducing its value needs to be considered for every environment.
Expand All @@ -58,7 +58,7 @@ Increase the value, for example, to 128MB, by running:

.. code-block:: console

sudo sysctl net.ipv4.ipfrag_high_thresh=134217728 # (128 MB)
$ sudo sysctl net.ipv4.ipfrag_high_thresh=134217728 # (128 MB)

Significantly increasing this parameter's value is an attempt to ensure that the buffer never becomes completely full.
However, the value would likely have to be significantly high to hold all data received during the time window of ``ipfrag_time``, assuming every UDP packet lacks one fragment.
Expand Down Expand Up @@ -112,7 +112,7 @@ Set the maximum receive buffer size, ``rmem_max``, by running:

.. code-block:: console

sudo sysctl -w net.core.rmem_max=2147483647
$ sudo sysctl -w net.core.rmem_max=2147483647

Or permanently set it by editing the ``/etc/sysctl.d/10-cyclone-max.conf`` file to contain:

Expand Down Expand Up @@ -151,7 +151,7 @@ Set the maximum receive buffer size, ``rmem_max``, by running:

.. code-block:: console

sudo sysctl -w net.core.rmem_max=4194304
$ sudo sysctl -w net.core.rmem_max=4194304

By tuning ``net.core.rmem_max`` to 4MB in the Linux kernel, the QoS profile can produce truly reliable behavior.

Expand Down
8 changes: 4 additions & 4 deletions source/How-To-Guides/Developing-a-ROS-2-Package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Creating a package

All ROS 2 packages begin by running the command

.. code-block:: bash
.. code-block:: console

ros2 pkg create --license Apache-2.0 <pkg-name> --dependencies [deps]
$ ros2 pkg create --license Apache-2.0 <pkg-name> --dependencies [deps]

in your workspace (usually ``~/ros2_ws/src``).

Expand All @@ -42,13 +42,13 @@ To create a package for a specific client library:

.. code-block:: bash

ros2 pkg create --build-type ament_cmake --license Apache-2.0 <pkg-name> --dependencies [deps]
$ ros2 pkg create --build-type ament_cmake --license Apache-2.0 <pkg-name> --dependencies [deps]

.. group-tab:: Python

.. code-block:: bash

ros2 pkg create --build-type ament_python --license Apache-2.0 <pkg-name> --dependencies [deps]
$ ros2 pkg create --build-type ament_python --license Apache-2.0 <pkg-name> --dependencies [deps]

You can then update the ``package.xml`` with your package info such as dependencies, descriptions, and authorship.

Expand Down
4 changes: 2 additions & 2 deletions source/How-To-Guides/Documenting-a-ROS-2-Package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ To generate the documentation for a package in HTML format with ``rosdoc2``, run

.. code-block:: console

rosdoc2 build --package-path <package-path>
$ rosdoc2 build --package-path <package-path>

The documentation is written to ``docs_output/<package-name>/index.html`` and can be viewed in a browser.

Expand All @@ -61,7 +61,7 @@ To generate a default ``rosdoc2.yaml`` which you can then further customize, run

.. code-block:: console

rosdoc2 default_config --package-path <package-path>
$ rosdoc2 default_config --package-path <package-path>

And add ``<rosdoc2>rosdoc2.yaml</rosdoc2>`` to the export section in your ``package.xml``:

Expand Down
20 changes: 10 additions & 10 deletions source/How-To-Guides/Getting-Backtraces-in-ROS-2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ Here's how to ensure your ROS2 code is ready for debugging:

- By using ``--cmake-args``: The easiest way to include debug symbols is by adding ``--cmake-args -DCMAKE_BUILD_TYPE=Debug`` to your ``colcon build`` command:

.. code-block:: bash
.. code-block:: console

colcon build --packages-up-to <package_name> --cmake-args -DCMAKE_BUILD_TYPE=Debug
$ colcon build --packages-up-to <package_name> --cmake-args -DCMAKE_BUILD_TYPE=Debug

- By editing ``CMakeLists.txt`` : Another way is to add ``-g`` to your compiler flags for the ROS package you want to profile / debug.
This flag builds debug symbols that GDB can read to tell you specific lines of code in your project are failing and why.
Expand All @@ -115,7 +115,7 @@ However, since this is a ROS project with lots of node configurations and other

.. code-block:: bash

gdb ex run --args /path/to/exe/program
$ gdb ex run --args /path/to/exe/program

Below are sections to describe the three major situations you could run into with ROS 2-based systems.
Read the section that best describes the problem you're attempting to solve.
Expand Down Expand Up @@ -145,7 +145,7 @@ This allows us to use the same ``ros2 run`` syntax you're used to without having

.. code-block:: bash

ros2 run --prefix 'gdb -ex run --args' <pkg> <node> --all-other-launch arguments
$ ros2 run --prefix 'gdb -ex run --args' <pkg> <node> --all-other-launch arguments

**The GDB Experience**

Expand Down Expand Up @@ -321,29 +321,29 @@ Since the previous build type may be cached by CMake, clean the cache and rebuil

.. code-block:: console

colcon build --cmake-clean-cache --mixin debug
$ colcon build --cmake-clean-cache --mixin debug

In order for GDB to load debug symbols for any shared libraries called, make sure to source your environment.
This configures the value of ``LD_LIBRARY_PATH``.

.. code-block:: console

source install/setup.bash
$ source install/setup.bash

Finally, run the test directly through GDB.
For example:

.. code-block:: console

gdb -ex run ./build/rcl/test/test_logging
$ gdb -ex run ./build/rcl/test/test_logging

If the code is throwing an unhandled exception, you can catch it in GDB before gtest handles it.

.. code-block:: console

gdb ./build/rcl/test/test_logging
catch throw
run
$ gdb ./build/rcl/test/test_logging
$ catch throw
$ run

Automatic backtrace on crash
----------------------------
Expand Down
Loading