Fix autorepeat for game_controller_node#312
Open
abrandemuehl wants to merge 1 commit intoros-drivers:ros2from
Open
Fix autorepeat for game_controller_node#312abrandemuehl wants to merge 1 commit intoros-drivers:ros2from
abrandemuehl wants to merge 1 commit intoros-drivers:ros2from
Conversation
e66fb95 to
775caff
Compare
The game_controller_node event loop runs the logic to run the autorepeat logic _only_ when no events are received on the SDL_WaitEventTimeout. This means that when repeated events occur such as holding the joystick in the same location or ignored events like deadzone axis events are received, the autorepeat logic is skipped. This commit refactors the autorepeat and coalescing logic 1. Timeouts based on how long there should be until the next expected publish, whether that's the autorepeat interval or the coalesce period. 2. Unconditional checking of the timing for coalesced and autorepeat publishing. This should fix the problem of the joy messages not properly autorepeating
775caff to
94d9647
Compare
Author
|
@clalancette I wrote this before seeing #261, If you'd like I can check if it's possible to apply the same simpler fix. I think what I've done is correct but I'm a bit worried that I can't really test it against any sort of mock SDL event loop |
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.
The game_controller_node event loop runs the logic to run the autorepeat logic only when no events are received on the SDL_WaitEventTimeout. This means that when repeated events occur such as holding the joystick in the same location or ignored events like deadzone axis events are received, the autorepeat logic is skipped.
This commit refactors the autorepeat and coalescing logic
This should fix the problem of the joy messages not properly autorepeating