|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Ps3/360 controller with robot programmed in Java
Hi all,
We're interested in knowing how our team could drive our robot using a Ps3 controller/Xbox 360 controller. We are programming our robot in Java. Can anyone help us out? Thanks. |
|
#2
|
|||
|
|||
|
Re: Ps3/360 controller with robot programmed in Java
The driver station should see it as a Joystick. Install any drivers you would normally need (google for them), and then the controller should have its hats (the sticks) enumerated as axes and buttons numbered.
|
|
#3
|
|||
|
|||
|
Re: Ps3/360 controller with robot programmed in Java
If you're having problems figuring out which axis/buttons on the controllers are which, go to Control Panel > Game Controllers.
Then, you select the game controller and click properties. Now, you can calibrate your device and see which axes is which number, and which button is which. Hint: Look at the documentation for the Joystick class for more information on how to read Joystick inputs. |
|
#4
|
|||
|
|||
|
Re: Ps3/360 controller with robot programmed in Java
Quote:
I thought I had found the solution to my problem. I just need to find out what the "Point of View Hat" (The D-Pad) is according to the WPI Libraries. I know that Left-Right movement is read as Axis 6, but Up-Down movement is either not recognized by the Joystick class (being an axis higher than 6), or something else that I'm not thinking of. Last edited by architek501 : 30-01-2011 at 15:20. Reason: Re-stated problem. Getting frustrated. |
|
#5
|
||||
|
||||
|
Re: Ps3/360 controller with robot programmed in Java
it only has six axes
|
|
#6
|
|||
|
|||
|
Re: Ps3/360 controller with robot programmed in Java
One would think... but I actually found 7.
Left Analog Up/Down (Axis 2) Left Analog Left/Right (Axis 1) Right Analog Up/Down (Axis 5) Right Analog Left/Right (Axis 4) D-Pad Up/Down (Axis 7?) D-Pad Left/Right (Axis 6) Left/Right Triggers (yes, for some reason, these form their own set of axes, where pressing the left trigger outputs a positive value, and pressing the right trigger outputs a negative value) (Axis 3) |
|
#7
|
|||
|
|||
|
Re: Ps3/360 controller with robot programmed in Java
If you would like to use a PS/3 controller you need a program called motionjoy to use its full funtionality. Our team is using a PS/3 controller with its 7 axis capibilities its very stable and easy to use.
Programmer Matt Gus Robotics, team228.org |
|
#8
|
|||
|
|||
|
Re: Ps3/360 controller with robot programmed in Java
Quote:
Left Right joysticks would be 4 tilt foward back side side would be 2 and the variable triggers is 1 Programmer Matt, Gus Robotics, team228.org |
|
#9
|
|||
|
|||
|
Re: Ps3/360 controller with robot programmed in Java
If I were using a PS3 controller, that would definitely be the case.
Code:
public static int getDPad1( )
{
return 6;
}
Code:
if ( opControl.getRawAxis( ControllerConfig.getDPad1( ) ) >= 0.03 )
{
System.out.println( "This is Axis #6." );
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|