Ask Your Question
0

How to talk to two ROS devices over serial?

asked 2019-07-18 04:00:47 -0500

TechBoii gravatar image

updated 2019-07-19 04:50:48 -0500

Heya, I am quite new to ROS.

I have two independent raspberry pi running on ROS. Is it possible to communicate with each other over serial?

for eg: pi_1 will have a node to control a servo, LED and a counter. I would like the pi_2 to able to publish and subscribe to the nodes on pi_1 over serial.

Could someone give me leads to how I can implement this?
Is it rosserial that I am supposed to use? If so how can I communicate through two different ROS devices?

Do you have any other suggestion on implementing this?

Thanks in advance,

UPDATE(after the response):

In the current situation, I am not able to use ethernet as one pi is a drone and I would need more distance than wifi. I basically want to establish a connection with each other over wireless serial. like a base station and a drone.

So any other option than rosserial?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-07-25 09:06:55 -0500

TechBoii gravatar image

Heya, Thanks everyone for the support.

I did some research on @gvdhoorn advice. And I have successfully got the two Pi s speaking through serial ethernet. Now I think I can go forward the 'the typical ROS setup for multiple computers' route.

Follow the instructions if anyone would like to try: https://www.raspberrypi.org/forums/vi...

Enjoy!

edit flag offensive delete link more
2

answered 2019-07-18 09:33:33 -0500

updated 2019-07-19 06:57:00 -0500

ROS serial is designed to communicate between a ROS node and a simple peripheral device which isn't running ROS such as a micro-controller.

If you're trying to communicate between two ROS nodes running on two different raspberry Pis all you need to do is make sure that they are both on a shared network (Wi-Fi or ethernet) and then the distributed nature of ROS will handle everything for you automatically.

Is there any particular reason why you thought about using a serial connection for this?

Update

Okay I understand your task now. To be honest, you could do this with a much lower power device such as an arduino or teensy on the drone. A raspberry pi is overkill unless it's doing other work as well. I'll emphasise again ROSSerial doesn't connect ROS nodes together it connects peripheral devices to ROS.

Using an arduino you could follow the tutorials, the blink tutorial controls an LED which is one of your tasks. You should be able to extend this to control a servo as well.

edit flag offensive delete link more

Comments

In case the author isn't tied to serial and that's just an assumption of the right way -- you can put them both on the same network (ethernet) and then use the typical ROS setup for multiple computers.

stevemacenski gravatar imagestevemacenski ( 2019-07-18 15:01:44 -0500 )edit

Thanks, guys for the feedback.

In the current situation, I am not able to use ethernet as one pi is a drone and I would need more distance than wifi. I basically want to establish a connection with each other over wireless serial. like a base station and a drone.

So any other option than rosserial?

TechBoii gravatar imageTechBoii ( 2019-07-19 04:40:50 -0500 )edit

Well, I wanted an option to connect ROS nodes together over serial. If that is not possible, I think this is the next best thing!

Probably keep an Arduino in between the two ROS systems!

TechBoii gravatar imageTechBoii ( 2019-07-19 08:33:43 -0500 )edit
1

I'm not sure it'd be a good thing to use here, but it's actually possible to run regular TCP/IP over a serial line. Lookup "SLIP".

gvdhoorn gravatar imagegvdhoorn ( 2019-07-19 08:46:02 -0500 )edit

@gvdhoorn Thanks for the lead, Would need to find out how to implement that then.

Cheers

TechBoii gravatar imageTechBoii ( 2019-07-20 12:41:02 -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

1 follower

Stats

Asked: 2019-07-18 04:00:47 -0500

Seen: 81 times

Last updated: Jul 25