0
$\begingroup$

Rosanswers logo

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?


Originally posted by mcsmith on ROS Answers with karma: 66 on 2011-12-06

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by mcsmith with karma: 66 on 2011-12-07

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

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).


Originally posted by Elucidation with karma: 13 on 2014-03-13

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.