Ask Your Question
0

Sending only one topic to another computer

asked 2018-03-13 22:29:18 -0500

michael1874888 gravatar image

Hello, We are trying to publish only one topic from raspberry pi to an offboard computer recently.The topic contains image data acquire by the onboard camera, and we want to use the data to calculate the control command. Setting our offboard computer as ROS Master seems not to be a good solution, because it would send all of the topics, and this may cause serious network delay.

Does anyone know how to send a single topic to another computer? Both raspberry pi and offboard computer are Ubuntu16.04, Kinetic

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2018-03-14 01:37:34 -0500

JamesGiller gravatar image

Setting our offboard computer as ROS Master seems not to be a good solution, because it would send all of the topics, and this may cause serious network delay.

I think the ROS Master is only responsible for setting up the initial peer-to-peer connection between a publisher/subscriber when calls are made to advertise/subscribe, then the communicating nodes send and receive messages directly over TCP. Therefore, you should only have to think about topics published by nodes on the Raspberry Pi and subscribed to by nodes on the offboard computer or vice-versa, not all of the topics in your whole system.

edit flag offensive delete link more

Comments

Yes, you're right. I'm new to ROS. I may have misunderstood some basic concepts. However, when I perform formation control, some topics seem to have lost information. Is this related to the setting of queue and buffer?

michael1874888 gravatar image michael1874888  ( 2018-03-14 21:33:40 -0500 )edit

In order to help, I need to know what exactly do you mean by "lost information"? If you think you chose the wrong queue size, have a look at this: http://wiki.ros.org/rospy/Overview/Pu...

It's a rospy page, but still applicable to C++.

JamesGiller gravatar image JamesGiller  ( 2018-03-14 22:02:59 -0500 )edit
1

answered 2018-03-14 03:58:54 -0500

Femer gravatar image

Hi,

I think you should have a look at multimaster.

With multimaster you can have two different roscores running on your machines and decide which topics you want to exchange between them. You can have either a one way communication or a two way comminucation.

For instance, if you have your machines M1 and M2, and three topics: T1, T2, T3, you can easily set up the following scenario:

M1 --- T1 ---> M2

M1 <--- T2 --- M2

M1 <--- T3 ---> M2

I have some launch file examples in my repo on Bitbucket.

Regards,

Marco.

edit flag offensive delete link more

Comments

1

Multimaster is definitely interesting, but I believe the OP has a basic misunderstanding of how ROS works which has led him to post this question. Let's see if we can clear that up first.

+1 for suggesting multimaster though, it can be helpful in situations with remote robots.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-14 04:01:43 -0500 )edit

Thanks! We will give it a try.

michael1874888 gravatar image michael1874888  ( 2018-03-14 21:35:07 -0500 )edit

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-03-13 22:29:18 -0500

Seen: 450 times

Last updated: Mar 14 '18