scanse / sweep-ros

Scanse Sweep ROS Driver and Node
MIT License
68 stars 62 forks source link

sweep_node uses 100% CPU if cable accidentally unplugged. #11

Closed sevenbitbyte closed 7 years ago

sevenbitbyte commented 7 years ago

When unexpectedly unplugged the sweep_node consumes 100% of CPU cycles and reports no errors. Use on autonomous unmanned systems will require improved failure reporting. Ideally this can be done without spiking CPU usage as well. Finally I would like to achieve failure recovery, so I can just plug the sensor back in and it starts back up smoothly(assuming /dev path stays the same).

Repro steps:

Observed result

Expected result

sevenbitbyte commented 7 years ago

Looks like the CPU spike culprit: https://github.com/scanse/sweep-sdk/blob/master/libsweep/src/unix/serial.cc#L332