|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Using a (Logitech) Controller?
Your program is only a sub vi and won't perform on it's own.
It's missing some essential stuff like communication with the Driver Station that reads the joystick. You also need to have the Driver Station app running along with your LabVIEW session. It would be easiest if you created a default robot project, from the Getting Started window, then added your code to the project. The default project has most of what you need already, including one joystick. We can walk you through the steps to take. For example,
This is the general format to use a joystick ![]() Take a look at some of the NI tutorials at: https://decibel.ni.com/content/docs/DOC-8923 The [FRC 2013] FRC Robot Framework Tutorial would be a start. Last edited by Mark McLeod : 09-01-2013 at 18:44. |
|
#2
|
|||
|
|||
|
Re: Using a (Logitech) Controller?
As Mark pointed out, your VI was running on the PC, not on the cRIO. The WPILib VIs to read the joysticks don't work that way, and will be zeroes instead. The Joystick VIs work via the driverstation protocol and the VIs read those values on the cRIO.
Greg McKaskle |
|
#3
|
||||
|
||||
|
Re: Using a (Logitech) Controller?
Quote:
Also, running RobotMain.vi does not show the lights that I linked to the 12 buttons of joystick 1 in teleop. Should I run teleop.vi instead of RobotMain.vi? |
|
#4
|
|||||
|
|||||
|
Re: Using a (Logitech) Controller?
You start the run from RobotMain because it's at the top of the calling tree and starts everything else, so for instance, Begin.vi gets called to open all your devices before Teleop gets called to handle your driver controls.
Then you switch to the Teleop front panel to watch the indicators you added. You should be running both LabVIEW and the Driver Station from the same laptop, same account. Don't switch accounts or anything like that. It is also possible to run the Driver Station on a separate computer and the LabVIEW from a programming laptop. You just have to make sure the IPs don't conflict, e.g., the Driver Station computer is 10.37.53.5, and the programming computer is 10.37.35.6 Last edited by Mark McLeod : 10-01-2013 at 12:21. |
|
#5
|
|||
|
|||
|
Re: Using a (Logitech) Controller?
You will need to run RobotMain, and then on the driver station panel, enable the robot in teleop mode.
This is more complicated than it would need to be to simply read from a joystick, but that is because it is assuming that your purpose in doing this is to safely drive a robot on a FIRST field. The DS actually reads the joysticks and communicates it to the robot. Your code reads the joystick settings from the robot service, and then you can turn on motors, etc. The DS and robotMain framework also control which code on your robot is actually executed and whether it is allowed to turn motors. Greg McKaskle |
|
#6
|
||||
|
||||
|
Re: Using a (Logitech) Controller?
IT WORKED! HUZZAH!! I wish yall could have seen my reaction
I think my issue earlier was that the power cable from the cRIO to the Power Distribytion Board is.. less than reliable. However this time I was able to MAKE SURE nothing happened, so I didn't lose connection to the cRIO, so it worked flawlessly I was able to note which buttons corresponded to which "Buttons" in LabVIEW via the LED Lights vi.Thank yall very much for the help (and patience). I really do appreciate it |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|