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!

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/showpost.php?p=1003245&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.

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/showthread.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)

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/ihhjztqmudy/Xbox360Controller.zip and it worked, so I never bothered with anything else.