XBOX Controller Triggers is an axis but which one?

I have a MADCATZ Xbox 360 gaming controller, and according to the classmate the two back triggers are another axis. In Labview what axis is the axis 3(Throttle), or axis 6? i think it registers as the Z- axis and the RZ- (Z Rotational).

John Fogarty
Team 1102

If you take the axis (or button for the matter) cluster coming out from the Get (or Get Axis/Button) VI, you can create a indicator and see what buttons/axis are what number in the code.

-Tanner

Tanner is right, but if he wasn’t clear enough, this is how we did it:

-In your teleop VI, go to the block diagram and wire in two “Unbundle by Name” blocks (one for the axes and one for the buttons).

-Drag the bottom handle of the Unbundle blocks so every button and axis can be read.

-Go to your teleop VI front panel, and drop in one Numeric Indicator for each axis, and one LED for each button. Label them Axis1, Axis2, Button1, etc.

  • On the block diagram, wire each button and axis to the corresponding indicator.

  • Make a drawing of the controller.

  • Deploy your code with the Play button, press each button and axes. Make a note of which indicator does what when you operate the controller. Use this to label your drawing.

  • Once your drawing is fully labeled, you can start hooking up the axes and buttons to what you want them to control.

I know this is a pain, but this is how we did it. I have our drawing so I can’t tell you which is which, but doing this process only takes 15 minutes or so. good luck.

Actually, if you just follow what I said, you’ll save yourselves 14.5 minutes. Although, yours does have the pro of having a actual picture of the controller, though generally it’s fine to just have real-time values coming back as you push buttons.

Somebody could probably make a VI that does this. Would be nice if you could tell what type of joystick you were calling upon so you could make the VI work for any controller that is plugged in. Though how would that capability help the robot? It wouldn’t unless your robot has a strange passion for XBox 360 controllers and won’t work otherwise.

-Tanner

I don’t know about saving 14.5 minutes. The drawing took us all of 1 minute - and it was good for documentation purposes. Creating the front panel and putting in all the wires, deploying the code, than rewiring to your PWM outputs took the vast bulk of the time.

True, though whatever serves the purpose is great as it doesn’t matter how it is constructed.

-Tanner

It its axis 3

It is axis number 3, and it defaults to value of 0.0 and goes negative when right trigger is down and goes positive when left trigger is down.

It’s the “creating the front panel and putting in all the wires” part that Tanner’s simple procedure makes essentially instantaneous. You might not be recognizing that you can right-click on the Axis and Buttons clusters coming out of the Joystick Get vi and create an indicator of the entire cluster at once. There’s no need to unbundle them, or to create a whole bunch of separate LEDs and numeric indicators.

Go to control panel --> game controllers --> properties. It shows up what button and axis is what when you press it. We have everything except the rumble. There’s some threads, I believe in WindRiver, for using rumble, but does any one know how to do it in Labview? I would love to be able to have it rumble when our robot senses a ball.+

I remember seeing those threads, and you have two options (assuming I remember correctly): write your own xbox driver for windows, OR, open the xbox controller, find the rumble wire, and wire it to a digital out on the cypress board.
the default code and the DS software prevent writes to the joystick, so you would have to circumvent it using one of the methods above

Thanks for all your help I hope to try this out at Palmetto.

Just another quick Question. when I wired axis 3 into a True False Selector the true and False changed to 1 and 0 which i put my true code in 1, and my false code in 0. see attached pictures tell me if im doing this right. If the button is true then set the motor speed to the percentage of the button press, for variable control. If the button i…s false, then I made another true/false case for the sensor. In the false case, I set the motor speed to 0.1. In the true case, I set the motor speed to 0.

This way, when the button is NOT being hit, it looks for the sensor, and it spins it around REALLY SLOWLY until the sensor is tripped, and then it stops there.

and another

I would recommend that you delete the wire from axis 3 and change your case structure back to TRUE and FALSE. Test axis three against “> 0.5” and if it’s greater than 0.5, it will tigger the TRUE case, and if it’s less than 0.5 it will trigger FALSE.

The problem with using the 0 and 1 cases is that it is possible that you cannot get to the 1 case if your XBox controller is out of calibration. If you use the 0.5 compare, you will be covered.

There are Drivers, non-Microsoft, that support the rumble packs, you just have to risk the viruses and spend some time looking.

for a controller mapping of the xbox 360 controllers please see this post