Ask Your Question

Revision history [back]

rosserial lost sync with device

I occasionally get a lost sync message with rosserial: "Lost sync with device, restarting..." and am wondering what exactly is being restarted and how best to recover from that in the arduino code.

It seems that the python code is fine with starting while the arduino is running its loop(). So am I correct in interpreting that to mean the python code does not need to be running for the setup() part of the arduino code, the part where the initNode() statement as well as the advertise and subscribe statements occur?

I am driving a roomba with the arduino and it seems I most often get the "lost sync" when the roomba is taking its time getting some task completed. The python code does not recover from that. I tried putting in a statement to check if the connection was up: while (!nh.connected())...... but whenever it disconnected, it would just stay in this loop and never recover.

Suggestions?