Go to Post We want you here, and we want you back. Welcome. - Gary Dillard [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 10-01-2013, 12:05
ctccromer's Avatar
ctccromer ctccromer is offline
Animus
AKA: Tucker Campbell
FRC #3753 (Bulah Bots)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Baton Rouge, Louisiana
Posts: 190
ctccromer is a name known to allctccromer is a name known to allctccromer is a name known to allctccromer is a name known to allctccromer is a name known to allctccromer is a name known to all
Re: Using a (Logitech) Controller?

Quote:
Originally Posted by Mark McLeod View Post
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,
  1. Create a Robot Project (inserting your team number into the IP address)
  2. Expand the Team Code folder
  3. Edit the Teleop.vi block diagram
  4. To begin with use just the Joystick that is already there to display it's buttons.
  5. Open the Robot Main.vi
  6. Press the Run arrow to start your project
  7. Plug your game controller into your laptop
  8. Start the Driver Station app.
  9. Go to the Driver Station Setup tab and see if the game controller is listed on the right in the first/top position. If not then click and drag it up to the USB 1 spot.
  10. Enable the Driver Station.
  11. Go to the Teleop front panel to see your button displays.

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.
Thanks for the detailed help! I tried doing this however, after I deploy the code to the cRIO and open the drive station, it says I lose connection with the cRIO and boots me. Happened two times so far but I'll try it more with another cable after school.
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?
__________________
Team 3753 BulahBots
Reply With Quote
  #17   Spotlight this post!  
Unread 10-01-2013, 12:17
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 10-01-2013 at 12:21.
Reply With Quote
  #18   Spotlight this post!  
Unread 10-01-2013, 12:17
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
  #19   Spotlight this post!  
Unread 10-01-2013, 17:18
ctccromer's Avatar
ctccromer ctccromer is offline
Animus
AKA: Tucker Campbell
FRC #3753 (Bulah Bots)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Baton Rouge, Louisiana
Posts: 190
ctccromer is a name known to allctccromer is a name known to allctccromer is a name known to allctccromer is a name known to allctccromer is a name known to allctccromer is a name known to all
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
__________________
Team 3753 BulahBots
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:12.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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