Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the
async_handler_callbackfunction, I think we should first callwritethanread. The reason for this is that in that case we would at least have a chance of actually running the {read»update»write»sleep} cycle, where now it is basically always [update»read»write»sleep]. Exactly, it would probably be from HW perspective {write»read»sleep» (probably)update} (assuming the same frequency). Of course we don't know, but the chance that the values are updated betweenreadandwriteis very low. So in the current way, we are guaranteed to be at least one cycle behind; in the opposite case, we would have a chance to be more "in the cycle" with the most recent read data.Why is this important? When we think about "SLAVE" mode, then
readis usually blocking from the HW, so there we want to “sleep” and wait for the newest data and finish the execution of the loop. Hopefullyupdategets called, and then we canwritethe values. Nevertheless, I don't see we can do anything better, as we should not be slow and waiting forupdateas it might break the connection to the robot.