ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# How exactly does .rosinstall work?

I'm a bit unclear on how .rosinstall works.

I realize that a standard version gets installed when I first installed ros (though I'm not sure whether easyinstall or rosinstall does that). A couple of things I don't quite understand:

1. How do upgrades work? Do the .rosinstall file need to be manually edited to change a version number? (Some of the packages in .rosinstall don't have version numbers, so how does that work?) Or does the rosinstall command somehow take care of updates? I can also use svn directly to upgrade certain packages, but then will re-running rosinstall not revert those upgrades by over-writing the svn ugrades?

2. If I want to use rosinstall to install other packages, how should I do that? Create another .rosinstall file with a different name or add new lines to the existing .rosinstall? And if I do make another .rosinstall, can I use the rosinstall command for one and not adversely affect the other set of installed packages?

edit retag close merge delete

Sort by » oldest newest most voted

The .rosinstall file is generated when rosinstall is executed. (Except the .rosinstall files in /opt/ros/*/.rosinstall are generated by the debbuilding infrastructure.)

1) When executed rosinstall will generate a new .rosinstall which is the union of the existing .rosinstall and rosinstall files on the command line. Before writing out the .rosinstall file the entries will be deduplicated based on local-name. If you run rosinstall . it will make sure that you have exactly what's listed in the .rosinstall file, with the same version as listed. If you change the .rosinstall file manually before executing it will follow the edited version. If you have changed an svn checkout manually it will try to return the checkout to the version in the .rosinstall file, unless you change the .rosinstall file to correspond. (PS rosinstall version 0.5.15 has an interactive skip option to not change a locally changed checkout)

The recommended way to update is to call rosinstall . "updated_rosinstall_file"

where updated_rosinstall_file would be something manually maintained or a generated file like "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=desktop-full&overlay=no" The new rules for each local-name will override the corresponding old rules.

2) Similarly to updating to add a package or stacks to an existing rosinstalled directory, just pass a rosinstall file with those packages to rosinstall rosinstall . new_packages.rosinstall and they will be added to the .rosinstall in directory "."

Adding the lines to .rosinstall is also valid. Then rerun rosinstall like this rosinstall .

To add build a rosinstall on top of another one without changing an existing checkout you will want to use another directory. Then you can use rosinstall . /other_checkout/path local.rosinstall` as long as /other_checkout/path contains a .rosinstall file. This will add the contents of the /othere_checkout/path as "other" elements in the .rosinstall file in "."

As always later arguments will be earlier on the ROS_PACKAGE_PATH.

more

Very helpful! rosinstall help says that the command format is "rosinstall PATH [URI] [options]" but it looks like it's "rosinstall MAIN-ROSINSTALL-PATH PATH [URI] [options]" There are certainly two paths in the command you give: . and /other_checkout/path
( 2011-02-26 05:49:02 -0500 )edit
Another question as I continue to think about this: if I do update my .rosinstall by the recommended method you give, what happens exactly? Is .rosinstall replaced or are only the corresponding lines replaced (determined by local, I imagine)?
( 2011-02-26 06:15:10 -0500 )edit
I've updated the answer for the correspondance. A path is a subset of a uri. You can pass n many of them into rosinstall. I've updated the usage to use [URI]...
( 2011-02-26 12:37:01 -0500 )edit