Skip to content

Commit bb02769

Browse files
authored
use ROS_DISTRO env value instead of <ros2-distro>. (#863)
* use ROS_DISTRO env value instead of <ros2-distro>. Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com> * make sure to source ROS 2 workspace setup script. Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com> --------- Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com> Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
1 parent 72a9d30 commit bb02769

11 files changed

Lines changed: 116 additions & 30 deletions

getting_started/index.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,33 @@ Jazzy introduced the new Gazebo modern simulator, replacing Gazebo Classic.
2424
Thus, for Jazzy and newer, the installation packages and instructions are slightly different to pull in the appropriate packages.
2525

2626
1. Install the `ROS 2 binary packages <https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html>`_ as described in the official docs
27-
2. Install the |PN| packages using your operating system's package manager:
27+
2. Source your ROS 2 installation to set up the environment:
2828

2929
.. code-block:: bash
3030
31-
sudo apt install ros-<ros2-distro>-navigation2
32-
sudo apt install ros-<ros2-distro>-nav2-bringup
31+
source /opt/ros/<ros2-distro>/setup.bash
32+
33+
3. Install the |PN| packages using your operating system's package manager:
34+
35+
.. code-block:: bash
36+
37+
sudo apt install ros-$ROS_DISTRO-navigation2
38+
sudo apt install ros-$ROS_DISTRO-nav2-bringup
3339
34-
3. Install the demo robot (Turtlebot) for gazebo:
40+
4. Install the demo robot (Turtlebot) for gazebo:
3541

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

3844
.. code-block:: bash
3945
40-
sudo apt install ros-<ros2-distro>-nav2-minimal-tb*
46+
sudo apt install ros-$ROS_DISTRO-nav2-minimal-tb*
4147
4248
4349
For **Iron and older**, install Turtlebot 3 packages for gazebo classic:
4450

4551
.. code-block:: bash
4652
47-
sudo apt install ros-<ros2-distro>-turtlebot3-gazebo
53+
sudo apt install ros-$ROS_DISTRO-turtlebot3-gazebo
4854
4955
Running the Example
5056
*******************
@@ -56,7 +62,7 @@ Running the Example
5662
5763
source /opt/ros/<ros2-distro>/setup.bash
5864
export TURTLEBOT3_MODEL=waffle # Iron and older only with Gazebo Classic
59-
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/<ros2-distro>/share/turtlebot3_gazebo/models # Iron and older only with Gazebo Classic
65+
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/$ROS_DISTRO/share/turtlebot3_gazebo/models # Iron and older only with Gazebo Classic
6066
6167
3. In the same terminal, run:
6268

setup_guides/odom/setup_odom_gz.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,17 @@ Setup and Prerequisites
7979

8080
`Gazebo <http://gazebosim.org/>`_ is a 3D simulator that allows us to observe how our virtual robot will function in a simulated environment. To start using Gazebo with ROS 2, follow the installation instructions in the `Gazebo Installation Documentation <https://gazebosim.org/docs/latest/ros_installation/>`_.
8181

82+
First, source your ROS 2 installation to set the environment variables:
83+
84+
.. code-block:: shell
85+
86+
source /opt/ros/<ros2-distro>/setup.bash
87+
88+
Then install the ROS-Gazebo integration package:
89+
8290
.. code-block:: shell
8391
84-
sudo apt install ros-<ros2-distro>-ros-gz
92+
sudo apt install ros-$ROS_DISTRO-ros-gz
8593
8694
Adding Gazebo Plugins to a URDF/SDF
8795
===================================

setup_guides/odom/setup_odom_gz_classic.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,17 @@ Setup and Prerequisites
7777

7878
`Gazebo <http://classic.gazebosim.org/>`_ is a 3D simulator that allows us to observe how our virtual robot will function in a simulated environment. To start using Gazebo with ROS 2, follow the installation instructions in the `Gazebo Installation Documentation <http://classic.gazebosim.org/tutorials?cat=install>`_.
7979

80-
We also need to install the ``gazebo_ros_pkgs`` package to simulate odometry and control the robot with ROS 2 in Gazebo:
80+
First, source your ROS 2 installation to set the environment variables:
8181

8282
.. code-block:: shell
8383
84-
sudo apt install ros-<ros2-distro>-gazebo-ros-pkgs
84+
source /opt/ros/<ros2-distro>/setup.bash
85+
86+
Then install the ``gazebo_ros_pkgs`` package to simulate odometry and control the robot with ROS 2 in Gazebo:
87+
88+
.. code-block:: shell
89+
90+
sudo apt install ros-$ROS_DISTRO-gazebo-ros-pkgs
8591
8692
You can test if you have successfully set up your ROS 2 and Gazebo environments by following the instructions `given here <http://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#TestingGazeboandROS2integration>`_.
8793

setup_guides/odom/setup_robot_localization.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,17 @@ Configuring Robot Localization
2525

2626
Let us now configure the ``robot_localization`` package to use an Extended Kalman Filter (``ekf_node``) to fuse odometry information and publish the ``odom`` => ``base_link`` transform.
2727

28-
First, install the ``robot_localization`` package using your machines package manager or by executing the following command:
28+
First, source your ROS 2 installation to set the environment variables:
2929

3030
.. code-block:: shell
3131
32-
sudo apt install ros-<ros2-distro>-robot-localization
32+
source /opt/ros/<ros2-distro>/setup.bash
33+
34+
Then install the ``robot_localization`` package:
35+
36+
.. code-block:: shell
37+
38+
sudo apt install ros-$ROS_DISTRO-robot-localization
3339
3440
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.
3541

setup_guides/sdf/setup_sdf.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,17 @@ SDF is a file format for simulators, like Gazebo, that describes the simulator e
1515

1616
We can also use our SDF with the robot_state_publisher using the following package. You will see how to do this in the tutorial below.
1717

18+
First, source your ROS 2 installation to set the environment variables:
19+
20+
.. code-block:: shell
21+
22+
source /opt/ros/<ros2-distro>/setup.bash
23+
24+
Then install the sdformat-urdf package:
25+
1826
.. code-block:: shell
1927
20-
sudo apt install ros-<ros2-distro>-sdformat-urdf
28+
sudo apt install ros-$ROS_DISTRO-sdformat-urdf
2129
2230
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.
2331

setup_guides/sensors/mapping_localization.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ To be able to launch ``slam_toolbox``, make sure that you have installed the ``s
165165

166166
.. code-block:: shell
167167
168-
sudo apt install ros-<ros2-distro>-slam-toolbox
168+
sudo apt install ros-$ROS_DISTRO-slam-toolbox
169169
170170
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:
171171

@@ -197,8 +197,8 @@ First, Make sure you have installed the Nav2 packages by executing the following
197197

198198
.. code-block:: shell
199199
200-
sudo apt install ros-<ros2-distro>-navigation2
201-
sudo apt install ros-<ros2-distro>-nav2-bringup
200+
sudo apt install ros-$ROS_DISTRO-navigation2
201+
sudo apt install ros-$ROS_DISTRO-nav2-bringup
202202
203203
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:
204204

setup_guides/urdf/setup_urdf.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,18 @@ In this guide, we are assuming that you are already familiar with ROS 2 and how
3131

3232
Let's begin by installing some additional ROS 2 packages that we will be using during this tutorial.
3333

34+
First, source your ROS 2 installation to set the environment variables:
35+
36+
.. code-block:: shell
37+
38+
source /opt/ros/<ros2-distro>/setup.bash
39+
40+
Then install the required packages:
41+
3442
.. code-block:: shell
3543
36-
sudo apt install ros-<ros2-distro>-joint-state-publisher-gui
37-
sudo apt install ros-<ros2-distro>-xacro
44+
sudo apt install ros-$ROS_DISTRO-joint-state-publisher-gui
45+
sudo apt install ros-$ROS_DISTRO-xacro
3846
3947
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``.
4048

tutorials/docs/camera_calibration.rst

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,26 @@ This tutorial shows how to obtain calibration parameters for monocular camera.
1616
Requirements
1717
============
1818

19-
1- Install Camera Calibration Parser, Camera Info Manager and Launch Testing Ament Cmake using operating system’s package manager:
19+
1- First, source your ROS 2 installation to set the environment variables:
2020

21-
``sudo apt install ros-<ros2-distro>-camera-calibration-parsers``
21+
.. code-block:: shell
2222
23-
``sudo apt install ros-<ros2-distro>-camera-info-manager``
23+
source /opt/ros/<ros2-distro>/setup.bash
2424
25-
``sudo apt install ros-<ros2-distro>-launch-testing-ament-cmake``
25+
2- Install Camera Calibration Parser, Camera Info Manager and Launch Testing Ament Cmake:
2626

27+
.. code-block:: shell
2728
28-
2- Image Pipeline need to be built from source in your workspace with:
29+
sudo apt install ros-$ROS_DISTRO-camera-calibration-parsers
30+
sudo apt install ros-$ROS_DISTRO-camera-info-manager
31+
sudo apt install ros-$ROS_DISTRO-launch-testing-ament-cmake
2932
30-
``git clone -b <ros2-distro> git@github.com:ros-perception/image_pipeline.git``
33+
34+
3- Image Pipeline need to be built from source in your workspace with:
35+
36+
.. code-block:: shell
37+
38+
git clone -b $ROS_DISTRO git@github.com:ros-perception/image_pipeline.git
3139
3240
3341
**Also, make sure you have the following:**

tutorials/docs/navigation2_on_real_turtlebot3.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,17 @@ If you don't have them installed, please follow :ref:`getting_started`.
3232

3333
The turtlebot3 software can be installed via the following or on the `turtlebot3 repository <https://github.com/ROBOTIS-GIT/turtlebot3>`_:
3434

35+
First, source your ROS 2 installation to set the environment variables:
36+
37+
.. code-block:: bash
38+
39+
source /opt/ros/<ros2-distro>/setup.bash
40+
41+
Then install the Turtlebot3 packages:
42+
3543
.. code-block:: bash
3644
37-
sudo apt install ros-<ros2-distro>-turtlebot3 ros-<ros2-distro>-turtlebot3-msgs ros-<ros2-distro>-turtlebot3-bringup
45+
sudo apt install ros-$ROS_DISTRO-turtlebot3 ros-$ROS_DISTRO-turtlebot3-msgs ros-$ROS_DISTRO-turtlebot3-bringup
3846
3947
Tutorial Steps
4048
==============

tutorials/docs/navigation2_with_slam.rst

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,23 @@ Requirements
2525
You must install Navigation2, Turtlebot3, and SLAM Toolbox.
2626
If you don't have them installed, please follow :ref:`getting_started`.
2727

28+
First, source your ROS 2 installation to set the environment variables:
29+
30+
.. code-block:: bash
31+
32+
source /opt/ros/<ros2-distro>/setup.bash
33+
2834
SLAM Toolbox can be installed via:
2935

30-
``sudo apt install ros-<ros2-distro>-slam-toolbox``
36+
.. code-block:: bash
37+
38+
sudo apt install ros-$ROS_DISTRO-slam-toolbox
3139
3240
or from built from source in your workspace with:
3341

34-
``git clone -b <ros2-distro>-devel git@github.com:stevemacenski/slam_toolbox.git``
42+
.. code-block:: bash
43+
44+
git clone -b $ROS_DISTRO-devel git@github.com:stevemacenski/slam_toolbox.git
3545
3646
3747
Tutorial Steps
@@ -43,9 +53,17 @@ Tutorial Steps
4353
For this tutorial, we will use the turtlebot3.
4454
The turtlebot3 software can be installed via the following or on the `turtlebot3 repository <https://github.com/ROBOTIS-GIT/turtlebot3>`_:
4555

56+
First, source your ROS 2 installation to set the environment variables:
57+
58+
.. code-block:: bash
59+
60+
source /opt/ros/<ros2-distro>/setup.bash
61+
62+
Then install the Turtlebot3 packages:
63+
4664
.. code-block:: bash
4765
48-
sudo apt install ros-<ros2-distro>-turtlebot3 ros-<ros2-distro>-turtlebot3-msgs ros-<ros2-distro>-turtlebot3-bringup
66+
sudo apt install ros-$ROS_DISTRO-turtlebot3 ros-$ROS_DISTRO-turtlebot3-msgs ros-$ROS_DISTRO-turtlebot3-bringup
4967
5068
If you have another robot, replace with your robot specific interfaces.
5169
Typically, this includes the robot state publisher of the URDF, simulated or physical robot interfaces, controllers, safety nodes, and the like.

0 commit comments

Comments
 (0)