Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, you can just create an extra workspace.

Just make sure you don't have a source /path/to/your/first/catkin_ws/devel/setup.bash or similar line in your .bashrc, as that would cause you to overlay your new workspace on top of your old one.

Having sourced /opt/ros/$DISTRO/setup.bash when you create your new workspace is ok (and required, actually).

Is there an easier way such as creating a second catkin workspace and running rosinstall in that workspace?

Yes, you can just create an extra workspace.

Just make sure you don't have a source /path/to/your/first/catkin_ws/devel/setup.bash or similar line in your .bashrc, as that would cause you to overlay your new workspace on top of your old one.

Having sourced /opt/ros/$DISTRO/setup.bash when you create your new workspace is ok (and required, actually).

However ..

How can I test if my rosinstall file is complete (i.e. installing the packages according to rosinstall results in a working setup) without messing with my current catkin workspace?

On a machine that already has all the required packages installed (such as -- I assume -- your current installation), you can't actually test this (without first uninstalling everything). Some possible options:

  • use docker: re-use an existing image that has either no ROS, or a standard install. See wiki/docker.
  • if you're not comfortable with docker, you could use a chroot to essentially achieve the same, but with some more work. See wiki/ROS/Tutorials/InstallingIndigoInChroot (replace 'Indigo' with whatever release you're targeting).

As with both options you essentially get a 'clean slate', you can now check whether your .rosinstall file is complete.


PS: you probably know this, but a .rosinstall file is typically only used as a convenient way for your users to checkout many packages from source at once. If you just want to distribute a single package (or a single repository with multiple packages), and those packages depend only on other released packages, then it would be more convenient to either release your packages, or declare all dependencies in their manifests (package.xml) and have your users execute

rosdep install --from-paths /path/to/catkin_ws/src --ignore-src --rosdistro $DISTRO

as part of the installation procedure.

That would also automatically install all dependencies, and would be much faster then building them from source together with your own packages (this obviously only works for dependencies that have been released).