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:

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

We have tested axes 0 through 10, and these are the only ones that are affected by the controller, and the Y axis for the DPAD is not detected. Our question is, is there a way to detect this missing 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.

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)

Right. -1, 0, 1 on each axis based on my testing today.
I’ll try extending the class tomorrow if I remember.

The driver station only transmits 6 axes, so this won’t work.

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!


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:

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?

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.

One trigger adds to the axis, the other subtracts. When both held all the way, I believe you get back to zero.
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:

Ah. You know, I read that page, but I think the joysticks being in the button list threw me off.

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?