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

Can I execute several nodes belong to different workspaces?

asked 2018-02-26 20:45:08 -0500

jsk gravatar image

I want to use several workspaces.

But sometimes I need to execute several nodes from the package which are belonging to the different workspaces. (My point is that I don't want workspace overlapping structure. I want to execute several nodes those are totally not included in the same workspace)

Is it possible to pub, and sub between those nodes? Even if their package belongs to the different workspace?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-02-27 00:57:16 -0500

mgruhler gravatar image

Yes, this is possible. They only have to share one ROS master. You have to source the respective Workspace in the terminal where you launch the nodes, though.

However, IMO, this is not what you should do. This could easily lead to strange behaviour as it could take, e.g., some stuff from workspace1 in one terminal, and from /opt/ros in a second. This is why you typically do workspace overlaying. Why don't you want to do that?

edit flag offensive delete link more

Comments

I'm now writing high dof controller based on RBDL in one workspace. But I also want to write the high dof control based on different library. Thus, I want to write the new controller in the new workspace, but I still want to use the ros control and gazebo simulation environment included in first ws.

jsk gravatar image jsk  ( 2018-02-27 02:56:18 -0500 )edit

This is the reason why I want to use the several nodes from different workspace. You mean that, if I source respective workspace in each nodes terminal, then there will be work and it will not make any weird behavior. Is my understanding okay?

jsk gravatar image jsk  ( 2018-02-27 02:56:57 -0500 )edit

And, Thanks for your answer :D

jsk gravatar image jsk  ( 2018-02-27 02:57:13 -0500 )edit
2

None of what you write makes overlaying impossible / undesirable, but as @mig writes, you can definitely start nodes from completely stand-alone workspaces. You just can't start them from the same launch file, as roslaunch will not be able to find the nodes from the other workspace.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-27 02:57:53 -0500 )edit

@gvdhoorn If I use the totally independent terminals and source each workspace in each terminal, there will be no problem when executing and communicating several nodes from several workspace.(Obviously under one roscore) This sentence can be a wrap up sentence?

Thanks for your knowledge sharing:D

jsk gravatar image jsk  ( 2018-02-27 03:05:41 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-02-26 20:45:08 -0500

Seen: 1,873 times

Last updated: Feb 27 '18