ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Checkout of packages into a catkin workspace

asked 2013-12-18 11:53:21 -0500

roadrunner gravatar image

I try to create a catkin workspace and add some packages from git-repositories to it. the manual process seems straight forward:

mkdir my_ws; cd my_ws; mkdir src; catkin_make
source devel/setup.bash
cd src
git clone <pkg1>; git clone <pkg2>; ...
cd ..
catkin_make

I'm a bit confused on which tools to use in order to make this a bit more user friendly. I tried

mkdir my_ws; cd my_ws; mkdir src;
rosinstall -c src pkg_1_to_N.rosinstall
catkin_make

But rosinstall creates a top-level CMakeLists.txt file different from catkin_make and the subsequent build fails. If I call catkin_make once before rosinstall, the rosinstall command fails trying to overwrite the CMakeLists.txt file, as the existing one is a link to /opt/ros/hydro/...

It seems like wstool is a replacement for rosws. But I did not yet find an example of how to use it as a replacement for rosinstall.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-12-18 12:46:35 -0500

William gravatar image

rosinstall needs to be called with --catkin if you do not want it to generate those files.

Another option is to use wstool, which is a refactoring of rosws for catkin workspaces.

http://wiki.ros.org/wstool

You can do a lot of things with wstool, like having it fetch your .rosinstall file's contents:

$ mkdir -p ~/my_ws
$ cd ~/my_ws
$ wstool init src /path/to/my.rosinstall -j8

This will fetch all the entries in the my.rosinstall file into the src folder and it will fetch up to 8 (-j8) in parallel.

Then you can just run catkin_make:

$ catkin_make

You can also use wstool to modify your "workspace", using it's other verbs:

$ wstool set -t src my_serial --git <a href="https://github.com/wjwwood/serial.git">https://github.com/wjwwood/serial.git</a> -v 1.1.6
$ wstool update -t src

This will add the git repo, at the specified version, to the workspace with a target folder in the workspace of my_serial. The update command will actually fetch the code. Notice that you must always specify the target workspace after the verb with -t src.

Hope that helps.

edit flag offensive delete link more

Comments

```wstools init src ...``` does the job. Great! Is ``wstools``` recommended to use instead of ```rosinstall``` & ```rosws```? It is kind of confusing to have those parallel tool chains that do almost, but not quite the same... Is `rosinstall --catkin` any different from `rosinstall -c`? From `rosinstall -h` it seems that `-c` is just the short version of `--catkin`. I also get the same error, as described above. Thanks!

roadrunner gravatar image roadrunner  ( 2013-12-18 13:18:02 -0500 )edit

`rosinstall` just operates on `.rosinstall` files, but used to do some extra stuff for `rosbuild`, which is why the `--catkin` flag is needed. `rosws` and `wstool` are for workspace management (so modifying and updating a folder with rosinstall behind the scenes). `rosws` is for rosbuild and `wstool` is for catkin. I would recommend using `wstool` for everything catkin and `rosinstall` or `rosws` for rosbuild.

William gravatar image William  ( 2013-12-18 14:18:51 -0500 )edit

Also, `wstool` is "for catkin", but really is meant to be completely ROS and catkin agnostic, just lets you maintain a workspace of many repositories of many types (git, hg, svn, tar).

William gravatar image William  ( 2013-12-18 14:20:10 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2013-12-18 11:53:21 -0500

Seen: 2,665 times

Last updated: Dec 18 '13