Go to Post Drive fast...drive true...otherwise it will kind of crush you - techhelpbb [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-01-2016, 08:59
onenerdyguy onenerdyguy is offline
Registered User
FRC #5929
 
Join Date: Jan 2016
Location: Lake Park, MN
Posts: 32
onenerdyguy is an unknown quantity at this point
Question on Autonomous Mode

So, rookie team, question:

Can we have any way to switch commands during Autonomous from the driver station?

I.E. Have a big setup of buttons we could push for the obstacle we're coming up against?

We've got it driving forward and such, but we're struggling to figure out how the bot should know how to deal with the obstacle in front of it, due to the high amount of variation.
  #2   Spotlight this post!  
Unread 22-01-2016, 09:08
D_Price's Avatar
D_Price D_Price is offline
Engineer/Mentor
AKA: Derek
FRC #1708 (Amp'd Robotics (formally Natural Selection))
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: McKeesport, Pa
Posts: 385
D_Price has much to be proud ofD_Price has much to be proud ofD_Price has much to be proud ofD_Price has much to be proud ofD_Price has much to be proud ofD_Price has much to be proud ofD_Price has much to be proud ofD_Price has much to be proud ofD_Price has much to be proud of
Re: Question on Autonomous Mode

Unfortunately during autonomous you can not directly interact or control the robot. Just try to position yourself in such a way that you can run the autonomous code you are writing now. Or write multiple codes so that right before the match you can be prepared for the difference in obstacles
__________________
Team member 2004-2008
Team mentor 2008-2014

http://team1708.steelcityrobotics.or...tics/Home.html
"12 years as a student and mentor and proud of it"
  #3   Spotlight this post!  
Unread 22-01-2016, 09:15
Oromus's Avatar
Oromus Oromus is offline
Lead Programmer, Community Liason
AKA: Ryan
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Florida
Posts: 80
Oromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to behold
Re: Question on Autonomous Mode

Use SmartDashboard to choose which autonomous you need before the match. It lets you add things like radio buttons to the screen, and you can use those to choose which defense is in front of you. Quick snippet of code:

Code:
//Initialize the SendableChooser
public void robotInit() {
	SendableChooser chooser = new SendableChooser();
	chooser.initTable(NetworkTable.getTable("Defense Chooser"));
	chooser.addDefault("Low Bar", "lowbar");
	chooser.addObject("Ramparts", "ramparts");
	chooser.addObject("Moat", "moat");
	chooser.addObject("Cheval de Frise", "cheval");
	chooser.addObject("Rock Wall", "rockwall");
	//ect...add the rest of the defenses

	SmartDashboard.putData("Autonomous Defense Chooser", chooser);
}


...


//Use the below code to check which defense is selected
        
String defense = chooser.getSelected().toString();
        
if (defense.equals("lowbar")) {
	//Lowbar auto
} else if (defense.equals("ramparts")) {
	//ramparts auto
} else if (defense.equals("moat")) {
	//moat auto
}
//ect...add the rest of the if/elses
The SendableChooser class lets you create a set of radio buttons. You use SendableChooser.addDefault() and SendableChooser.addObject() to add different options to it. The two Strings arguments, in order, are display name and an internal value. The first String (the display name) is what people see in SmartDashboard. The second String (the internal value) is what is returned when you call SendableChooser.getSelected(). Hope this helps!
__________________


2016 Roles: Manipulator, Strategy Co-Lead, Programmer
2016 Orlando Regional: Quarterfinalist (Captain w/ 1557, 5557 and 4352)
2016 Rocket City Regional: Quarterfinalist (w/ 283 and 34), Regional Chairman's Award Winner
2016 Championship: N/A (had fun and was inspired, that's what counts)
-------------
2015 Role: Programmer
2015 GSCR: Quarterfinalist (w/ 4189 and 4026), Regional Chairman's Award Winner
2015 Orlando Regional: Semifinalist (w/ 456 and 86), Imagery Award Winner
2015 Championship: Pit Safety Award Winner

Last edited by Oromus : 22-01-2016 at 09:24.
  #4   Spotlight this post!  
Unread 22-01-2016, 09:15
KosmicKhaos's Avatar
KosmicKhaos KosmicKhaos is online now
Calm Cool Collected
AKA: Andrew Thompson
FRC #1126 (SparX)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Webster NY
Posts: 135
KosmicKhaos has a spectacular aura aboutKosmicKhaos has a spectacular aura about
Re: Question on Autonomous Mode

Quote:
Can we have any way to switch commands during Autonomous from the driver station?
No, not DURING autonomous per G14
Quote:
G14 During AUTO, DRIVE TEAMS may not directly or indirectly interact with ROBOTS or OPERATOR
CONSOLES unless for personal safety, OPERATOR CONSOLE safety, or pressing an E-Stop for ROBOT safety.
However,
Quote:
Have a big setup of buttons we could push for the obstacle we're coming up against?
Yes, this is allowed as long as you push the button before autonomous starts. It is ok to have multiple auto modes programmed for each defense and have a big setup of buttons to choose the auto mode you wish to run, you just have to select it before the match starts.
  #5   Spotlight this post!  
Unread 22-01-2016, 09:16
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Question on Autonomous Mode

Recommendation: Add an input on your dashboard which lets you choose one of multiple autonomous programs to run. Ensure your drive team is trained in its usage and that they select the correct obstacle prior to match start. This will accomplish what you require.
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
  #6   Spotlight this post!  
Unread 22-01-2016, 09:38
onenerdyguy onenerdyguy is offline
Registered User
FRC #5929
 
Join Date: Jan 2016
Location: Lake Park, MN
Posts: 32
onenerdyguy is an unknown quantity at this point
Re: Question on Autonomous Mode

Perfect, that's exactly what I was hoping you'd say. We've got auto code done for every obstacle so far that's testing solid, so I'm wanting to make sure we could pick it to, you know, do the right obstacle.

Thanks!
  #7   Spotlight this post!  
Unread 22-01-2016, 10:09
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: Question on Autonomous Mode

This has pretty much been covered, but I'll go into a bit more detail regarding the default dashboard options.

The second tab of the dashboard, labeled Basic, has buttons, LEDs, sliders, and strings that are already tied to Network table variables named "DB/Button 0", etc. You can also rename the controls from your robot code by setting the network table string array "DB/Button Names", etc. The default LV code shows how to do this in Begin.vi. These controls can be used however you like, to set default speeds, directions, or names of options.

This year a new selector was added to the Drive tab that displays a list of autonomous beneath the gyro indicator. The names shown can be set on the robot into an array of strings variable called "Auto List" and the value selected by the drive team will be available in "Auto Selector".

SmartDashboard has a similar capability using the SendableChooser.

Greg McKaskle
  #8   Spotlight this post!  
Unread 22-01-2016, 10:54
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,117
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: Question on Autonomous Mode

IMHO, you might want to consider these options:

1) Which defense you are going over (or just drive up to get the reach points, or none if you are the spy bot)
2) Which goal you are attempting (or not, since there are only 2 low goals, and you might be the bot that sits it out)
3) If you are going for a goal, which position you are starting in
4) Do you delay to give the other bots more time to clear the path (you don't want to cross, and collide with another bot driving in front of you to get to a goal.
5) Do you back out of the low goal to give another bot the opportunity to go after you.
  #9   Spotlight this post!  
