Go to Post Girlfriend? What is that? A rare Pokemon? - DanielPlotas [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 24-02-2012, 18:14
evilcrouton evilcrouton is offline
Registered User
FRC #2851
 
Join Date: Feb 2011
Location: Behind yOU
Posts: 11
evilcrouton is an unknown quantity at this point
Exclamation SmartDashboard's sendableChooser

I see that you can use Smartdashboard's sendableChooser to create radio buttons to choose autonomous programs with command-based programming. However, is it possible to do this with iterative robot? This is what i have in robotInit():

Code:
        NetworkTable.initialize();
        autoChooser = new SendableChooser();
        autoChooser.addDefault("Default program", new Autonomous1());
        autoChooser.addObject("Experimental auto", new Autonomous2());
        SmartDashboard.putData("Autonomous mode chooser", autoChooser);
Where Autonomous1() and Autonomous2() are new classes with autonomous code. With this code, SmartDashboard displays two radio buttons. Now here comes the tricky part. What do I do in autonomousPeriodic() to choose what is selected?
Reply With Quote
  #2   Spotlight this post!  
Unread 24-02-2012, 23:46
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: SmartDashboard's sendableChooser

If you call autoChooser.getSelected(), it will return to you the current choice as an Object which you can cast however you'd like. I don't know how you have Autonomous1() and Autonomous2() set up, so I don't know how you'd specifically do it.
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 09:53.

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