Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Missing DPAD axis (http://www.chiefdelphi.com/forums/showthread.php?t=101822)

Cosine 02-02-2012 21:14

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

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?

nickpeq 02-02-2012 22:16

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.

neal 02-02-2012 23:21

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)

nickpeq 02-02-2012 23:31

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.

Joe Ross 02-02-2012 23:33

Re: Missing DPAD axis
 
Quote:

Originally Posted by neal (Post 1118937)
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).

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

neal 03-02-2012 16:16

Re: Missing DPAD axis
 
Quote:

Originally Posted by Joe Ross (Post 1118947)
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!

Thanks!

sjspry 03-02-2012 19:48

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:

Originally Posted by R80
The Driver Station software provided on the Kit of Parts website is the only tool permitted to specify and communicate the operating mode (i.e. Autonomous/Teleop) and operating state (enable/disable) to the Robot. The Driver Station software must be revision 11.30.11.00 or newer.


tux 11-02-2012 16:16

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?

jesusrambo 11-02-2012 16:41

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.

otherguy 11-02-2012 17:58

Re: Missing DPAD axis
 
Quote:

Originally Posted by tux (Post 1124433)
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?

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:
http://www.chiefdelphi.com/forums/sh...45&postcount=8

tux 11-02-2012 20:10

Re: Missing DPAD axis
 
Quote:

Originally Posted by otherguy (Post 1124489)

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?


All times are GMT -5. The time now is 10:33.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi