Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Common Nav2 Dependencies Build Failures
* Make sure that .bashrc file has no ROS environment variables in it. Open new terminals and try to build the packages again.

* Make sure to run rosdep for the correct ROS 2 distribution.
``rosdep install -y -r -q --from-paths src --ignore-src --rosdistro <ros2-distro>``
``rosdep install -y -r -q --from-paths src --ignore-src --rosdistro $ROS_DISTRO``

* Make sure that the ``setup.bash`` is sourced in the ROS 2 installation or ROS 2 main build workspace, if applicable. Check if you can run talker and listener nodes.

Expand Down
12 changes: 6 additions & 6 deletions getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ Thus, for Jazzy and newer, the installation packages and instructions are slight

.. code-block:: bash

sudo apt install ros-<ros2-distro>-navigation2
sudo apt install ros-<ros2-distro>-nav2-bringup
sudo apt install ros-$ROS_DISTRO-navigation2
sudo apt install ros-$ROS_DISTRO-nav2-bringup

3. Install the demo robot (Turtlebot) for gazebo:

For **Jazzy and newer**, install the Turtlebot 3 & 4 packages for Gazebo Modern. It should be automatically installed with ``nav2_bringup``:

.. code-block:: bash

sudo apt install ros-<ros2-distro>-nav2-minimal-tb*
sudo apt install ros-$ROS_DISTRO-nav2-minimal-tb*


For **Iron and older**, install Turtlebot 3 packages for gazebo classic:

.. code-block:: bash

sudo apt install ros-<ros2-distro>-turtlebot3-gazebo
sudo apt install ros-$ROS_DISTRO-turtlebot3-gazebo

Running the Example
*******************
Expand All @@ -54,9 +54,9 @@ Running the Example

.. code-block:: bash

source /opt/ros/<ros2-distro>/setup.bash
source /opt/ros/$ROS_DISTRO/setup.bash
Copy link
Member

@SteveMacenski SteveMacenski Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A note: the ROS_DISTRO env variable isn't set before you source the setup.bash file, so that would not be in your environment yet to work. This is actually true of several of the changes in this PR.

Do you think that may cause more problems than it solves if when using ROS_DISTRO when not set it will return an empty string? I feel like that might confuse users if they get errors trying to access source /opt/ros//setup.bash or apt install ros--gazebo-ros-pkgs because the variable is not set

Copy link
Author

@glitchhopcore glitchhopcore Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you are right, it would definitely make it more confusing.
Furthermore for places like build_docs/index.rst, we seem to source /opt/ros/<distro>/setup.bash, do you think we should suggest users to have setup.bash sourced before running the commands wherever I have mentioned the changes, or do you think there is a better way to handle this, or if it is alright as it is?


For Iron and Older
==================

.. code:: bash

  source /opt/ros/<distro>/setup.bash
  sudo apt install \
    ros-$ROS_DISTRO-navigation2 \
    ros-$ROS_DISTRO-nav2-bringup \
    ros-$ROS_DISTRO-turtlebot3*

For Jazzy and Newer
===================

.. code:: bash

  source /opt/ros/<distro>/setup.bash
  sudo apt install \
    ros-$ROS_DISTRO-navigation2 \
    ros-$ROS_DISTRO-nav2-bringup \
    ros-$ROS_DISTRO-nav2-minimal-tb*

Build
*****

Copy link
Member

@SteveMacenski SteveMacenski Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would help for this case, but I think for all cases where you need to source (at least), then we would need to not use ROS_DISTRO. I think that counts for more than just in the build docs -- it might be worth looking over your changes and see for what other situations we haven't yet told the user to source the setup script and add that too (or leave as-is)

export TURTLEBOT3_MODEL=waffle # Iron and older only with Gazebo Classic
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/<ros2-distro>/share/turtlebot3_gazebo/models # Iron and older only with Gazebo Classic
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/$ROS_DISTRO/share/turtlebot3_gazebo/models # Iron and older only with Gazebo Classic

3. In the same terminal, run:

Expand Down
2 changes: 1 addition & 1 deletion setup_guides/odom/setup_odom_gz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Setup and Prerequisites

