Skip to content

Add $ to How-To-Guides #5353

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

Merged
merged 6 commits into from
Apr 27, 2025
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
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:: console
.. code-block:: bash

$ 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
6 changes: 3 additions & 3 deletions source/How-To-Guides/Building-a-Custom-Deb-Package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Install dependencies

Run the following command to install utilities needed for the build:

.. code:: bash
.. code:: console

$ sudo apt install python3-bloom python3-rosdep fakeroot debhelper dh-python

Expand All @@ -32,7 +32,7 @@ Initialize rosdep

Initialize the rosdep database by calling:

.. code:: bash
.. code:: console

$ sudo rosdep init
$ rosdep update
Expand All @@ -44,7 +44,7 @@ Build the deb from the package

Run the following commands to build the deb:

.. code:: bash
.. code:: console

$ cd /path/to/pkg_source # this should be the directory that contains the package.xml
$ bloom-generate rosdebian
Expand Down
8 changes: 4 additions & 4 deletions source/How-To-Guides/Core-maintainer-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ A source release creates a changelog and a tag in the relevant repository.

The process starts by generating or updating CHANGELOG.rst files with the following command:

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

$ catkin_generate_changelog

Expand All @@ -117,7 +117,7 @@ Once editing is done, it is important to commit the updated CHANGELOG.rst file t

The next step is to bump the version in the package.xml and the changelog files with the following command:

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

$ catkin_prepare_release

Expand All @@ -136,13 +136,13 @@ The next step is to use the ``bloom-release`` command to create a binary release
For full instructions on how to use bloom, please see http://wiki.ros.org/bloom.
To do a binary release of a repository, run:

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

$ bloom-release --track <rosdistro> --rosdistro <rosdistro> <repository_name>

For instance, to release the ``rclcpp`` repository to the {DISTRO_TITLE} distribution, the command would be:

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

$ bloom-release --track {DISTRO} --rosdistro {DISTRO} rclcpp

Expand Down
10 changes: 5 additions & 5 deletions source/How-To-Guides/DDS-tuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ Because of the increased serialization overhead, severe performance degradation
**Workaround:** Use multiple arrays of primitives instead of a single array of custom types, or pack into byte array as done e.g. in ``PointCloud2`` messages.
For example, instead of defining a ``FooArray`` message as:

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

Foo[] my_large_array

with ``Foo`` is defined as:

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

uint64 foo_1
uint32 foo_2

Instead, define ``FooArray`` as:

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

uint64[] foo_1_array
uint32[] foo_2_array
Expand Down Expand Up @@ -116,7 +116,7 @@ Set the maximum receive buffer size, ``rmem_max``, by running:

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

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

net.core.rmem_max=2147483647

Expand All @@ -136,7 +136,7 @@ Next, to set the minimum socket receive buffer size that Cyclone requests, write

Then, whenever you are going to run a node, set the following environment variable:

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

CYCLONEDDS_URI=file:///absolute/path/to/config_file.xml

