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

Revision history [back]

It is possible to use a message from one workspace in another. What you need to do to achieve this is to set up chained (or overlayed) workspaces. ROS is looking through the ROS_PACKAGE_PATH, which is something along the lines of <WORKSPACE_B>:<WORKSPACE_A>:/opt/ros/<DISTRO>/share (if you are using catkin_make).

Basically, you do something similar every time you create a workspace, by overlaying the /opt/ros packages with your source workspace.

The first match found is the one that is used, then.

So, basically, depending on how you set up your workspaces, this might very well happen. In the above scenario, you can use a message from workspace A in workspace B __as long as__ there is not the same package available in workspace B. Note that is important that you always use fully qualified message identifiers (i.e. including the package name <my_pkg>/MyMsg whereever you use those packages).

To directly answer your questions:

So is it true that one message type previously built in a catkin workspace can be seen and used in another?

Yes, absolutely.

Also it might override the local message type with the same name?

No, this cannot happen (as long as building the "local" message worked out fine, the name including the package is identical and you've sourced the right workspace in every terminal you want to use)