Skip to content

Add $ to Installation/Alternatives #5354

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 3 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
79 changes: 41 additions & 38 deletions source/Installation/Alternatives/RHEL-Development-Setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Enable required repositories
The rosdep database contains packages from the EPEL and PowerTools repositories, which are not enabled by default.
They can be enabled by running:

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

sudo dnf install 'dnf-command(config-manager)' epel-release -y
sudo dnf config-manager --set-enabled crb
$ sudo dnf install 'dnf-command(config-manager)' epel-release -y
$ sudo dnf config-manager --set-enabled crb

.. note:: This step may be slightly different depending on the distribution you are using.
`Check the EPEL documentation <https://docs.fedoraproject.org/en-US/epel/#_quickstart>`_
Expand All @@ -54,9 +54,9 @@ Enable required repositories
Install development tools
^^^^^^^^^^^^^^^^^^^^^^^^^

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

sudo dnf install -y \
$ sudo dnf install -y \
cmake \
gcc-c++ \
git \
Expand All @@ -76,9 +76,9 @@ Install development tools
python3-vcstool \
wget

# install some pip packages needed for testing and
# not available as RPMs
python3 -m pip install -U --user \
~ install some pip packages needed for testing and
~ not available as RPMs
$ python3 -m pip install -U --user \
flake8-blind-except==0.1.1 \
flake8-class-newline \
flake8-deprecated
Expand All @@ -91,22 +91,22 @@ Get ROS 2 code

Create a workspace and clone all repos:

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

mkdir -p ~/ros2_{DISTRO}/src
cd ~/ros2_{DISTRO}
vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src
$ mkdir -p ~/ros2_{DISTRO}/src
$ cd ~/ros2_{DISTRO}
$ vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src

Install dependencies using rosdep
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. include:: ../_Dnf-Update-Admonition.rst

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

sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-7.3.0 urdfdom_headers"
$ sudo rosdep init
$ rosdep update
$ rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-7.3.0 urdfdom_headers"