Expand Down
4 changes: 2 additions & 2 deletions source/How-To-Guides/Getting-Backtraces-in-ROS-2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Once your program crashes, it will return a gdb session prompt denoted by ``(gdb
At this prompt you can access the information you're interested in.
However, since this is a ROS project with lots of node configurations and other things going on, this isn't a great option for beginners or those that don't like tons of commandline work and understanding the filesystem.

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

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

Expand Down Expand Up @@ -143,7 +143,7 @@ This is because GDB, when launched this way, lacks the environment setup that no
Rather than having to revert to finding the install path of the executable and typing it all out, we can instead use ``--prefix``.
This allows us to use the same ``ros2 run`` syntax you're used to without having to worry about some of the GDB details.

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This package is in a catkin workspace, located at ``~/ros1_talker``.

Your ROS 1 workspace has the following directory layout:

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

$ cd ~/ros1_talker
$ find .
Expand Down Expand Up @@ -104,7 +104,7 @@ Let's start by creating a new workspace in which to work:

We'll copy the source tree from our ROS 1 package into that workspace, where we can modify it:

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

$ mkdir src
$ cp -a ~/ros1_talker/src/talker src
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ First, create a folder at ``~/ros2_talker_py`` to be the root of the Colcon work

.. group-tab:: macOS

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

$ mkdir -p ~/ros2_talker_py/src

.. group-tab:: Windows

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

$ md \ros2_talker_py\src

Expand Down Expand Up @@ -76,7 +76,7 @@ Next, create the files for the ROS 1 package.

.. group-tab:: Windows

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

$ cd \ros2_talker_py
$ md src\talker_py\src\talker_py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To change a node name use ``__node`` (the ROS 1 equivalent is ``__name``):
Note the use of the ``-r`` flag.
The same remap flag is needed for changing the namespace ``__ns``:

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

$ ros2 run some_package some_ros_executable --ros-args -r __ns:=/new/namespace

Expand Down
8 changes: 4 additions & 4 deletions source/How-To-Guides/ROS-2-IDEs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ Resolve this by:

* Making sure the ``PATH`` override in the run/debug configuration includes both the ROS 2 install and your workspace, e.g.:

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

C:\dev\ros2_humble\local_setup.ps1
C:\dev_ws\install\local_setup.ps1
echo $ENV:Path
$ C:\dev\ros2_humble\local_setup.ps1
$ C:\dev_ws\install\local_setup.ps1
$ echo $ENV:Path

* Adding the relevant folders from the ``install/`` directory to your project sources.

Expand Down
8 changes: 4 additions & 4 deletions source/How-To-Guides/Releasing/First-Time-Release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Generate Changelog

Generate a ``CHANGELOG.rst`` file per package in your repo using the following command:

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

catkin_generate_changelog --all
$ catkin_generate_changelog --all

.. include:: _Clean-Up-Changelog.rst

Expand All @@ -59,9 +59,9 @@ Bloom Release

Run the following command, replacing ``my_repo`` with the name of your repository:

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

bloom-release --new-track --rosdistro {DISTRO} --track {DISTRO} my_repo
$ bloom-release --new-track --rosdistro {DISTRO} --track {DISTRO} my_repo

.. tip::

Expand Down
2 changes: 1 addition & 1 deletion source/How-To-Guides/Releasing/Subsequent-Releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Bloom Release

Run the following command, replacing ``my_repo`` with the name of your repository with the packages:

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

$ bloom-release --rosdistro {DISTRO} my_repo

Expand Down
4 changes: 2 additions & 2 deletions source/How-To-Guides/Releasing/_Bump-Package-Version.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Every release of the package must have a unique version number higher than the previous release.
Run:

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

catkin_prepare_release
$ catkin_prepare_release

which performs the following:

Expand Down
6 changes: 3 additions & 3 deletions source/How-To-Guides/Releasing/_Install-Dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ Install tools that you will use in the upcoming steps according to your platform

.. group-tab:: RPM (e.g. RHEL)

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

$ sudo dnf install python3-bloom python3-catkin_pkg

.. group-tab:: Other

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

$ pip3 install -U bloom catkin_pkg

Make sure you have rosdep initialized:

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

$ sudo rosdep init
$ rosdep update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Now you can check if the installation was successful by running the following co

.. code-block:: console

docker run hello-world
$ docker run hello-world

You might need to start the Docker Daemon first, if you cannot run hello-world out of the box:

Expand Down
46 changes: 31 additions & 15 deletions source/How-To-Guides/Working-with-multiple-RMW-implementations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,48 @@ For example, to run the talker demo using the C++ talker and Python listener wit

.. group-tab:: Linux

.. code-block:: bash

RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_cpp talker
Run in one terminal:

# Run in another terminal
RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_py listener
.. code-block:: console

$ RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_cpp talker

Run in another terminal:

.. code-block:: console

$ RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_py listener

.. group-tab:: macOS

.. code-block:: bash
Run in one terminal:

.. code-block:: console

$ RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_cpp talker

RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_cpp talker
Run in another terminal:

# Run in another terminal
RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_py listener
.. code-block:: console

$ RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_py listener

.. group-tab:: Windows

.. code-block:: bat
Run in one terminal:

.. code-block:: console

$ set RMW_IMPLEMENTATION=rmw_connextdds
$ ros2 run demo_nodes_cpp talker

set RMW_IMPLEMENTATION=rmw_connextdds
ros2 run demo_nodes_cpp talker
Run in another terminal:

REM run in another terminal
set RMW_IMPLEMENTATION=rmw_connextdds
ros2 run demo_nodes_py listener
.. code-block:: console

$ set RMW_IMPLEMENTATION=rmw_connextdds
$ ros2 run demo_nodes_py listener

Adding RMW implementations to your workspace
--------------------------------------------
Expand Down Expand Up @@ -164,7 +180,7 @@ To increase the settings permanently, you will need to edit or create the file `
Creating or editing this file will require root permissions.
Either add to your existing ``etc/sysctl.conf`` file or create ``/etc/sysctl.conf`` with the following lines:

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

kern.sysv.shmmax=419430400
kern.sysv.shmmin=1
Expand Down