Go to Post If there are no top tier teams, then who do we look up to for inspiration? - artdutra04 [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
  #1   Spotlight this post!  
Unread 02-02-2015, 23:29
Crossle86's Avatar
Crossle86 Crossle86 is offline
Software Engineer
AKA: Richard Corn
FRC #4450 (Olympia Robotics Federation)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Olympia, WA.
Posts: 92
Crossle86 is an unknown quantity at this point
Switch Camera in Labview Dashboard with Joystick

We are using Java on the robot and the Labview dashboard program. We don't know much about Labview but have customized the DB by adding simple display controls and setting values from Java with SmartDashboard.PutXXX calls. The Labview DB has a drop down list that allows the DS operator to select which camera feed to display. We'd like to be able to do that camera choice (and switch on the fly) with a joystick button. I'm drawing a blank on how to change the setting of the camera selection drop down control from the Java code monitoring the joystick or if there is a way to have the DB LV code monitor the joystick and change the camera display. I'm sure there is a way to do this but its outside our LV capability at this moment. Any help would be appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2015, 06:52
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: Switch Camera in Labview Dashboard with Joystick

If the camera selector already does what you want, the task isn't hard, but will involve a little code in each language.

In Java, on the robot, read the joystick and update a Smart Dashboard variable that represents the desired camera state.

On the DB, in LV, in the top loop, you will want to read the Smart Dashboard variable by name and update the LabVIEW control using a local variable update. The top loop already has several reads of the joystick and motors. You can drop another by right clicking on the diagram and going to the bottom of the palettes. Drop the SD Read Value, choose the correct type from the selector, and wire up the name of the SD Variable.

In the second loop, where the vision is performed, you can right click on the blue Vision terminal and choose to Create >> Local Variable. Drop it into the top loop downstream of the SD Read. Wire the output of the read to the local variable. Add any mapping math to either the Java or Dashboard.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2015, 14:24
Crossle86's Avatar
Crossle86 Crossle86 is offline
Software Engineer
AKA: Richard Corn
FRC #4450 (Olympia Robotics Federation)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Olympia, WA.
Posts: 92
Crossle86 is an unknown quantity at this point
Re: Switch Camera in Labview Dashboard with Joystick

Greg,
Thanks for the detailed answer. I think I understand and I have coded up your suggestion. Will test it later today.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2015, 13:08
Crossle86's Avatar
Crossle86 Crossle86 is offline
Software Engineer
AKA: Richard Corn
FRC #4450 (Olympia Robotics Federation)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Olympia, WA.
Posts: 92
Crossle86 is an unknown quantity at this point
Re: Switch Camera in Labview Dashboard with Joystick

Greg,
That worked like a charm.
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 03:52.

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