diff --git a/source/How-To-Guides/Ament-CMake-Documentation.rst b/source/How-To-Guides/Ament-CMake-Documentation.rst index d1022cee2e..d8a3c6b4d5 100644 --- a/source/How-To-Guides/Ament-CMake-Documentation.rst +++ b/source/How-To-Guides/Ament-CMake-Documentation.rst @@ -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: diff --git a/source/How-To-Guides/Building-a-Custom-Deb-Package.rst b/source/How-To-Guides/Building-a-Custom-Deb-Package.rst index 034a954567..3672167a89 100644 --- a/source/How-To-Guides/Building-a-Custom-Deb-Package.rst +++ b/source/How-To-Guides/Building-a-Custom-Deb-Package.rst @@ -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 @@ -32,7 +32,7 @@ Initialize rosdep Initialize the rosdep database by calling: -.. code:: bash +.. code:: console $ sudo rosdep init $ rosdep update @@ -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 diff --git a/source/How-To-Guides/Core-maintainer-guide.rst b/source/How-To-Guides/Core-maintainer-guide.rst index 6743129ec8..c740e2c58f 100644 --- a/source/How-To-Guides/Core-maintainer-guide.rst +++ b/source/How-To-Guides/Core-maintainer-guide.rst @@ -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 @@ -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 @@ -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 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 diff --git a/source/How-To-Guides/DDS-tuning.rst b/source/How-To-Guides/DDS-tuning.rst index a368a2ceb9..f890dd7461 100644 --- a/source/How-To-Guides/DDS-tuning.rst +++ b/source/How-To-Guides/DDS-tuning.rst @@ -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 @@ -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 @@ -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 diff --git a/source/How-To-Guides/Getting-Backtraces-in-ROS-2.rst b/source/How-To-Guides/Getting-Backtraces-in-ROS-2.rst index b364731118..c66f5799d7 100755 --- a/source/How-To-Guides/Getting-Backtraces-in-ROS-2.rst +++ b/source/How-To-Guides/Getting-Backtraces-in-ROS-2.rst @@ -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 @@ -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' --all-other-launch arguments diff --git a/source/How-To-Guides/Migrating-from-ROS1/Migrating-CPP-Package-Example.rst b/source/How-To-Guides/Migrating-from-ROS1/Migrating-CPP-Package-Example.rst index 213742a4b5..72fc4bdf82 100644 --- a/source/How-To-Guides/Migrating-from-ROS1/Migrating-CPP-Package-Example.rst +++ b/source/How-To-Guides/Migrating-from-ROS1/Migrating-CPP-Package-Example.rst @@ -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 . @@ -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 diff --git a/source/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Package-Example.rst b/source/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Package-Example.rst index 6e0637b5fb..4e47427286 100644 --- a/source/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Package-Example.rst +++ b/source/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Package-Example.rst @@ -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 @@ -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 diff --git a/source/How-To-Guides/Migrating-from-ROS1/Migrating-Scripts.rst b/source/How-To-Guides/Migrating-from-ROS1/Migrating-Scripts.rst index 196a47616e..a0b4d1686f 100644 --- a/source/How-To-Guides/Migrating-from-ROS1/Migrating-Scripts.rst +++ b/source/How-To-Guides/Migrating-from-ROS1/Migrating-Scripts.rst @@ -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 diff --git a/source/How-To-Guides/ROS-2-IDEs.rst b/source/How-To-Guides/ROS-2-IDEs.rst index 0931f41c1a..06601c64de 100644 --- a/source/How-To-Guides/ROS-2-IDEs.rst +++ b/source/How-To-Guides/ROS-2-IDEs.rst @@ -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. diff --git a/source/How-To-Guides/Releasing/First-Time-Release.rst b/source/How-To-Guides/Releasing/First-Time-Release.rst index 351a3c9712..9e4a459dbe 100644 --- a/source/How-To-Guides/Releasing/First-Time-Release.rst +++ b/source/How-To-Guides/Releasing/First-Time-Release.rst @@ -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 @@ -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:: diff --git a/source/How-To-Guides/Releasing/Subsequent-Releases.rst b/source/How-To-Guides/Releasing/Subsequent-Releases.rst index 85bec40153..8d56c5c5d4 100644 --- a/source/How-To-Guides/Releasing/Subsequent-Releases.rst +++ b/source/How-To-Guides/Releasing/Subsequent-Releases.rst @@ -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 diff --git a/source/How-To-Guides/Releasing/_Bump-Package-Version.rst b/source/How-To-Guides/Releasing/_Bump-Package-Version.rst index 4652d104d5..6b90600ba9 100644 --- a/source/How-To-Guides/Releasing/_Bump-Package-Version.rst +++ b/source/How-To-Guides/Releasing/_Bump-Package-Version.rst @@ -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: diff --git a/source/How-To-Guides/Releasing/_Install-Dependencies.rst b/source/How-To-Guides/Releasing/_Install-Dependencies.rst index 859a1c5557..8b69dca153 100644 --- a/source/How-To-Guides/Releasing/_Install-Dependencies.rst +++ b/source/How-To-Guides/Releasing/_Install-Dependencies.rst @@ -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 diff --git a/source/How-To-Guides/Setup-ROS-2-with-VSCode-and-Docker-Container.rst b/source/How-To-Guides/Setup-ROS-2-with-VSCode-and-Docker-Container.rst index b5cdc0ad53..02d6150d0f 100644 --- a/source/How-To-Guides/Setup-ROS-2-with-VSCode-and-Docker-Container.rst +++ b/source/How-To-Guides/Setup-ROS-2-with-VSCode-and-Docker-Container.rst @@ -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: diff --git a/source/How-To-Guides/Working-with-multiple-RMW-implementations.rst b/source/How-To-Guides/Working-with-multiple-RMW-implementations.rst index 3ba532db0d..492c1dbc88 100644 --- a/source/How-To-Guides/Working-with-multiple-RMW-implementations.rst +++ b/source/How-To-Guides/Working-with-multiple-RMW-implementations.rst @@ -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 -------------------------------------------- @@ -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