Ask Your Question
0

I want one ROS app to communicate multiple ROS controllers. Example?

asked 2017-09-26 13:43:19 -0500

rosnutsbolts gravatar image

I want one ROS app to communicate multiple ROS controllers. Need example since I am sure someone has already done this.

Basic ros::init (argc,argv,name,options) seems to read the environment flag for ROS_MASTER_URI.

So the other ros::init API must solve the problem, but can I get a complete example of special remappings like __name, __master, __ns, etc. that would handle multiple ROS masters? After each init I would then cache the node handle. And, what is this remapping list ?

And could I pass the ROS_MASTER_URI. as a remapping without calling the basic ros::init and relying on the shell environment variables?

TIA.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-09-27 02:23:47 -0500

gvdhoorn gravatar image

updated 2017-09-27 02:29:34 -0500

No, afaik this is not possible: there is a 1-to-1 mapping between nodes and processes in ROS1 as most important data structures are singletons / global.

Invoking ros::init(..) multiple times will not do what you want it to.

In ROS 2 this is different (ie: multiple nodes in a single process is expressly supported), but even there it will most likely require some magic with partitioning and other tricks.


Edit: could you maybe clarify what it is that you want to exactly? I'm not sure I understand what "I want one ROS app to communicate multiple ROS controllers" means.

It sounds like you're implying a client-server relationship between the master and any ROS nodes, but that doesn't exist.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-09-26 13:43:19 -0500

Seen: 59 times

Last updated: Sep 27 '17