Closed sevenbitbyte closed 7 years ago
Examining other failure modes in libsweep it appears the right thing here is to throw an exception(possibly causing the calling process to terminate abruptly). I will produce a patched version to bring this failure mode inline with the behavior I see employed elsewhere.
Root cause of: https://github.com/scanse/sweep-ros/issues/11
libsweep version + affected bindings
This is an issue in the libsweep software package
operating system
I've only tested on Linux, current Windows behavior in the same situation is unknown
Description:
I have determined the root cause of the issue to be here: https://github.com/scanse/sweep-sdk/blob/master/libsweep/src/unix/serial.cc#L332
When the device is unplugged this results in an EOF event where all calls to
wait_readable
will return true but calls toread
returns zero bytes. This sends us into an infinite loop as this specific failure mode is not addressed at all in the loop so we're stuck here forever.Repro steps
htop
roslaunch sweep_ros sweep.launch
rostopic hz /pc2
Observed result
/pc2
topicExpected result