Hey all,
I am trying to output the value of an analog trigger to be used for controlling a part of our robot. It seems like you can’t use .GetRawAxis(#); anymore. Help would be greatly appreciated!!
Hey all,
I am trying to output the value of an analog trigger to be used for controlling a part of our robot. It seems like you can’t use .GetRawAxis(#); anymore. Help would be greatly appreciated!!
Do you mean the analog triggers on a gamepad like the Xbox controller? If so, those are axes as well (you can see which axis number they correspond to by launching the driver station and selecting the controller in the USB list)
Yes. We’re using the Logitech Gamepad F310, if that matters.
Yeah they should show up as axes 4 and 5 (they probably only range in values from 0.0 to 1.0). Verify this in the driver station
The IDs for the left and right analog triggers are 2 and 3, respectively.
Ah ok (I was guessing at the IDs). Yeah, then you should be able to use getRawAxis(2)
or getRawAxis(3)
to get the appropriate values
When using GetRawAxis (or getRawAxis in java), the range is always in range [-1…1]. This may throw you off for analog triggers because their values can be negative when it seems like they should be in range [0…1]. Don’t make the mistake we almost did by making the throttle analog triggers without scaling it correctly. It almost sent our robot back at full speed.
That’s weird. I didn’t think .GetRawAxis worked. Weird. Oh well. Thanks for your help!