Skip to content

Commit c31371d

Browse files
Avoid confusion/conflict of package name (ros2#2192) (ros2#2203)
All previous URDF tutorials use https://github.com/ros/urdf_tutorial/tree/ros2, which is an ament_cmake package. People new to ROS(2) going through the URDF tutorials will likely be confused as "urdf_tutorial" already exists, being THE "urdf_tutorial" (https://github.com/ros/urdf_tutorial). Using "urdf_tutorial_r2d2" avoids this conflict and the resulting confusion. Perhaps it might even be better to use an entirely different name, e.g. moving_r2d2. If change is accepted here, this should also go onto other branches. (cherry picked from commit e1ef657) Co-authored-by: Andreas Bihlmaier <[email protected]>
1 parent b7ac788 commit c31371d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

source/Tutorials/URDF/Using-URDF-with-Robot-State-Publisher.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ Tasks
4040
4141
mkdir -p ~/dev_ws/src # change as needed
4242
cd ~/dev_ws/src
43-
ros2 pkg create urdf_tutorial --build-type ament_python --dependencies rclpy
44-
cd urdf_tutorial
43+
ros2 pkg create urdf_tutorial_r2d2 --build-type ament_python --dependencies rclpy
44+
cd urdf_tutorial_r2d2
4545
46-
You should now see a ``urdf_tutorial`` folder.
46+
You should now see a ``urdf_tutorial_r2d2`` folder.
4747
Next you will make several changes to it.
4848

4949
2 Create the URDF File
@@ -55,16 +55,16 @@ Create the directory where we will store some assets:
5555
5656
mkdir -p urdf
5757
58-
Download the :download:`URDF file <r2d2.urdf.xml>` and save it as ``~/dev_ws/src/urdf_tutorial/urdf/r2d2.urdf.xml``.
59-
Download the :download:`Rviz configuration file <r2d2.rviz>` and save it as ``~/dev_ws/src/urdf_tutorial/urdf/r2d2.rviz``.
58+
Download the :download:`URDF file <r2d2.urdf.xml>` and save it as ``~/dev_ws/src/urdf_tutorial_r2d2/urdf/r2d2.urdf.xml``.
59+
Download the :download:`Rviz configuration file <r2d2.rviz>` and save it as ``~/dev_ws/src/urdf_tutorial_r2d2/urdf/r2d2.rviz``.
6060

6161
3 Publish the state
6262
^^^^^^^^^^^^^^^^^^^
6363

6464
Now we need a method for specifying what state the robot is in.
6565
To do this, we must specify all three joints and the overall odometry.
6666

67-
Fire up your favorite editor and paste the following code into ``urdf_tutorial/state_publisher.py``
67+
Fire up your favorite editor and paste the following code into ``urdf_tutorial_r2d2/state_publisher.py``
6868

6969
.. code-block:: python
7070
@@ -178,7 +178,7 @@ Open your editor and paste the following code, saving it as ``launch/demo.launch
178178
179179
urdf_file_name = 'r2d2.urdf.xml'
180180
urdf = os.path.join(
181-
get_package_share_directory('urdf_tutorial'),
181+
get_package_share_directory('urdf_tutorial_r2d2'),
182182
urdf_file_name)
183183
with open(urdf, 'r') as infp:
184184
robot_desc = infp.read()
@@ -196,7 +196,7 @@ Open your editor and paste the following code, saving it as ``launch/demo.launch
196196
parameters=[{'use_sim_time': use_sim_time, 'robot_description': robot_desc}],
197197
arguments=[urdf]),
198198
Node(
199-
package='urdf_tutorial',
199+
package='urdf_tutorial_r2d2',
200200
executable='state_publisher',
201201
name='state_publisher',
202202
output='screen'),
@@ -233,7 +233,7 @@ Edit the ``setup.py`` file as follows:
233233
.. code-block:: python
234234
235235
'console_scripts': [
236-
'state_publisher = urdf_tutorial.state_publisher:main'
236+
'state_publisher = urdf_tutorial_r2d2.state_publisher:main'
237237
],
238238
239239
Save the ``setup.py`` file with your changes.
@@ -244,7 +244,7 @@ Save the ``setup.py`` file with your changes.
244244
.. code-block:: console
245245
246246
cd ~/dev_ws
247-
colcon build --symlink-install --packages-select urdf_tutorial
247+
colcon build --symlink-install --packages-select urdf_tutorial_r2d2
248248
source install/setup.bash
249249
250250
@@ -255,13 +255,13 @@ Launch the package
255255

256256
.. code-block:: console
257257
258-
ros2 launch urdf_tutorial demo.launch.py
258+
ros2 launch urdf_tutorial_r2d2 demo.launch.py
259259
260260
Open a new terminal, the run Rviz using
261261

262262
.. code-block:: console
263263
264-
rviz2 -d ~/dev_ws/install/urdf_tutorial/share/urdf_tutorial/r2d2.rviz
264+
rviz2 -d ~/dev_ws/install/urdf_tutorial_r2d2/share/urdf_tutorial_r2d2/r2d2.rviz
265265
266266
See the `User Guide <http://wiki.ros.org/rviz/UserGuide>`__ for details on how to use Rviz.
267267

0 commit comments

Comments
 (0)