-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fixed read timeout checks, added timeout parameter #7
Conversation
@gsokoll this PR seemed to copy a lot of commits. Please rebase the PR to start the review without including the previous commits which are not made by you |
I had made the PR against "master" instead of "main" branch. Fixed now. Can you perhaps delete the old master branch also? |
@gsokoll I agreed with my colleagues to keep it for historical purposes. However, thanks for rebasing. I will need some time to review the changes. |
@gsokoll did you see the changes I listed here? |
No, I don't see any changes. Where were they made?? |
@gsokoll I meant the review I opened before. Please let's resolve it before merging |
Sorry I am still missing something. I do not see any comments in the "Files changed" tab. |
Ah, ok. I think I can't see your comments because they are still Pending (https://github.com/orgs/community/discussions/10369) ? But in reply to your question about retaining the repeat-counting check if timeout is not specified: I did include a default timeout value of 1000 ms, which is probably too long for most people. It can certainly be changed to something smaller (like 100 ms). One alternative may be to set a default timeout period to 3 times the polling interval? Then, if the user does not specify timeout explicitly, use this default value. This may be a bit messy to implement though. |
Have made changes to check for a user-defined timeout. If no timeout defined, then defaults to timeout equal to 3 times the polling interval which should replicate the previous repeat-count check approach. |
@thank you a lot! Great contribution! I will merge the PR very soon |
Added data timeout parameter for port after [improvement](ElettraSciComp/witmotion_IMU_QT#7) of the underlying library
- Added support for serial port timeout behaviour (`timeout_ms`) - Updated README.md - Merged pull request #27 - Version bump to 1.3.0 - Matched versions for ROS node and underlying library after merging pull request ElettraSciComp/witmotion_IMU_QT#7
The QBaseSerialWitmotionSensorReader::ReadData() function performs a check to detect if no data has been received for a period of time. Specifically, it checks whether the number of bytes currently available from the serial stream is the same as the number of bytes available on the previous call to the function, and if this occurs several times it raises an error.
However the logic of this check is incorrect - the number of bytes available now and in the past is not an indication of the absence of data. The code has been amended to check whether there are ZERO bytes available on the serial stream, and if this occurs over a specified timeout period, it raises an error.
The timeout period has been added as a parameter also.