-
Notifications
You must be signed in to change notification settings - Fork 1
Pandoradep
pandoradep
is a python tool to manage PANDORA's dependencies. It is a standalone tool and can be found here. You can install it either from source or using pip
. For instructions refer to the README.
The need for a tool to manage our dependencies, declared in each package's package.xml
file, led us to the development of pandoradep
. Natively, ROS can resolve and install debian dependencies using rosdep. In order to resolve non-debian dependencies (from source) there are rosinstall and wstool which, when combined, can fetch the appropriate dependencies in order to build a package from source.
So, pandoradep
is a tool that is capable of scanning one or multiple packages and according to their declared dependencies (in the package.xml) can create an appropriate rosinstall
file in order to be used later by wstool
.
In order to know where to find each dependency, it needs to keep track of every PANDORA repo and the packages that contains. That information is available through this YAML file. That file gets updated every time we sync our private repos with our public one (when someone pushes to our stable branch hydro-devel
, Jenkins manages the sync).
The case that we cover here is that we have already fetched a repo that we are interested in and we now want to build it. In order to build it, aside from other dependencies we need to fetch other PANDORA repos that this package depends on. In our example we want to build the vision package.
NOTE: A more detailed guide on how to fetch and compile our packages can be found [here](Setup Packages). This is a guide on how to use pandoradep
.
First we create a workspace:
$ mkdir -p ~/pandora_ws/src
$ cd ~/pandora_ws/src
$ wstool init .
Then we clone the repo that contains PANDORA's vision packages:
$ git clone git@github.com:pandora-auth-ros-pkg/pandora_vision.git
Now we are going to use pandoradep
in order to fetch dependencies:
$ pandoradep scan . > deps.rosinstall
$ wstool merge deps.rosinstall
$ wstool update
The command pandoradep scan
will output the dependencies to stdout, in a rosintall friendly format. In our case we will get something like:
- git: {local-name: pandora_vision, uri: 'git@github.com:pandora-auth-ros-pkg/pandora_vision.git', version: hydro-devel}
- git: {local-name: pandora_common, uri: 'git@github.com:pandora-auth-ros-pkg/pandora_common.git', version: hydro-devel}
Since we would like to use wstool
in order to fetch the appropriate repos, we are writing the output of pandoradep
to a file, in order to use it later with wstool
.
We need to install debian dependencies as well, in order to be able to compile the packages:
$ cd ..
$ rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO
Finally, we are ready to compile our code:
$ catkin_make
If we need, in the future to fetch updates from our dependencies, we can run in ~/pandora_ws/src
:
$ wstool update
Lets say that we have made some fixes in the state_manager
package that also affect vision packages. In order to test the changes before releasing them we have created a branch named fix-this
in both pandora_vision
and pandora_common
repos. Now we have to change the package.xml
of each package that depends on pandora_common
like so:
...
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>cv_bridge</build_depend>
<build_depend>image_transport</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>pandora_vision_msgs</build_depend>
<build_depend version_eq="fix-this">state_manager</build_depend>
<build_depend>state_manager_msgs</build_depend>
<build_depend>dynamic_reconfigure</build_depend>
...
The above, is a way to notify pandoradep
that we need the state_manager
package, but we need the version that resides in the fix-this
branch. This is very useful for our Continuous Integration schema, as it can test branches different than hydro-devel
. Because it is not very helpful when we are working in out PC (since we are only cloning packages once), we should not forget to remove the version_eq
tag when the fix-this
branch has been merged to hydro-devel
.
For complete command line reference you can type pandoradep --help
:
Usage: pandoradep [OPTIONS] COMMAND [ARGS]...
A tiny cli tool to manage PANDORA's dependencies.
Options:
--version Return the current version.
--help Show this message and exit.
Commands:
create Creates a repos.yml file, mapping each package to the corresponding repo. [used by CI]
scan Scans the directory tree for dependencies.
update Updates dependencies [used by CI]