Go to Post If duct tape isn't the answer, you're not asking the right question. - Morgoth [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-02-2012, 21:14
Cosine Cosine is offline
Registered User
FRC #1736 (Robot Casserole)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Peoria, IL
Posts: 2
Cosine is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2012, 22:16
nickpeq nickpeq is offline
Turing-complete
FRC #1255 (Blarglefish)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Baytown, TX
Posts: 60
nickpeq is an unknown quantity at this point
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-02-2012, 23:21
neal's Avatar
neal neal is offline
Neal
FRC #1777 (Viking Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: United States
Posts: 56
neal is an unknown quantity at this point
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)
Reply With Quote
  #4   Spotlight this post!  
Unread 02-02-2012, 23:31
nickpeq nickpeq is offline
Turing-complete
FRC #1255 (Blarglefish)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Baytown, TX
Posts: 60
nickpeq is an unknown quantity at this point
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-02-2012, 23:33
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Missing DPAD axis

Quote:
Originally Posted by neal View Post
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 03-02-2012, 16:16
neal's Avatar
neal neal is offline
Neal
FRC #1777 (Viking Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: United States
Posts: 56
neal is an unknown quantity at this point
Re: Missing DPAD axis

Quote:
Originally Posted by Joe Ross View Post
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!
Reply With Quote
  #7   Spotlight this post!  
Unread 03-02-2012, 19:48
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
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.
Reply With Quote
  #8   Spotlight this post!  
Unread 11-02-2012, 16:16
tux tux is offline
Registered User
AKA: Lee Harr
FRC #3842 (Shock-a-Bots)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Rochester, NY
Posts: 91
tux is an unknown quantity at this point
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?
Reply With Quote
  #9   Spotlight this post!  
Unread 11-02-2012, 16:41
jesusrambo jesusrambo is offline
Self-Proclaimed Programmer Messiah
AKA: JD Russo
FRC #2035 (Robo Rockin' Bots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Carmel, CA
Posts: 114
jesusrambo is an unknown quantity at this point
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.
Reply With Quote
  #10   Spotlight this post!  
Unread 11-02-2012, 17:58
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 434
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Missing DPAD axis

Quote:
Originally Posted by tux View Post
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
__________________
http://team2168.org
Reply With Quote
  #11   Spotlight this post!  
Unread 11-02-2012, 20:10
tux tux is offline
Registered User
AKA: Lee Harr
FRC #3842 (Shock-a-Bots)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Rochester, NY
Posts: 91
tux is an unknown quantity at this point
Re: Missing DPAD axis

Quote:
Originally Posted by otherguy View Post
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?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:59.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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