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

Rosserial_arduino: Lost sync with device, restarting...

asked 2011-12-06 08:56:05 -0500

mcsmith gravatar image

I'm trying to get a service server running on an Arduino. The code compiles, and I know (from debugging with an Arduino-attached LED) that the code to advertise the services is executed and that the sketch's loop() function executes (at about a 1 second interval). However, when I start rosserial_python, I get:

$ rosrun rosserial_python serial_node.py /dev/ttyUSB0
[INFO] [WallTime: 1323211562.638344] ROS Serial Python Node
[INFO] [WallTime: 1323211562.649185] Connected on /dev/ttyUSB0 at 57600 baud
[ERROR] [WallTime: 1323211577.655402] Lost sync with device, restarting...
[ERROR] [WallTime: 1323211592.663968] Lost sync with device, restarting...

The sketch initializes the serial port to 57600, rosserial_python's default baud rate.

Any suggestion on why I'm not getting or maintaining sync?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2011-12-07 08:51:47 -0500

mcsmith gravatar image

The problem was that the service objects were incorrectly declared with setup(), not globally. They would go out of scope prematurely, resulting in the symptoms described above.

edit flag offensive delete link more
1

answered 2014-03-13 14:58:26 -0500

Elucidation gravatar image

This happened to me a lot, and 90% of the time turned out to be because I was trying to push too much data over the line. For example, the ros_lib ADC example for me will lose sync constantly until I added a delay in the loop (10Hz works reliably for me).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-12-06 08:56:05 -0500

Seen: 4,178 times

Last updated: Mar 13 '14