Install additional RMW implementations (optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -124,47 +124,50 @@ The output should be empty.

More info on working with a ROS workspace can be found in :doc:`this tutorial <../../Tutorials/Beginner-Client-Libraries/Colcon-Tutorial>`.

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

cd ~/ros2_{DISTRO}/
colcon build --symlink-install
$ cd ~/ros2_{DISTRO}/
$ colcon build --symlink-install

.. note::

If you are having trouble compiling all examples and this is preventing you from completing a successful build, you can use the ``--packages-skip`` colcon flag to ignore the package that is causing problems.
For instance, if you don't want to install the large OpenCV library, you could skip building the packages that depend on it using the command:

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

colcon build --symlink-install --packages-skip image_tools intra_process_demo
$ colcon build --symlink-install --packages-skip image_tools intra_process_demo

Setup environment
-----------------

Set up your environment by sourcing the following file.

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

# Replace ".bash" with your shell if you're not using bash
# Possible values are: setup.bash, setup.sh, setup.zsh
. ~/ros2_{DISTRO}/install/local_setup.bash
$ . ~/ros2_{DISTRO}/install/local_setup.bash

.. note::

Replace ``.bash`` with your shell if you're not using bash.
Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``.

Try some examples
-----------------

In one terminal, source the setup file and then run a C++ ``talker``\ :

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

. ~/ros2_{DISTRO}/install/local_setup.bash
ros2 run demo_nodes_cpp talker
$ . ~/ros2_{DISTRO}/install/local_setup.bash
$ ros2 run demo_nodes_cpp talker

In another terminal source the setup file and then run a Python ``listener``\ :

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

. ~/ros2_{DISTRO}/install/local_setup.bash
ros2 run demo_nodes_py listener
$ . ~/ros2_{DISTRO}/install/local_setup.bash
$ ros2 run demo_nodes_py listener

You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages.
This verifies both the C++ and Python APIs are working properly.
Expand All @@ -186,12 +189,12 @@ Clang

To configure CMake to detect and use Clang:

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

sudo dnf install clang
export CC=clang
export CXX=clang++
colcon build --cmake-force-configure
$ sudo dnf install clang
$ export CC=clang
$ export CXX=clang++
$ colcon build --cmake-force-configure

Stay up to date
---------------
Expand All @@ -211,6 +214,6 @@ Uninstall

2. If you're also trying to free up space, you can delete the entire workspace directory with:

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

rm -rf ~/ros2_{DISTRO}
$ rm -rf ~/ros2_{DISTRO}
63 changes: 33 additions & 30 deletions source/Installation/Alternatives/RHEL-Install-Binary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ Enable required repositories
The rosdep database contains packages from the EPEL and PowerTools repositories, which are not enabled by default.
They can be enabled by running:

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

sudo dnf install 'dnf-command(config-manager)' epel-release -y
sudo dnf config-manager --set-enabled crb
$ sudo dnf install 'dnf-command(config-manager)' epel-release -y
$ sudo dnf config-manager --set-enabled crb

.. note:: This step may be slightly different depending on the distribution you are using.
`Check the EPEL documentation <https://docs.fedoraproject.org/en-US/epel/#_quickstart>`_
Expand All @@ -49,18 +49,18 @@ Install prerequisites

There are a few packages that must be installed in order to get and unpack the binary release.

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

sudo dnf install tar bzip2 wget -y
$ sudo dnf install tar bzip2 wget -y

Install development tools (optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you are going to build ROS packages or otherwise do development, you can also install the development tools:

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

sudo dnf install -y \
$ sudo dnf install -y \
cmake \
gcc-c++ \
git \
Expand All @@ -77,9 +77,9 @@ If you are going to build ROS packages or otherwise do development, you can also
python3-vcstool \
wget

# install some pip packages needed for testing and
# not available as RPMs
python3 -m pip install -U --user \
~ install some pip packages needed for testing and
~ not available as RPMs
$ python3 -m pip install -U --user \
flake8-blind-except==0.1.1 \
flake8-class-newline \
flake8-deprecated
Expand All @@ -96,22 +96,22 @@ Instead you may download nightly :ref:`prerelease binaries <Prerelease_binaries>

* Unpack it:

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

mkdir -p ~/ros2_{DISTRO}
cd ~/ros2_{DISTRO}
tar xf ~/Downloads/ros2-package-linux-x86_64.tar.bz2
$ mkdir -p ~/ros2_{DISTRO}
$ cd ~/ros2_{DISTRO}
$ tar xf ~/Downloads/ros2-package-linux-x86_64.tar.bz2

Install dependencies using rosdep
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. include:: ../_Dnf-Update-Admonition.rst

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

sudo rosdep init
rosdep update
rosdep install --from-paths ~/ros2_{DISTRO}/ros2-linux/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastrtps iceoryx_binding_c rti-connext-dds-7.3.0 urdfdom_headers"
$ sudo rosdep init
$ rosdep update
$ rosdep install --from-paths ~/ros2_{DISTRO}/ros2-linux/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastrtps iceoryx_binding_c rti-connext-dds-7.3.0 urdfdom_headers"

Install additional RMW implementations (optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -124,28 +124,31 @@ Setup environment

Set up your environment by sourcing the following file.

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

# Replace ".bash" with your shell if you're not using bash
# Possible values are: setup.bash, setup.sh, setup.zsh
. ~/ros2_{DISTRO}/ros2-linux/setup.bash
$ . ~/ros2_{DISTRO}/ros2-linux/setup.bash

.. note::

Replace ``.bash`` with your shell if you're not using bash.
Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``.

Try some examples
-----------------

In one terminal, source the setup file and then run a C++ ``talker``:

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

. ~/ros2_{DISTRO}/ros2-linux/setup.bash
ros2 run demo_nodes_cpp talker
$ . ~/ros2_{DISTRO}/ros2-linux/setup.bash
$ ros2 run demo_nodes_cpp talker

In another terminal source the setup file and then run a Python ``listener``:

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

. ~/ros2_{DISTRO}/ros2-linux/setup.bash
ros2 run demo_nodes_py listener
$ . ~/ros2_{DISTRO}/ros2-linux/setup.bash
$ ros2 run demo_nodes_py listener

You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages.
This verifies both the C++ and Python APIs are working properly.
Expand All @@ -169,6 +172,6 @@ Uninstall

2. If you're also trying to free up space, you can delete the entire workspace directory with:

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

rm -rf ~/ros2_{DISTRO}
$ rm -rf ~/ros2_{DISTRO}
Loading