.. code-block:: shell
sudo apt install ros-<ros2-distro>-ros-gz
sudo apt install ros-$ROS_DISTRO-ros-gz
Adding Gazebo Plugins to a URDF/SDF
===================================
Expand Down
2 changes: 1 addition & 1 deletion setup_guides/odom/setup_odom_gz_classic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ We also need to install the ``gazebo_ros_pkgs`` package to simulate odometry and

.. code-block:: shell
sudo apt install ros-<ros2-distro>-gazebo-ros-pkgs
sudo apt install ros-$ROS_DISTRO-gazebo-ros-pkgs
You can test if you have successfully set up your ROS 2 and Gazebo environments by following the instructions `given here <http://gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#TestingGazeboandROS2integration>`_.

Expand Down
2 changes: 1 addition & 1 deletion setup_guides/odom/setup_robot_localization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ First, install the ``robot_localization`` package using your machines package ma

.. code-block:: shell
sudo apt install ros-<ros2-distro>-robot-localization
sudo apt install ros-$ROS_DISTRO-robot-localization
Next, we specify the parameters of the ``ekf_node`` using a YAML file. Create a directory named ``config`` at the root of your project and create a file named ``ekf.yaml``. Copy the following lines of code into your ``ekf.yaml`` file.

Expand Down
2 changes: 1 addition & 1 deletion setup_guides/sdf/setup_sdf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ We can also use our SDF with the robot_state_publisher using the following packa

.. code-block:: shell
sudo apt install ros-<ros2-distro>-sdformat-urdf
sudo apt install ros-$ROS_DISTRO-sdformat-urdf
This package contains a C++ library and urdf_parser_plugin for converting SDFormat XML into URDF C++ structures. Installing it allows one to use SDFormat XML instead of URDF XML as a robot description.

Expand Down
6 changes: 3 additions & 3 deletions setup_guides/sensors/mapping_localization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ To be able to launch ``slam_toolbox``, make sure that you have installed the ``s

.. code-block:: shell

sudo apt install ros-<ros2-distro>-slam-toolbox
sudo apt install ros-$ROS_DISTRO-slam-toolbox

We will launch the ``async_slam_toolbox_node`` of ``slam_toolbox`` using the package's built-in launch files. Open a new terminal and then execute the following lines:

Expand Down Expand Up @@ -199,8 +199,8 @@ First, Make sure you have installed the Nav2 packages by executing the following

.. code-block:: shell

sudo apt install ros-<ros2-distro>-navigation2
sudo apt install ros-<ros2-distro>-nav2-bringup
sudo apt install ros-$ROS_DISTRO-navigation2
sudo apt install ros-$ROS_DISTRO-nav2-bringup

We will now launch Nav2 using the ``nav2_bringup``'s built-in launch file, ``navigation_launch.py`` . Open a new terminal and execute the following:

Expand Down
4 changes: 2 additions & 2 deletions setup_guides/urdf/setup_urdf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Let's begin by installing some additional ROS 2 packages that we will be using d

.. code-block:: shell
sudo apt install ros-<ros2-distro>-joint-state-publisher-gui
sudo apt install ros-<ros2-distro>-xacro
sudo apt install ros-$ROS_DISTRO-joint-state-publisher-gui
sudo apt install ros-$ROS_DISTRO-xacro
Next, create a directory for your project, initialize a ROS 2 workspace and give your robot a name. For ours, we'll be calling it ``sam_bot``.

Expand Down
8 changes: 4 additions & 4 deletions tutorials/docs/camera_calibration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ Requirements

1- Install Camera Calibration Parser, Camera Info Manager and Launch Testing Ament Cmake using operating system’s package manager:

``sudo apt install ros-<ros2-distro>-camera-calibration-parsers``
``sudo apt install ros-$ROS_DISTRO-camera-calibration-parsers``

``sudo apt install ros-<ros2-distro>-camera-info-manager``
``sudo apt install ros-$ROS_DISTRO-camera-info-manager``

``sudo apt install ros-<ros2-distro>-launch-testing-ament-cmake``
``sudo apt install ros-$ROS_DISTRO-launch-testing-ament-cmake``


2- Image Pipeline need to be built from source in your workspace with:

