![]() |
Xbox controller right analog stick not being read.
The right analog stick is not being read. We tried all axes and hands available but the left joystick is being read for both the left and right hand. It worked fine in 2014. We read the number of axes and it said that there were 6 axes available. We are using Java. The joysticks appear in the driver station and both are read correctly there, but the .get methods on the joystick object do not work for the right joystick. Has anyone else had this problem? If so, how did you fix it?
We fixed the problem. You need to use .getRawAxis(AxisNumber) and input the correct axis number. 4 for the X axis for the right joystick and 5 was the Y axis for the right joystick. |
Re: Xbox controller right analog stick not being read.
Have you made sure your controller is working? I would check it with the Joystick Explorer: http://firstforge.wpi.edu/sf/frs/do/...stick_explorer.
You could also use the built in Driver Station tool as shown at the bottom of this page: http://wpilib.screenstepslive.com/s/...1881-joysticks If that says that the joystick is working then maybe you could post or PM me some code. |
Re: Xbox controller right analog stick not being read.
The new DS supports joysticks via DirectInput, which is the same library used last year, and it supports Input for Xbox controllers. Which type of controller is this? Does it have a switch or Mode button to select axes behavior?
Greg McKaskle |
Re: Xbox controller right analog stick not being read.
We just ran into the same problem!!
Based on our own testing: this is the new mapping for xBox joystick axis for this year LeftX = 0; LeftY = 1; LeftTrigger = 2; // Strange because triggers were one axis last year. RightTrigger = 3; RightX = 4; RightY = 5; |
Re: Xbox controller right analog stick not being read.
Quote:
|
Re: Xbox controller right analog stick not being read.
|
Re: Xbox controller right analog stick not being read.
Quote:
|
Re: Xbox controller right analog stick not being read.
I didn't realize that it was the number of axes that was the issue. For a bit of background on this.
DirectInput will read Xbox controllers and Xbox-like controllers and typically combines the left and right shoulder buttons into one. So one axes is spread out and the left button drives it negative and the right button positive, or vice-versa. But The XInput drivers treat the shoulder buttons as two separate axes that only go from zero to 1. The Logitech F310 can actually be both depending on a switch on the back. So back to the topic. The joystick APIs are a little different. Quite a few additional features are supported, and the USB tab is key to understanding the functionality of a given joystick. If you assume it works just like last year, you may miss some functionality and/or get confused and assume a behavior change is a bug. Greg McKaskle |
| All times are GMT -5. The time now is 02:44. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi