Arduino lost sync with device, working after automatic restart

asked 2015-06-26 03:04:43 -0500

GuLpan gravatar image

I am trying to run the "Hello World" example provided in rosserial. When starting on my arduino (Atmega 2560) I am getting the following output:

[INFO] [WallTime: 1435230357.044459] ROS Serial Python Node
[INFO] [WallTime: 1435230357.051562] Connecting to /dev/ttyACM0 at 57600 baud
[ERROR] [WallTime: 1435230374.158417] Lost sync with device, restarting...
[INFO] [WallTime: 1435230375.383373] Note: publish buffer size is 512 bytes
[INFO] [WallTime: 1435230375.383754] Setup publisher on chatter [std_msgs/String]

Before this error is display, it seems that no communication is coming from the Arduino. After this however, the program is working as it should, and I can see the messages being publish using the rostopic echo function.

~$ rostopic echo /chatter
data: hello world!
---
data: hello world!
---

After this I tired to set the buffer size on the publisher, modifying line 12 from:

ros::Publisher chatter("chatter", &str_msg);

to:

ros::Publisher chatter("chatter", &str_msg, 512);

This still causes the unable to sync problem, but this time it will not work after the error as it did before:

[INFO] [WallTime: 1435230498.031527] ROS Serial Python Node
[INFO] [WallTime: 1435230498.037880] Connecting to /dev/ttyACM0 at 57600 baud
[ERROR] [WallTime: 1435230515.148311] Lost sync with device, restarting...
[ERROR] [WallTime: 1435230517.142149] Tried to publish before configured, topic id 125
[ERROR] [WallTime: 1435230518.144302] Tried to publish before configured, topic id 125

Anyone have any ideas why this is happening? I'm getting the same behavior with the program I have written. It seems to work after that without loosing sync again, even if I run it for a long period of time.

My ros version is 1.11.9 (indigo)

edit retag flag offensive close merge delete