|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Programming Logitech Gamepad F310
is there a way to program the Logitech Gamepad F310 into Java so you are able to move around when you are driving? Any ideas would be great!
|
|
#2
|
|||
|
|||
|
Re: Programming Logitech Gamepad F310
I assume, from what I can see, that the WPILib uses the "thumbstick" as the main axis. So what ever shows up in the X/Y box in the game controller settings in the control panel is what you get. So it would be totally independent of the game controller. As long as you have working drivers for it on the computer you should be fine. In fact, if you want I assume you can use a wii mote or kinect to control the robot. Assuming you have the right drivers and software.
![]() |
|
#3
|
||||
|
||||
|
Re: Programming Logitech Gamepad F310
But what i would like to know after you install the software on the clamshell, is there a certain item we can call for from the winlibj file to let us use the game pad?
|
|
#4
|
|||
|
|||
|
Re: Programming Logitech Gamepad F310
Use the Joystick class. All game controllers and joypads all look like joypads to the computer. The only difference is the number of buttons and joysticks
|
|
#5
|
||||
|
||||
|
Re: Programming Logitech Gamepad F310
so is there a way that when i call of the joysticks that both of the "thumbsticks" are used or do i have to call for two seperate joysticks?
|
|
#6
|
|||
|
|||
|
Re: Programming Logitech Gamepad F310
Now, I am not sure about that. My computer interpreted the second joystick as the "Z" axis, and it can only do the left and tight movement. I am not sure about your gamepad, it is totally dependent on the drivers. I am not sure, but it might be a combination of the throttle and Z axis.
|
|
#7
|
||||
|
||||
|
Re: Programming Logitech Gamepad F310
okay ill try that tomorrow, thanks for the help! its greatly apprectiated!
|
|
#8
|
|||
|
|||
|
Re: Programming Logitech Gamepad F310
Now, I might be very wrong, so remember to put the robot on cinder blocks or something so it does not go haywire and dangerous. A safe way is just outputting the throttle and z on the console window using System.out.println();
|
|
#9
|
||||
|
||||
|
Re: Programming Logitech Gamepad F310
Thanks for this thread. I assume this means that If our driver station is running on a Windows 7 laptop and Win7 sees the gamepad and loads the drivers then the wpilibj will see the controllers as a Joystick.? Or is it more like XP and we have to find and install a .dll for the gamepad we choose?
|
|
#10
|
|||
|
|||
|
Re: Programming Logitech Gamepad F310
Quote:
|
|
#11
|
||||
|
||||
|
Re: Programming Logitech Gamepad F310
I find it good to use the getRawAxis() command. It lets you use all four or five axis from a game controller (two for each stick, one for the triggers on the xbox 360 controllers my team used last year) easily, just by specifying the number, which is relatively easy to determine via trial and error.
EDIT: For buttons, I use getRawButton() in the same way (give it the number of the button). One issue I had was that the D pad wouldn't work, but I think thats because it is read as a 2D position, not a single axis, or something like that. Last edited by JewishDan18 : 12-01-2011 at 23:35. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|