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

Read sensors from different roscores.

asked 2011-05-04 05:08:23 -0600

Daniel gravatar image

I have a bunch of robots with a separate roscore running on each of them. Now I would like to connect from a C++ application to every robot and read its sensor values. I saw the rosmultimaster package which seems to provide a python API to do exactly what I want. But is there also a way to connect to more than one core at once with the C++ API?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2011-05-04 20:49:00 -0600

Lorenz gravatar image

You could relay some topics from one master to another master. A tool for doing that is somewhere in the WG repostiory:

https://code.ros.org/svn/ros/stacks/multimaster_experimental/trunk/foreign_relay

For instance, if you have one robot with master uri A and another one with master uri B, you can set up the relay by running the following command on A:

rosrun foreign_relay foreign_relay adv http://B:11311 /a/laser /laser

It will basically advertise the topic /a/laser on B.

edit flag offensive delete link more

Comments

It is not really what I had in mind, but I will give it a try. Thank you very much.
Daniel gravatar image Daniel  ( 2011-05-05 03:14:28 -0600 )edit
1

answered 2011-05-04 06:01:29 -0600

raphael favier gravatar image

Hello Daniel,

do you really need to run a different core for each robot or could you move toward one unique roscore running through your system of different machines?

The later solution is very easy to implement as the only step needed is seting the system variables ROS_IP and ROS_MASTER_URI on all your machines without having to modify any code. Check that page for more info.

Raph

edit flag offensive delete link more

Comments

Hey Raph, thanks for your answer. I already thought about this. Unfortunately all robots should work autonomously and they are just linked with a very unstable wireless LAN connection which often breaks. So its not really an option to use a single core. Daniel
Daniel gravatar image Daniel  ( 2011-05-04 21:27:09 -0600 )edit

Question Tools

Stats

Asked: 2011-05-04 05:08:23 -0600

Seen: 971 times

Last updated: May 04 '11