``git clone -b <ros2-distro> [email protected]:ros-perception/image_pipeline.git``
``git clone -b $ROS_DISTRO [email protected]:ros-perception/image_pipeline.git``


**Also, make sure you have the following:**
Expand Down
4 changes: 2 additions & 2 deletions tutorials/docs/navigation2_on_real_turtlebot3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The turtlebot3 software can be installed via the following or on the `turtlebot3

.. code-block:: bash
sudo apt install ros-<ros2-distro>-turtlebot3 ros-<ros2-distro>-turtlebot3-msgs ros-<ros2-distro>-turtlebot3-bringup
sudo apt install ros-$ROS_DISTRO-turtlebot3 ros-$ROS_DISTRO-turtlebot3-msgs ros-$ROS_DISTRO-turtlebot3-bringup
Tutorial Steps
==============
Expand All @@ -44,7 +44,7 @@ Tutorial Steps

Run the following commands first whenever you open a new terminal during this tutorial.

- ``source /opt/ros/<ros2-distro>/setup.bash``
- ``source /opt/ros/$ROS_DISTRO/setup.bash``
- ``export TURTLEBOT3_MODEL=waffle``

1- Launch Turtlebot 3
Expand Down
2 changes: 1 addition & 1 deletion tutorials/docs/navigation2_with_gps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ It is assumed ROS2 and Nav2 dependent packages are installed or built locally. A

.. code-block:: bash
source /opt/ros/<ros2-distro>/setup.bash
source /opt/ros/$ROS_DISTRO/setup.bash
sudo apt install ros-$ROS_DISTRO-robot-localization
sudo apt install ros-$ROS_DISTRO-mapviz
sudo apt install ros-$ROS_DISTRO-mapviz-plugins
Expand Down
8 changes: 4 additions & 4 deletions tutorials/docs/navigation2_with_slam.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ If you don't have them installed, please follow :ref:`getting_started`.

SLAM Toolbox can be installed via:

``sudo apt install ros-<ros2-distro>-slam-toolbox``
``sudo apt install ros-$ROS_DISTRO-slam-toolbox``

or from built from source in your workspace with:

``git clone -b <ros2-distro>-devel [email protected]:stevemacenski/slam_toolbox.git``
``git clone -b $ROS_DISTRO-devel [email protected]:stevemacenski/slam_toolbox.git``


Tutorial Steps
Expand All @@ -45,14 +45,14 @@ The turtlebot3 software can be installed via the following or on the `turtlebot3

.. code-block:: bash
sudo apt install ros-<ros2-distro>-turtlebot3 ros-<ros2-distro>-turtlebot3-msgs ros-<ros2-distro>-turtlebot3-bringup
sudo apt install ros-$ROS_DISTRO-turtlebot3 ros-$ROS_DISTRO-turtlebot3-msgs ros-$ROS_DISTRO-turtlebot3-bringup
If you have another robot, replace with your robot specific interfaces.
Typically, this includes the robot state publisher of the URDF, simulated or physical robot interfaces, controllers, safety nodes, and the like.

Run the following commands first whenever you open a new terminal during this tutorial.

- ``source /opt/ros/<ros2-distro>/setup.bash``
- ``source /opt/ros/$ROS_DISTRO/setup.bash``
- ``export TURTLEBOT3_MODEL=waffle``


Expand Down
4 changes: 2 additions & 2 deletions tutorials/docs/navigation2_with_stvl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ Follow the same process as in :ref:`getting_started` for installing and setting

STVL can be installed in ROS 2 via the ROS Build Farm:

- ``sudo apt install ros-<ros2-distro>-spatio-temporal-voxel-layer``
- ``sudo apt install ros-$ROS_DISTRO-spatio-temporal-voxel-layer``

It can also be built from source by cloning the repository into your Navigation2 workspace:

- ``git clone -b <ros2-distro>-devel [email protected]:stevemacenski/spatio_temporal_voxel_layer``
- ``git clone -b $ROS_DISTRO-devel [email protected]:stevemacenski/spatio_temporal_voxel_layer``

1- Modify Navigation2 Parameter
-------------------------------
Expand Down