Upgrade/gamepad mappings#49
Closed
MarcOlivierFecteau wants to merge 5 commits intoSherbyRobotics:ros2from
Closed
Conversation
Collaborator
MarcOlivierFecteau
commented
Nov 1, 2025

The unused code is commented out instead of removed to preserve the originally intended logic.
The affected lines are commented out instead of removed to preserve the originally intended logic.
The issue was that the arbitration node didn't check the controller inputs to verify the required buttons for controlling the racecar with the behaviors were pressed, so it sent the command with the highest priority whether or not the deadman switch and the "autopilot-using-behaviors" were pressed, which would have been problematic when testing the behaviors on the racecar (as one can conclude with an autonomous vehicle ignoring the security measures). The arbitration node now checks the `joy` topic for the required inputs, and publishes only the "manual" commands if the requirements aren't met.
The input mode of the Logitech F710 used for the racecar is DirectInput.
`joy.joy_node` uses SDL's lower-level Joystick API: when used with the Logitech F710, the indices in the `Joy` message differ between the XInput mode and the DirectInput mode. This commit aims to eliminate the confusion that can arise when the user unintentionally switches the gamepad into XInput mode. The "joy" node now uses SDL's GameController API, which offers consistent mappings in the `Joy` message, independently of the mode the gamepad is in. The indices of the buttons and axes in the logic of the `teleop` package have been changed to keep the original physical mappings identical. All launch files that include a "joy" node have been updated to use the correct executable. Additionally, the check for the minimum number of axes has been removed, because the only gamepad used for controlling the racecar is the Logitech F710, so it doesn't make sense to check for a potentially incompatible gamepad. NOTES: - This commit has only been tested on a Xbox One controller (XInput mode). TODO: - Test GRO830's lab with a Logitech F710 in both XInput and DirectInput mode, and confirm the values obtained in the `Joy` message AND the `ctl_ref` message are identical for both modes BEFORE merging this PR.
Collaborator
Author
|
TODO BEFORE merging this PR:
|
Collaborator
|
Allô, je préfère ne pas faire de modifications, du moins pour tout ce qui touche au core pipeline (teleop, slash-controller, Arduino) des APP2 et APP4. Alex |
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.