-
Notifications
You must be signed in to change notification settings - Fork 86
Fixed sweep object creation hanging #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…object creation to hang.
|
Woops! Seems I caused this when I removed the verbose switch statement in commit 51246f7 Any idea why the behavior would affect the RaspberryPi but not a desktop setup? Will have to check everything still works on Mac as well. I'll do so now. |
|
Additionally Travis is failing because the check for the definition is missing (removed in 51246f7 for mac compatibility). We'll have to figure out a better solution for portability there. |
|
Ok I will check it again tomorrow as I don't have the lidar now. It was definitely the reason it was not working for me. (Tested on rasperry pi 3 too) Concerning the continuous integration failing, It appears that older versions of termios.h does not define bitrates up to B115200. That's strange you still have the issue with the fix, maybe that's not the same issue or need to make clean or something ? 0:-) Well I'll give you more info tomorrow. Thanks a lot for the response. |
|
Thanks for the info @Vrong ! I'll look into this more as well. Also, what Raspbian release are you using? |
|
@Vrong I think the intermittent behavior I was seeing can be explained by the sequence of reboots, sweep unplugs and swapping back and forth between libsweep fixes. Now that I'm explicitly checking for it, I can't seem to reproduce the issue with the fix implemented. Checking with As for the definition check... I can't remember the exact cause of the mac incompatibility. I'll have to look again, but perhaps a quick and dirty solution could be accomplished rather simply like so: #ifdef B115200
return B115200;
#endif
return 115200;Edit: This allows systems with Currently, this hack would not still cause a hang on a hypothetical system which doesn't recognize |
…200 definition missing
|
Ok I messed with my repo so I created a new one to keep it clean sorry ==> #117 . |
This bug was causing sweep object creation to hang when trying to read the returned value from serial port. ==> Issue #72
Bitrate of the serial communication was badly set during the creation of the sweep object when using the libsweep library on Linux.
cfsetispeed(...) and cfsetospeed(...) both take a termios bitrate constant and not the bitrate directly. So should the get_baud(115200) call return the B115200 value defined in termios.h.
The fix has been tested successfully and has no limitation.
Thanks.