-
Notifications
You must be signed in to change notification settings - Fork 301
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
Trigger Button Potential Bug #155
Comments
I am seeing this on a wireless xbox360 joystick too. The trigger buttons seem to map to values between -1 and 1, and after pressing the releasing the trigger button(s) once, the axes values remain at 1. Is this intended functionality? |
I'm experiencing the exact same issue: Before using LR and RT, all values in axes are zero. After the first press axes[2] (LT) and axes[5] (RT) are 1.0 when the buttons are untouched. |
I'm seeing the same issue with both an xbox one joystick and a logitech F310, running on Noetic. The behavior I would have expected is 0.0 corresponds to the axis in a resting position, and 1.0 corresponds to all the way pressed. However, a quick look at the driver code makes it look like this oddness is thanks to the actual hardware driver, rather than the ROS node, and fixing it would require special casing two event numbers. |
This is sort-of a "known bug" but it's more complicated than it looks. The problem is that "triggers" are considered "axes" for the purpose of defining their range of values, in this case: 1.0 to -1.0. However, since "triggers" don't have a clearly-defined (read "default" or "detented") center point, the only way to represent the full range-of-motion of a "trigger" as an "axis" is to have one end of the range-of-motion be 1.0 and the other end be -1.0 with 0.0 representing the "middle", which, again, is not clearly defined on the hardware itself. Since we must treat all "axes" the same, the default value of 0.0 was chosen as a "safe" value. However, for a trigger, this is obviously not a sane value. This leaves us with a few options:
I'd be happy to hear feedback. |
Hi @JWhitleyWork, I understand the idea of using a default value of 0 for all the axes, and also now understand why the range is -1.0 to 1.0. But after setting the default axes to be 0, can't you do a one-time 'read' of all axes as part of the startup procedure, which would then automatically set the trigger buttons to 1.0? FYI - I'm the same guy as @swinterbotix, but I've stopped using that username a few months ago. |
Attempted fix to this issue in #214. I went with option 4 from #155 (comment) |
I documented |
I still see this issue in ros2 humble on Ubuntu 22.04 with a PS4 controller. I also cannot find anything in the humble-devel branch mentioning default_trig_val. Is there a solution for this in humble? |
Hi,
I'm using the 'joy' package to create a ROS interface for a PS3 or PS4 controller, and I noticed that by default, the L and R buttons on the joystick (maps to index 2 and 5 respectively in the 'axes' array) are set to 0. However, after pressing the R button and letting go, the R value in the 'axes' array stays at 1.0. Same is true for the L button. Would it be possible to just set the default L and R button values in the ROS Joy message to 1.0? I ask since for my application, the R and L values depend on each other, and I have to create a special case in my code to check for the very first press of each of these buttons (as my code assumes that they will always have a value of 1.0 when unpressed).
As an FYI, I'm using the Official PS3 and PS4 Sony controllers with Ubuntu 16.04 and ROS Kinetic though I believe the same issue occurs on Ubuntu 18.04 and ROS Melodic.
The text was updated successfully, but these errors were encountered: