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

Errors in connecting an Arduino to Ros Groovy

asked 2013-07-09 16:01:51 -0500

asriraman93 gravatar image

updated 2014-04-20 14:09:42 -0500

ngrennan gravatar image

I'm trying to get an Arduino Uno hooked up to Ros Groovy; I've been following the Hello World tutorial for rosserial_arduino. When running

rosserial_python serial_node.py /dev/ttyACM0

I'm able to connect for a second, and I start getting the error:

[ERROR] [Walltime: ...] Lost sync with device, restarting...

I noticed my Arduino code is still running even though it lost connection (I have a flashing LED indicator). Its not publishing anything to "Chatter" however - not even once before it disconnects.

Please let me know how I might be able to fix this!

Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2017-10-27 15:21:10 -0500

bpinaya gravatar image

Hi there, I've come to a similar situation in ROS Indigo. This was mostly due to having the Arduino IDE open with the Serial Port open. After I uploaded the code to the arduino and closed the IDE and restarted the rosserial server the error was gone.

edit flag offensive delete link more
0

answered 2018-06-28 11:02:52 -0500

Mark Rose gravatar image

An Arduino Uno only has 2kb of RAM available. Because of the non-von-Neumann architecture of the Atmel chip, some things that you would not consider as variables also take up some of that space, specifically string constants, of which rosserial has a lot. I have not been able to make rosserial work reliably in a 2kb Arduino compatible. (You can tweak the buffer sizes some, but will eventually run out of space if you have enough publishers and subscribers.)

Some suggestions:

  1. Look at the amount of free variable space. This is shown in the Arduino IDE when you compile. The free space is used for the stack, so you must have sufficient space. I've had stability problems with anything under 600-800 bytes free.
  2. If #1 is a problem, try reducing the size of the input and output buffers, or reducing the number of publishers or subscribers. (Perhaps by combining multiple messages into one, for example.)
  3. Consider a non-rosserial approach such as ros_arduino_bridge, which is must less memory-intensive on the Arduino side. (I've abandoned rosserial in favor of ros_arduino_bridge for this reason.)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-07-09 16:01:51 -0500

Seen: 379 times

Last updated: Jun 28 '18