Skip to content

Commit 4dcf077

Browse files
committed
Start guide on determinine if dependencies are available in ROS 2
Signed-off-by: Shane Loretz <shane.loretz@gmail.com>
1 parent fcf9bc5 commit 4dcf077

File tree

3 files changed

+139
-1
lines changed

3 files changed

+139
-1
lines changed

source/How-To-Guides/Migrating-from-ROS1.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ If you are new to porting between ROS 1 and ROS 2, it is recommended to read thr
88
:maxdepth: 1
99

1010
Migrating-from-ROS1/Migrating-Packages
11+
Migrating-from-ROS1/Migrating-Dependencies
1112
Migrating-from-ROS1/Migrating-Package-XML
1213
Migrating-from-ROS1/Migrating-Interfaces
1314
Migrating-from-ROS1/Migrating-CPP-Package-Example
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
Migrating Dependencies
2+
======================
3+
4+
This page shows you how to tell if all of your ROS 1 package's dependencies are available in ROS 2.
5+
6+
.. contents:: Table of Contents
7+
:depth: 2
8+
:local:
9+
10+
Prerequisites
11+
-------------
12+
13+
This page assumes you have a Linux machine with :doc:`rosdep </Tutorials/Intermediate/Rosdep>` installed.
14+
15+
Why do dependencies matter?
16+
---------------------------
17+
18+
Virtually all ROS packages depend on something.
19+
A package that needs the transform between two points probably depends on ``tf2``.
20+
A package that installs URDF files probably needs ``xacro``.
21+
No package can work without its dependencies, so when you want to migrate any package to ROS 2 you must make sure all of its dependencies are available first.
22+
23+
What ROS distro are you targeting?
24+
----------------------------------
25+
26+
TODO this guide assumes you're targeting ROS {DISTRO}.
27+
28+
Determine your package's dependencies
29+
-------------------------------------
30+
31+
If you want to know what your package depends on, then read it's ``package.xml``.
32+
Every package's ``package.xml`` file must list that package's dependencies.
33+
34+
However, there are two kinds of dependencies in ROS, and the difference is important when deciding if your package is ready to be migrated to ROS 2.
35+
36+
* a ROS package
37+
* a rosdep key
38+
39+
A ROS package is exactly what it sounds like; your ROS package may depend on one or more other ROS packages.
40+
A rosdep key is different.
41+
It describes a system dependency.
42+
For example, `tf2 <https://index.ros.org/p/tf2/>`__ is a ROS package, while `eigen <https://index.ros.org/d/eigen/>`__ is a rosdep key.
43+
Read :doc:`the tutorial on rosdep </Tutorials/Intermediate/Rosdep>` to learn more.
44+
45+
Is it a rosdep key or a package?
46+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47+
48+
TODO use the rosdep keys command followed by the rosdep resolve command
49+
50+
.. tabs::
51+
52+
.. group-tab:: Linux
53+
54+
.. code-block:: bash
55+
56+
cd /tmp
57+
git clone https://github.com/ros/geometry2.git
58+
rosdep keys --from-paths /tmp/geometry2/tf2_kdl | xargs rosdep resolve --os=ubuntu:focal --rosdistro=noetic
59+
60+
61+
TODO if the package to be installed starts with `ros-distro`, then it's a ROS package. Otherwise it's a ROSDep key
62+
63+
.. tabs::
64+
65+
.. group-tab:: Linux
66+
67+
.. code-block:: bash
68+
69+
$ rosdep keys --from-paths /tmp/geometry2/tf2_kdl | xargs rosdep resolve --os=ubuntu:focal --rosdistro=noetic
70+
#ROSDEP[eigen]
71+
#apt
72+
libeigen3-dev
73+
#ROSDEP[cmake_modules]
74+
#apt
75+
ros-noetic-cmake-modules
76+
#ROSDEP[tf2_ros]
77+
#apt
78+
ros-noetic-tf2-ros
79+
#ROSDEP[catkin]
80+
#apt
81+
ros-noetic-catkin
82+
#ROSDEP[rostest]
83+
#apt
84+
ros-noetic-rostest
85+
#ROSDEP[liborocos-kdl-dev]
86+
#apt
87+
liborocos-kdl-dev
88+
#ROSDEP[tf2]
89+
#apt
90+
ros-noetic-tf2
91+
#ROSDEP[ros_environment]
92+
#apt
93+
ros-noetic-ros-environment
94+
95+
96+
Check if a rosdep key is available
97+
----------------------------------
98+
99+
TODO It matters what OS you're using. We're deling with ssytem deps after all
100+
101+
Check if a ROS package is available
102+
-----------------------------------
103+
104+
TODO Searching ROS Index for the given ROS distro
105+
106+
107+
Has this ROS package been replaced?
108+
-----------------------------------
109+
110+
Some packages haven't been migrated to ROS 2 because they were replaced with something better.
111+
If you can't find a package in the ROS Index, then check the table below to see if it has a replacement.
112+
113+
TODO move_base -> nav2, ... what else?
114+
115+
.. list-table:: Equivalent packages in ROS 1 and ROS 2
116+
:widths: 25 25
117+
:header-rows: 1
118+
119+
* - ROS 1
120+
- ROS 2
121+
* - catkin
122+
- ament_cmake_ros
123+
* - roscpp
124+
- rclcpp
125+
* - roslaunch
126+
- launch_ros
127+
* - rospy
128+
- rclpy
129+
130+
Conclusion
131+
----------
132+
133+
You now know if all of your package's dependencies are available in ROS 2.
134+
If any dependency is not available, you must migrate it first.
135+
Head back to :doc:`Migrating Packages <./Migrating-Packages>` to learn how to migrate it.

source/How-To-Guides/Migrating-from-ROS1/Migrating-Packages.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ There are two different kinds of package migrations:
1515
Prerequisites
1616
-------------
1717

18-
Before being able to migrate a ROS 1 package to ROS 2 all of its dependencies must be available in ROS 2.
18+
Virtually all ROS packages depend on at least one other package, and no package can be migrated to ROS 2 until its dependencies are available.
19+
Are all of your package's dependencies available in ROS 2?
20+
Read the :doc:`Migrating Dependencies guide <./Migrating-Dependencies>` to learn how to figure that out.
1921

2022
Package.xml format version
2123
--------------------------

0 commit comments

Comments
 (0)