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

Is there a way to interface multiple Arduinos with ROS and Raspberry Pi?

asked 2020-09-24 17:54:26 -0500

joshkindhart gravatar image

Is there a way to interface three or more Arduinos with a Raspberry Pi over i2c using Robot Operating System? I'm new to this. I see that the ROS rosserial protocol uses UART and that is for only two devices. Is there a way to chain Arduinos to a Raspberry Pi with ROS?

edit retag flag offensive close merge delete

Comments

I would not use ROS as underlying communication protocol with the Arduinos. Instead create your own communication protocol with I2C and write a node for the rpi which converts between the i2c protocol and ROS messages.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2020-09-25 06:35:15 -0500 )edit

Does no one build projects with more than 4 Arduino Mega's?

joshkindhart gravatar image joshkindhart  ( 2020-09-25 20:05:55 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2020-09-26 07:32:37 -0500

duck-development gravatar image

the pi has 4 usb ports so you connect those arduinos with usb cable . then starts 4 rosserial instances and you are a happy guy.

if you like to use i2c you have to programm a ros node witch handles the i2c to arduino communication and publisch the desired data to ros topics.

but an arduino side then there is no more ros specific code but only a i2c slave and you applicatioon code.

the rossrial way is the more generic, if you use this way.

edit flag offensive delete link more

Comments

srsly? One 8 Bit µC per USB port? I'm feeling very tired now.. This is really wasting a lot resources.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2020-09-26 13:57:39 -0500 )edit

a hub is cheap and you have a power for the mc. it is the simples and and fastes way to solve your problem. ros is not the resource but time saver. for rapid prototyping.

duck-development gravatar image duck-development  ( 2020-09-27 06:21:32 -0500 )edit

I didn't understand how to ask the question properly at the time. I think what I was needing is to use multiple pi's connected over ros with each pi as its own node and connect arduinos to each node.

joshkindhart gravatar image joshkindhart  ( 2020-10-02 22:58:49 -0500 )edit

You can use one pi to connect multible arduino. If you use the USB connection of the arduino. It will work out of box.

duck-development gravatar image duck-development  ( 2020-10-04 03:03:16 -0500 )edit
0

answered 2020-09-25 02:41:37 -0500

Nitesh_j gravatar image

updated 2020-09-25 03:27:51 -0500

hello, The Rosserial isn't restricted only for 2 two devices, please refer this,link text

edit flag offensive delete link more

Comments

Yes I see now that I was confused. Arduino Uno only has one serial port. That's why I can only talk between two devices. I see now with an Arduino Mega it has 4 serial ports.

joshkindhart gravatar image joshkindhart  ( 2020-09-25 19:56:15 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-09-24 17:52:04 -0500

Seen: 987 times

Last updated: Sep 26 '20