Unread 22-01-2016, 14:06
rpaulsen rpaulsen is offline
Mr. Paulsen - Huguebots Coach 5202
AKA: Mr. Paulsen
FRC #5202 (The New Ro Bots)
Team Role: Coach
 
Join Date: Dec 2013
Rookie Year: 2013
Location: New Rochelle High School
Posts: 34
rpaulsen is an unknown quantity at this point
Re: Question on Autonomous Mode

Sounds like a great reason to get your team members out there scouting. Once you get your match list get out there and talk to your alliance partners. Make sure your scouts know the capabilities of your robot, and work with your Alliance mates to determine which defense it makes the most sense for you to start in. There is no rule that states that you must start directly in front of your driver station.

As it stands 2 groups of defenses (B&D) are pretty straight forward to pass, especially if you are using 8" wheels, and add the Low Bar (E) to this list if you are under 14". This alone would allow you to fit into any strategy your alliance might come up with because you will always have a Defense you can pass. Though It will be awesome to see robots taking on the A&C Defenses in AUTO.
  #10   Spotlight this post!  
Unread 22-01-2016, 14:08
Taylor's Avatar
Taylor Taylor is offline
Professor of Thinkology, ThD
AKA: @taylorstem
FRC #3487 (EarthQuakers)
Team Role: Teacher
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Indianapolis, IN, USA 46227
Posts: 4,569
Taylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond repute
Re: Question on Autonomous Mode

