|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Missing DPAD axis
While testing inputs from our controller (Afterglow Xbox 360), our team has run into a problem. We are currently seeing which axes are controlled by what, using getRawAxis(int). Here is what we have so far:
Code:
AXIS 1: Left Stick X axis AXIS 2: Left Stick Y axis AXIS 3: Triggers AXIS 4: Right Stick X axis AXIS 5: Right Stick Y axis AXIS 6: DPAD X axis |
|
#2
|
|||
|
|||
|
Re: Missing DPAD axis
I ran into this today, and briefly last year. The libraries/robot can only access axes 1-6. The dpad Y is axis 7 on xbox controllers... So if you're determined to use the dpad, I don't know how to do a work-around. Maybe some weird button mapping.
|
|
#3
|
||||
|
||||
|
Re: Missing DPAD axis
Not sure if it would work, but you can always extend classes. kJoystickAxes in DriverStation currently defines that there are only 6 axis. You could either change it in there (make sure to change it again after a NetBeans update) or you could extend it and use it. Then you can just call getRawAxis(7).
DPAD only has 1.0, 0.0 and -1.0, right? (Just for my knowledge) |
|
#4
|
|||
|
|||
|
Re: Missing DPAD axis
Right. -1, 0, 1 on each axis based on my testing today.
I'll try extending the class tomorrow if I remember. |
|
#5
|
||||||
|
||||||
|
Re: Missing DPAD axis
Quote:
|
|
#6
|
||||
|
||||
|
Re: Missing DPAD axis
Oh, then is there any other way to get axis 7? Because we will be using the Logitech game controller and the DPAD y axis on it is also axis 7 I think. At least it's not the first 6 (since there are already 6 other axes).
If anyone finds a way, please let us know! Thanks! |
|
#7
|
|||
|
|||
|
Re: Missing DPAD axis
There is no way to get more than 6 axes using the Driver Station.
Seeing as there is no specific rule stating that all controlling communications must go through the Driver Station, you could simply communicate joystick data external from the Driver Station. The only problem with this is that you would 1) need to keep the Driver Station from acquisitioning the joystick, and 2) you must find a way to interface to the joystick. For #1, I would simply write a small program (called "Driver Station") to replace the one currently being used. Same tactic as when writing a replacement dashboard, except it would first launch the controller interface software, wait, and then launch the real dashboard. And for #2, I'm sure there's some python library somewhere. And for naysayers, the only relevant rule: Quote:
|
|
#8
|
|||
|
|||
|
Re: Missing DPAD axis
I am just getting started setting up an XBox controller for our Driver Station.
Is it possible that the DPAD is available as Buttons? Does anyone have a map similar to the axis map for the buttons? Also, with the triggers both controlling the same axis (I read somewhere that one trigger makes the axis value go positive and the other one go negative) what happens when you press both triggers at the same time? |
|
#9
|
|||
|
|||
|
Re: Missing DPAD axis
It'd be a bit of work, but you could probably write a wrapper class to store the X and Y values for the thumbsticks in an array and then a way in the joystick library for the robot to retrieve those.
|
|
#10
|
||||
|
||||
|
Re: Missing DPAD axis
Quote:
Typically you don't want to have these mapped to functions which you need to use at the same time. Button map for 360 controller: http://www.chiefdelphi.com/forums/sh...45&postcount=8 |
|
#11
|
|||
|
|||
|
Re: Missing DPAD axis
Quote:
Can you press down on the XBox controller joystick to make it a button, or how does that work? I know a lot of people don't realize that the mouse wheel is also a button. Am I the person who didn't realize that the joystick was also a button? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|