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

How to interface an Arduino with ROS?

asked 2015-12-14 09:00:08 -0600

Cerin gravatar image

updated 2015-12-14 15:53:34 -0600

I'm trying to control a few Arduinos (Uno and Leonardo) from ROS. What's the "right" way to do this?

I started with Rosserial, by following the simple Blink tutorial. It installed and compiled just fine, but much to my surprise, Rosserial simply doesn't work. First, the compiled hex file consumes almost 75% of the Arduino's memory...so I'd have almost nothing left for my application code. Second, it can't actually communicate with the host. Attempting to run serial_node.py fails with the error:

Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

My PC is a fresh install of Ubuntu 14.04 with Indigo, so I'm sure it's not a version mismatch. Googling this error shows it's a bug in Rosserial related to it being unable to handle certain Arduino USB interfaces, which has gone unresolved for years and has several open bug reports filed for it.

I spent six hours trying to figure this out, and got nowhere. So then I tried implementing the same "blink" functionality with a simple pure Arduino+Python interface using Pyserial....and got it to work in 10 minutes.

Unfortunately, this has been my experience with ROS in general. It claims to make your life easier, but it has a huge learning curve and even after you read through all the docs and follow all the steps without error...it still doesn't work very well. Am I missing something here? If ROS can't even blink and LED, why should I rely on it for anything more complicated?

edit retag flag offensive close merge delete

Comments

hi, have you rebuild and installed the ros_lib for arduino http://wiki.ros.org/rosserial_arduino...

inflo gravatar image inflo  ( 2015-12-14 09:37:51 -0600 )edit

No, I tried that, but catkin_make through a ton of errors, so I just installed the ubuntu packages for indigo.

Cerin gravatar image Cerin  ( 2015-12-14 15:52:19 -0600 )edit

is there a reason not to use jade?

inflo gravatar image inflo  ( 2015-12-14 16:13:47 -0600 )edit

Yes, I'm using Ubuntu 14.04 and am not in a position to upgrade my entire computer just to tinker around with ROSSerial.

Cerin gravatar image Cerin  ( 2015-12-14 17:49:07 -0600 )edit

Just an FYI: Jade is supported on Trusty (see REP-003). There is no need to upgrade your OS.

gvdhoorn gravatar image gvdhoorn  ( 2015-12-18 02:17:54 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-12-18 00:38:59 -0600

robotSamir gravatar image

Look into ros_arduino_bridge . It uses a lot less memory on the arduino.

edit flag offensive delete link more
0

answered 2015-12-18 00:58:09 -0600

ahendrix gravatar image

Try specifying the serial port using the ~port parameter:

rosrun rosserial_python serial_node.py _port:=/dev/ttyUSB0

(I updated the wiki to reflect this several years ago, but it looks like someone reverted my change)

edit flag offensive delete link more

Comments

That was one of the first things I tried. Neither ttyUSB0 nor ttyACM0 worked.

Cerin gravatar image Cerin  ( 2015-12-19 10:17:27 -0600 )edit

Trying ports at random is not the correct strategy. Which port is associated with your arduino?

ahendrix gravatar image ahendrix  ( 2015-12-21 18:15:23 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-12-14 09:00:08 -0600

Seen: 1,151 times

Last updated: Dec 18 '15