Drop hardware interface lifecycle state when reading fails#1712
Open
URJala wants to merge 10 commits intoUniversalRobots:mainfrom
Open
Drop hardware interface lifecycle state when reading fails#1712URJala wants to merge 10 commits intoUniversalRobots:mainfrom
URJala wants to merge 10 commits intoUniversalRobots:mainfrom
Conversation
With all the functions that currently support it
So write will always fail if writing to hardware fails with any synchronous controller
Not sure if it is the optimal timeout value though
fe56071 to
ac45a86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If non_blocking_read is false, the hardware interface will error out if it fails to read a package from rtde.
If non_blocking_read is true I have added a timeout, which is configurable through the ros2_control xacro, as it does not seem totally right to just ignore missed reads forever. The default value is 0.04 seconds like the robot_receive_timeout, but I am not sure if that is the optimal value.
Also added the timeout to the documentation.
As it is right now the driver might fail to launch if the timeout is small (<10 ms), as the first couple of cycles take a longer time I guess. Don't know if we should add a "grace period" on startup before counting toward the timeout? It is not as much of an issue on a real robot as in the simulator though.
I also added checks to write() so that if any of the calls to the robot fail, the hardware interface will also stop.
I did not write tests, as I am not sure how I would go about testing this in CI
Related to #1656