0
$\begingroup$

Rosanswers logo

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?


Originally posted by TechBoii on ROS Answers with karma: 36 on 2019-07-18

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by PeteBlackerThe3rd with karma: 9529 on 2019-07-18

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by stevemacenski on 2019-07-18:
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.

Comment by TechBoii on 2019-07-19:
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?

Comment by TechBoii on 2019-07-19:
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!

Comment by gvdhoorn on 2019-07-19:
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".

Comment by TechBoii on 2019-07-20:
@gvdhoorn Thanks for the lead, Would need to find out how to implement that then.

Cheers

$\endgroup$
0
$\begingroup$

Rosanswers logo

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/viewtopic.php?t=149927

Enjoy!


Originally posted by TechBoii with karma: 36 on 2019-07-25

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.