We've put physical switches on our chassis that we have set before auto mode began to let the robot select the proper autonomous mode
__________________
Hi!
  #11   Spotlight this post!  
Unread 22-01-2016, 14:18
nightpool's Avatar
nightpool nightpool is offline
robotRectifier
AKA: Evan
no team (formerly of CORE 2062)
Team Role: Alumni
 
Join Date: Oct 2011
Rookie Year: 2011
Location: Waukesha, WI
Posts: 81
nightpool is on a distinguished road
Re: Question on Autonomous Mode

Quote:
Originally Posted by Taylor View Post
We've put physical switches on our chassis that we have set before auto mode began to let the robot select the proper autonomous mode
If you don't mind, was there any particular reason you chose to use physical switches over using SmartDashboard or the FRC dashboard? Just a matter of comfort, or something else? Seems like a lot less flexible option to me, but I'm wondering if there's something else.
__________________
Proud alum of CORE 2062.
www.core2062.com
  #12   Spotlight this post!  
Unread 22-01-2016, 18:29
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,033
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Question on Autonomous Mode

OP, I think you're using RobotPy [you had posted on the python forum earlier]?

RobotPy's wpilib utilities has some really useful autonomous tooling to allow you to select multiple modes via SmartDashboard (each .py file in the autonomous directory is automatically detected and added to the options), and also a really easy to use state machine helper for quick and easy autonomous mode creation.

Code:
from robotpy_ext.autonomous import StatefulAutonomous
        
class DriveForward(StatefulAutonomous):

    MODE_NAME = 'Drive Forward'

    def initialize(self):
        pass

    @timed_state(duration=0.5, next_state='drive_forward', first=True)
    def drive_wait(self):
        pass

    @timed_state(duration=5)
    def drive_forward(self):
        self.drive.move(0, 1, 0)
Check it out at http://robotpy-wpilib-utilities.read...utonomous.html

We also have a sample program that uses both the stateful autonomous helper and the automatic autonomous chooser.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #13   Spotlight this post!  
Unread 24-01-2016, 15:55
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 325
fovea1959 will become famous soon enough
Re: Question on Autonomous Mode

Quote:
Originally Posted by nightpool View Post
If you don't mind, was there any particular reason you chose to use physical switches over using SmartDashboard or the FRC dashboard? Just a matter of comfort, or something else? Seems like a lot less flexible option to me, but I'm wondering if there's something else.
We've gone both ways, they each have pros and cons.

Doing switches on the robot is reliable, but you can occasionally forget to set the switches before leaving the field (when you would still have a chance to fix it on the DS).

Doing it on the DS is fine, but you either have to make the settings stick across power downs, or else have enough time to set the autonomous in the interval between when your DS makes contact with the robot and when the match starts. If you are having trouble getting the DS talking to the bot (happens...), you might not have enough time.

DS with persistence seems to be best middle ground; you can set it while in queue, and fix it at the last second if needed.
Closed Thread


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 21:37.

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