ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
There are still many delays in your callback. The error message means that your device has Not answered the serial node in your Host PC for couple of seconds. The answer happens Insider spinOnce. But your callback takes at least 2,5 seconds. During this time the Arduino can Not sync with your PC.
Either decrease the delays or (netter) move the control Code to your main loop and Set Up Dome Kind of state machine that ist started by a flag Set in the subscriber callback and then Starts the First command, then loops (and calls spinOnce) For 500 seconds, then starts the second command, then loops (and calls spinOnce) For 500 seconds, then starts the third command .....
As The Arduino Code ist completely sequential the Long delays May cause a Missing sync whereever placed, Not Just ich they are in the Main loop. Therefore ist ist better to avoid Them
2 | No.2 Revision |
There are still many delays in your callback. The error message means that your device has Not answered the serial node in your Host PC for couple of seconds. The answer happens Insider spinOnce. But your callback takes at least 2,5 seconds. During this time the Arduino can Not sync with your PC.
Either decrease the delays or (netter) move the control Code to your main loop and Set Up Dome Kind of state machine that ist started by a flag Set in the subscriber callback and then Starts the First command, then loops (and calls spinOnce) For 500 seconds, then starts the second command, then loops (and calls spinOnce) For 500 seconds, then starts the third command .....
As The Arduino Code ist completely sequential the Long delays May cause a Missing sync whereever placed, Not Just ich they are in the Main loop. Therefore ist ist better to avoid Them