Go to Post But their robot puts its wheels on one at a time just like ours, so we can be a HOF winner too! - Foster [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 29-03-2011, 01:17
youxinche95 youxinche95 is offline
Registered User
AKA: Eugene Che
FRC #0649 (MSET)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Saratoga, CA
Posts: 18
youxinche95 is an unknown quantity at this point
Xbox Controller?

Any other team use an xbox controller for their robot? We figured most of the functionalities of a joystick pair up fairly well with the xbox controller, for instance, getTwist() is Y for the right joystick and getThrottle() is left. How do we access the current value of the view hat i.e. the arrow keys between the two joysticks. Thanks in advance!
Reply With Quote
  #2   Spotlight this post!  
Unread 29-03-2011, 02:05
MikeE's Avatar
MikeE MikeE is offline
Wrecking nice beaches since 1990
no team (Volunteer)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: New England -> Alaska
Posts: 381
MikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond repute
Re: Xbox Controller?

Quote:
Originally Posted by youxinche95 View Post
How do we access the current value of the view hat i.e. the arrow keys between the two joysticks. Thanks in advance!
The XBox controller effectively has 7 axes but unfortunately the HID standard supported by wpilib only returns 6 axes of control.

The left & right joysticks use 2 each as expected, but the two triggers also use an axis with the left trigger giving negative values and the right positive. Thus the amount of trigger displacement can be detected, not just a binary value of each trigger.

The Directional Pad (D-pad) uses the 6th and 7th axis, but you only have access to the 6th axis via getRawAxis. Therefore code can detect left & right directions on the D-pad, but not up / down.

A more complete answer including button mappings can be found here: http://www.chiefdelphi.com/forums/sh...45&postcount=8

There may be a way of circumventing the standard XBox axis mapping through its device driver, but I haven't looked into that.
Reply With Quote
  #3   Spotlight this post!  
Unread 29-03-2011, 05:29
R.C.'s Avatar
R.C. R.C. is offline
2017... Oooh Kill em, Swerve!
AKA: Owner, WestCoast Products
FRC #1323 (MadTown Robotics)
Team Role: Engineer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Madera, CA
Posts: 2,175
R.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond repute
Re: Xbox Controller?

Just wondering, has anyone been able to use the "rumble" feature of the xbox controller?

-RC
__________________
R.C.
Owner, WestCoast Products || Twitter
MadTown Robotics Team 1323
Reply With Quote
  #4   Spotlight this post!  
Unread 29-03-2011, 11:42
MikeE's Avatar
MikeE MikeE is offline
Wrecking nice beaches since 1990
no team (Volunteer)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: New England -> Alaska
Posts: 381
MikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond repute
Re: Xbox Controller?

Quote:
Originally Posted by R.C. View Post
Just wondering, has anyone been able to use the "rumble" feature of the xbox controller?

-RC
We've often joked about using an accelerometer to allow the driver to feel the impact of collisions as a Pavlovian training aid.

I read that the ZomB dashboard package supports rumble feedback http://www.chiefdelphi.com/forums/sh...ad.php?t=88306.
Reply With Quote
  #5   Spotlight this post!  
Unread 29-03-2011, 15:10
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Xbox Controller?

Quote:
Originally Posted by MikeE View Post
We've often joked about using an accelerometer to allow the driver to feel the impact of collisions as a Pavlovian training aid.

I read that the ZomB dashboard package supports rumble feedback http://www.chiefdelphi.com/forums/sh...ad.php?t=88306.
it does indeed, drop an X Shake control (has black squiggly line) and give it a name. Send value to that name as either a float between 0 and 1, or a string in the format "left;right" where left and right are a float between 0 and 1.

Videos:
http://thecatattack.org/ZomB (@1:05)
http://thecatattack.org/user/PatrickP/ryantest (first video on page)
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #6   Spotlight this post!  
Unread 29-03-2011, 20:18
R.C.'s Avatar
R.C. R.C. is offline
2017... Oooh Kill em, Swerve!
AKA: Owner, WestCoast Products
FRC #1323 (MadTown Robotics)
Team Role: Engineer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Madera, CA
Posts: 2,175
R.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond repute
Re: Xbox Controller?

Quote:
Originally Posted by byteit101 View Post
it does indeed, drop an X Shake control (has black squiggly line) and give it a name. Send value to that name as either a float between 0 and 1, or a string in the format "left;right" where left and right are a float between 0 and 1.

Videos:
http://thecatattack.org/ZomB (@1:05)
http://thecatattack.org/user/PatrickP/ryantest (first video on page)
Thats cool,

Even though my team isn't using the ZomB dashboard, how do you do it in Java?

Thanks,

-RC
__________________
R.C.
Owner, WestCoast Products || Twitter
MadTown Robotics Team 1323
Reply With Quote
  #7   Spotlight this post!  
Unread 29-03-2011, 21:13
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Xbox Controller?

Quote:
Originally Posted by R.C. View Post
Thats cool,

Even though my team isn't using the ZomB dashboard, how do you do it in Java?

Thanks,

-RC
Not easily. you can look at the source for it (zombdlls/WPF/Controls/xShake.cs), but it is just a simple wrapper for a Direct X wrapper library (SlimDX), so you would have to call Direct X yourself if you want to do that in Java. I personally did not look too deeply into that, I just used http://www.mediafire.com/file/ihhjzt...Controller.zip and it worked, so I never bothered with anything else.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
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 10:30.

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