Go to Post Battle Bots and other robot fighting competitions is to First Like McDonalds to Hamburgers They get the idea, and have the taste, but they are bad for you in the long run. - Conor Ryan [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 17-04-2014, 19:38
BriteBacon's Avatar
BriteBacon BriteBacon is offline
Happy birthday to me!
AKA: Brian Jung
FRC #0074 (Team C.H.A.O.S.)
Team Role: Alumni
 
Join Date: Apr 2014
Rookie Year: 2012
Location: Holland, MI
Posts: 50
BriteBacon is on a distinguished road
Drop-Down for autonomous in dashboard

My team wants to have separate autonomous modes to switch between at Worlds. We currently have just a booleon on the dashboard to switch between single ball auton and double ball auton, but we also want to have a mode where we just drive forward. We figured a drop-down menu would be the easiest way to switch between each mode but we can't seem to figure out how to do it.

Thanks in advance, Team 74
Reply With Quote
  #2   Spotlight this post!  
Unread 17-04-2014, 20:06
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: Drop-Down for autonomous in dashboard

The menu control in LabVIEW displays strings, but its datatype is a numeric which starts at zero and counting up. So this is quite easy to send to the robot to select which action to take.

A slightly more complex form is used by the testing code. You can take the value of the drop-down and the property that returns the list of strings. Then you index the strings and write that to a SD variable. On the robot, you can wire the string directly to the case structure. Be careful that the strings match in case, spacing, etc.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 18-04-2014, 14:51
Iaquinto.Joe's Avatar
Iaquinto.Joe Iaquinto.Joe is offline
RPI 2018
AKA: Joe Iaquinto
FRC #0308 (The Monsters)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2011
Location: United States
Posts: 166
Iaquinto.Joe is a jewel in the roughIaquinto.Joe is a jewel in the roughIaquinto.Joe is a jewel in the rough
Re: Drop-Down for autonomous in dashboard

If you aren't already using the cypress or DIO on the driverstation, we found it was the quickest way to change Autonomous modes.

It uses the WPILib->Driverstation->CompatibilityIO->GetDigIn.vi and a Boolean array to number conversion.



To change the mode you just flip the switches to the right binary representation of the mode number on the driverstation io panel.

__________________
4 year 2011 - 2014 FRC team 308 member, Lead Programmer - C++ / LabVIEW

3 year 2011, 2013, 2014 OCCRA member, Co-Captain OCCRA team 308
  • OCCRA Engineering Excellence - Waterford Kettering 2013
  • Innovation in Control - 2011
  • Quality award- Northville 2012
  • Engineering Excellence- Howell 2014
  • Innovation in Controls- Livonia 2014
Reply With Quote
  #4   Spotlight this post!  
Unread 01-12-2014, 22:53
RoboNerd01's Avatar
RoboNerd01 RoboNerd01 is offline
Super User
AKA: Austin Rowe
FRC #3604 (Goon Squad)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Woodhaven
Posts: 11
RoboNerd01 is an unknown quantity at this point
Wink Re: Drop-Down for autonomous in dashboard

I love the creative way the person above does it. But there is a much simpler and convenient way. And it will give you your desired result of a drop down menu!

1. In the robots code create a case structure in which the auton code modes will be placed. The condition of this case structure will be connected to a dashboard nimber variable. Go to the WPI robotics library palate then go to dashboard and then find the SD read number VI. Name the variable what you want and remember it. Make sure the case structure has enough cases to hold all your modes of course.

2. Now in the dashboard code. Go to the numerics palate and get an Enum constant. Right click it, and change it to a control.

3. Right click it again and select edit items and click insert. Add as many modes as you want and take note of the values next to each item (or mode) you enter. As these are the case the mode will be in in the robot's code.

4. Now you need to get a SD write number VI. Name it the same as the other dashboard variable.

5. And lastly, connect the Enum control to the SD write number VI.

Done! . Feel free to PM me for questions. I'm happy to help.

Last edited by RoboNerd01 : 01-12-2014 at 23:00.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-12-2014, 12:54
FrankJ's Avatar
FrankJ FrankJ is offline
Robot Mentor
FRC #2974 (WALT)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Marietta GA
Posts: 1,933
FrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond repute
Re: Drop-Down for autonomous in dashboard

Since the support for the cypress board is going away... Will the IO screen be on the 2015 DS? So the question is really is it on the Beta DS? While we never used the cypress board, we have used the IO page for setting configurations & defaults. If it does, you can accomplish the same thing with smart dashboard.
__________________
If you don't know what you should hook up then you should read a data sheet
Reply With Quote
  #6   Spotlight this post!  
Unread 02-12-2014, 13:34
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Quote:
Originally Posted by FrankJ View Post
Since the support for the cypress board is going away... Will the IO screen be on the 2015 DS? So the question is really is it on the Beta DS? While we never used the cypress board, we have used the IO page for setting configurations & defaults. If it does, you can accomplish the same thing with smart dashboard.

The IO screen has been removed from the 2015 DS. However, the default labview dashboard has 4 buttons and 4 sliders that can be used for that purpose. As you mentioned, it is trivial to do the same thing with smart dashboard.
Reply With Quote
  #7   Spotlight this post!  
Unread 02-12-2014, 15:33
GuyM142's Avatar
GuyM142 GuyM142 is offline
Registered User
AKA: Guy
FRC #3339 (BumbleBee)
Team Role: Mentor
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 158
GuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really nice
Re: Drop-Down for autonomous in dashboard

In our team we just put an Enum control on the dashboard and send it as a number to the robot (with the vi's that has SD on the corner).
On the robot we convert it back to the enum and use a case structure to define each auton state.
I currently don't have the code but if it was'nt clear enough ask me for more info, I'll be happy to help anytime

I've just noticed that it's actually a pretty old post, maybe my comment is not relevant
Reply With Quote
  #8   Spotlight this post!  
Unread 03-12-2014, 08:48
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: Drop-Down for autonomous in dashboard

The DS had the virtual I/O on it before Network Tables and Smart Dashboard existed. The LCD screen was on the front to match the QB DS. As mentioned, the templates show how to do the equivalent within the DB, allowing the DS to lose some baggage and do some other things better.

Greg McKaskle
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 20:07.

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