Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Using a Logitech Game Controller (http://www.chiefdelphi.com/forums/showthread.php?t=93990)

wiiking123 24-03-2011 19:26

Using a Logitech Game Controller
 
Recently, I tried to set up our robot to use a normal USB Logitech game controller using the .VI for an xbox 360 controller I found @ http://decibel.ni.com/content/docs/DOC-6036 . When I tried just running the .VI all by itself, the .VI was able to register all of the buttons, joysticks, ETC. I tried incorporating the .VI into the TELEOP.VI in the robot code, but all of the sub.VIs were considered invalid for the cRIO. When I tried incorporating the xbox vi into the teleop vi, I essentially copied and pasted the whole code into the teleop.vi. How should I go about integrating the xbox 360 controller VI into my robot code, and how do others go about using a normal USB controller for their robot?

theprgramerdude 24-03-2011 19:32

Re: Using a Logitech Game Controller
 
I'm no expert on Labview, but for C++, we can use the regular joystick object with everything the controller does. There's no need to use a separate, special purpose object like the 360 one. Have you tried using only the Joystick Vi instead, and telling it that the controller IS the joystick?

Ian McShane 24-03-2011 19:40

Re: Using a Logitech Game Controller
 
I have not tried to use an xbox 360 controller, but I would recomend trying to use the controller with incorporating the 360 vi and use the joystick vi. if that does not work then i am not sure how to help you. because i think you can use the 360 like any other joystick(button1,2,3,4,5,x and y axis, etc.) give that a shot and see what happens.:cool:

Greg McKaskle 24-03-2011 21:30

Re: Using a Logitech Game Controller
 
While it is possible to make this work for offseason events, the competition FRC robot must be driven using the Driver Station application connected to the field. The Driver Station cannot be modified and will work with any HID joystick devices, including gamepads, that has Windows HID drivers. You cannot make it work by changing out VIs.

Greg McKaskle

WizenedEE 24-03-2011 21:33

Re: Using a Logitech Game Controller
 
The driver station software will recognize up to four USB devices that call themselves "joysticks" and send them to the "joystick get" functions in the WPI lib. You have to use that. The get input device function only works with a normal computer, not a real time device like the C RIO, and definitely not when it's connected offboard.

So basically, just replace all of your uses of get input device with WPI Lib Joystick Get. (Make sure you open the joystick and set the reference and everything!)

Another thing to note is that you can't really test programs meant to run on the C RIO on a laptop or anything, unless it doesn't have any IO other than the front panel; they are completely different beasts. (Testing a math script is fine, if you just put values into the front panel and see the outputs there as well.)


All times are GMT -5. The time now is 09:28.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi