Go to Post Your team will be more of a team and not a group of students who are just building a robot. Instead of being in FIRST, you will be FIRST. - JackN [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 27-01-2012, 16:22
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Toggle between two cameras

Hello -

I've written two Axis M1011 cameras into our code. We've deleted the Kinect Skeleton tab and replaced it with a Camera 2 tab which houses our visual display.

Now, from my understanding, we cannot use the mouse during the competition, so how can I make a button on a joystick switch between camera tabs?

Thanks.
Reply With Quote
  #2   Spotlight this post!  
Unread 27-01-2012, 16:39
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Toggle between two cameras

Quote:
Originally Posted by DominickC View Post
...from my understanding, we cannot use the mouse during the competition...
What rule do you read as saying that?

If you still want to use a joystick button, it is possible to switch tabs in LabVIEW under program control. Right-click the tab control in the block diagram and choose Create -> Property Node -> Value. Change it from a read to a write, and now you have a way for the program to choose the visible tab.

You can send a "which tab to display" value in the Dashboard data from the Robot, and have your custom Dashboard use that value to decide which tab to show.
Reply With Quote
  #3   Spotlight this post!  
Unread 27-01-2012, 16:52
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Toggle between two cameras

Ah, thanks. I've managed to create a "Value" block, however I have no clue how to tell it what I want to do...any assistance?

EDIT - I've changed it from read to write. Now, how do I give it input? (Joystick buttons, for example)

Last edited by DominickC : 27-01-2012 at 16:59.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-01-2012, 18:43
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Toggle between two cameras

Any help?
Reply With Quote
  #5   Spotlight this post!  
Unread 27-01-2012, 20:18
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,752
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: Toggle between two cameras

You can certainly use the mouse to switch tabs, and it requires no programming. You may want to change the font to be much larger so that it is easier to hit.

If you want to have another way to switch the tabs, you just program it in. First can you describe how you want to switch -- keys, etc?

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 27-01-2012, 20:52
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Toggle between two cameras

While the keyboard/mouse shortcuts are viable options, I was hoping to streamline the process by opening a joystick and using a button. That way the shooter has quick access to both camera feeds..
Reply With Quote
  #7   Spotlight this post!  
Unread 27-01-2012, 20:57
NeatNit's Avatar
NeatNit NeatNit is offline
Alumni Programmer
FRC #1577 (Steampunk)
Team Role: Teacher
 
Join Date: Sep 2011
Rookie Year: 2011
Location: Israel
Posts: 60
NeatNit is an unknown quantity at this point
Re: Toggle between two cameras

I'm gonna go ahead and as a relevant question as well - is there a way to get the joystick values to the dashboard without travelling to the robot and back? Reasons being the obvious delay introduced, as well as the waste of resources (however tiny). We could have used it last year, and this year I'm also thinking of a control system utilizing it. In both cases, the delay of going through the robot makes it useless.


DominickC - if you've found the correct property node input to control the active tab, and want to use a joystick button to control it, then what you need to do is, first, make sure you have the joystick value in the cluster you're sending to the dashboard from the cRIO. Then, you can simply use this value in the dashboard project and connect it to the property node to switch the tab.
Reply With Quote
  #8   Spotlight this post!  
Unread 27-01-2012, 21:12
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Toggle between two cameras

Here's what I've come up with.

Within teleop, I've opened a reference to Joystick 3, and wired the output of button 1 to my bundle. (Pretend I flattened it to a string before it went to the bundle, I realized I left that part out). I then sent it to the Driver's Station.

Within the Driver's Station, I've unbundled it. Now, where do I wire the output to?
Attached Thumbnails
Click image for larger version

Name:	Bundle.JPG
Views:	32
Size:	20.1 KB
ID:	11603  Click image for larger version

Name:	Image.JPG
Views:	34
Size:	21.6 KB
ID:	11604  
Reply With Quote
  #9   Spotlight this post!  
Unread 27-01-2012, 21:47
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Toggle between two cameras

I've just wired the value of the joystick being unflattened to the value Vision, which created an orange wire. Will this work for me?
Reply With Quote
  #10   Spotlight this post!  
Unread 27-01-2012, 22:37
NeatNit's Avatar
NeatNit NeatNit is offline
Alumni Programmer
FRC #1577 (Steampunk)
Team Role: Teacher
 
Join Date: Sep 2011
Rookie Year: 2011
Location: Israel
Posts: 60
NeatNit is an unknown quantity at this point
Re: Toggle between two cameras

Quote:
Originally Posted by DominickC View Post
I've just wired the value of the joystick being unflattened to the value Vision, which created an orange wire. Will this work for me?
Probably not. Instead, right-click the Value input and create a constant to it. Create another copy of this constant, and then make sure that each one is set to the tab you want. Then, you can use use the Select function (or case structure, or any other way you want) to choose between the constants.

Hope this helps!
Reply With Quote
  #11   Spotlight this post!  
Unread 27-01-2012, 22:44
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Toggle between two cameras

Ah, NOW I get it! Thanks Alan, Greg and NeatNit!
Reply With Quote
  #12   Spotlight this post!  
Unread 28-01-2012, 10:04
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,752
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: Toggle between two cameras

I have never tried to open a joystick connection in multiple apps using DirectInput, which is what the DS uses.

I'm leaving town in an hour, so I'll describe it and I look forward to hearing the results.

In the LV dashboard project code, try using the Connectivity>>Input Device functions to open a joystick and read back the buttons. Please note that these VIs aren't quite as flexible as the stuff used for the DS, so once you open a connection, it is not possible to reposition the USB port of the joystick until the DLL leaves memory. This shouldn't be an issue except during development when it causes head-scratching.

Greg McKaskle
Reply With Quote
  #13   Spotlight this post!  
Unread 15-06-2012, 12:34
4085's Avatar
4085 4085 is offline
Technical Difficulties
AKA: Sebastian Brosious
FRC #4085 (Technical Difficulties)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Reynoldsburg, Ohio
Posts: 14
4085 is an unknown quantity at this point
Re: Toggle between two cameras

Hey i found this intresting i just programmed a second camera in and got it within the tabs, Dominick, can you please show me how you programmed in the toggle between the two cameras. With pictures please :/ help please and THANK YOU. Pm me if you can
__________________
_______________________________________________

WE ARE...

Raiders!

Last edited by 4085 : 15-06-2012 at 17:30.
Reply With Quote
  #14   Spotlight this post!  
Unread 16-06-2012, 08:58
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Toggle between two cameras

I'm going to run with the assumption that you've got a second camera running in an additional "Camera" tab.

First, you'll need to pass a boolean from a joystick or some other input to the DS. This is done via "High Priority User Data".

Then, on the block diagram, right click on each of your "Viewer" icons, then navigate to Create>>Property Node>>Value. You'll have to change each of these property nodes to write by right clicking on them.

Take the boolean you received and create a case structure. In the true case, wire the "Camera Image" enum to the first viewer property node. In the false case, wire the remaining enum to the second viewer property node.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	28
Size:	6.7 KB
ID:	12831  
Reply With Quote
  #15   Spotlight this post!  
Unread 16-06-2012, 17:04
4085's Avatar
4085 4085 is offline
Technical Difficulties
AKA: Sebastian Brosious
FRC #4085 (Technical Difficulties)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Reynoldsburg, Ohio
Posts: 14
4085 is an unknown quantity at this point
Re: Toggle between two cameras

Thanks for your help!
__________________
_______________________________________________

WE ARE...

Raiders!
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 22:32.

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