Go to Post Chief Delphi down for a few hours ON A WEEKEND??? This is MADNESS! - [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 08-01-2013, 14:09
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Random autonomous

Hello! I am programming in C++, and I came up with an interesting idea. What I would like to do is write multiple autonomous programs/routines, and have one of them randomly selected at the beginning of the match. I'm pretty sure we would first generate a random number between 1 and ___, and then have a series of case statements with each autonomous code assigned to a different case. Does this sound like something that can/should be done? I suppose I'll ask how on the C++ forum if it seems okay with everyone.... Thanks!
  #2   Spotlight this post!  
Unread 08-01-2013, 14:11
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,296
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Random autonomous

Quote:
Originally Posted by ekapalka View Post
Hello! I am programming in C++, and I came up with an interesting idea. What I would like to do is write multiple autonomous programs/routines, and have one of them randomly selected at the beginning of the match. I'm pretty sure we would first generate a random number between 1 and ___, and then have a series of case statements with each autonomous code assigned to a different case. Does this sound like something that can/should be done? I suppose I'll ask how on the C++ forum if it seems okay with everyone.... Thanks!
I'm sure it can be done, but why would you do it? You can't interfere with your opponents, and you can't be interfered with, so why do something random when you can instead do the best thing you're capable of?
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
  #3   Spotlight this post!  
Unread 08-01-2013, 14:14
yelk11 yelk11 is offline
Registered User
FRC #3414
 
Join Date: Jan 2012
Location: farmington
Posts: 27
yelk11 is an unknown quantity at this point
Re: Random autonomous

you could have the choices not random but controlled, the options would be available on the dash board and according to your surroundings you could change what happens in autonomous.
  #4   Spotlight this post!  
Unread 08-01-2013, 14:15
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Random autonomous

It's mostly the concept I'm interested in. I've seen it implemented on robots that were unanimously successful, with separate programs for defense, offense, and whatnot.... This year, we'll only be focusing on one aspect, so it wont really be of much concern. I'm just interested. Thanks!
  #5   Spotlight this post!  
Unread 08-01-2013, 14:43
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Random autonomous

You can do this. But you should not make it random, I used C++ last year, and programmed it so that by holding a single button on the joystick during disabled mode, the robot would select different routines to run in autonomous. The driver station had a text output describing the mode.

It was indeed very useful/effective. We could switch between shooting 2 balls from the key, shooting 2 and tipping the bridge, driving up to the fender and shooting 2 balls, shooting 4 balls, or feeding balls to an alliance member.

It made life easier to be able to switch modes without a reprogram, the only thing to watch out for is if your robot gets reset, or the field is reset, you have to re-select the mode (it's a good idea to use your preferred mode as the default).

Here is a link to my main source code file: https://github.com/TeamExcel/Project.../Robot2012.cpp
Line 489 shows the switching logic.
Line 420 resets the mode when the robot gets disabled.
Line 665 shows the switching between autonomous cases during running.

Last edited by DjScribbles : 08-01-2013 at 14:44. Reason: forgot to add the link
  #6   Spotlight this post!  
Unread 08-01-2013, 15:16
dk5sm5luigi's Avatar
dk5sm5luigi dk5sm5luigi is offline
Registered User
AKA: Nick Galotti
FRC #1735 (Green Reapers)
Team Role: Mentor
 
Join Date: Nov 2001
Rookie Year: 1997
Location: Worcester
Posts: 291
dk5sm5luigi has much to be proud ofdk5sm5luigi has much to be proud ofdk5sm5luigi has much to be proud ofdk5sm5luigi has much to be proud ofdk5sm5luigi has much to be proud ofdk5sm5luigi has much to be proud ofdk5sm5luigi has much to be proud ofdk5sm5luigi has much to be proud ofdk5sm5luigi has much to be proud ofdk5sm5luigi has much to be proud of
Send a message via AIM to dk5sm5luigi
Re: Random autonomous

For Lunacy we had several auto modes. One of them would randomly pick an existing auto mode. To make it more fun we also had an auto mode to drive straight for a random amount of time, then turn for a random amount of time, then drive straight for a random amount of time. This random auto mode could have been one of the randomly selected auto modes.

Granted in that year, as long as you kept moving in auto you were good.
__________________
Team 1735 Green Reapers: 2005-Present
Team 190 Gompei: 2001-2005
Team 155 Technonuts: 1997-2001
http://www.first-a-holics.com/
http://www.findrobotparts.com/
  #7   Spotlight this post!  
Unread 08-01-2013, 15:33
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Random autonomous

Quote:
Originally Posted by DjScribbles View Post
I used C++ last year, and programmed it so that by holding a single button on the joystick during disabled mode, the robot would select different routines to run in autonomous. The driver station had a text output describing the mode.
This method sounds perfect. I was not aware that you were allowed to influence the robot in any way during disabled/autonomous mode. Thanks for the example! Thanks everyone else, as well :D I'm glad I'm not the only person who thinks something similar to this is a good idea.
  #8   Spotlight this post!  
Unread 08-01-2013, 17:37
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,007
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Random autonomous

Many years ago, we selected our auto mode using switches on the robot. On off off meant one thing, on off on another, and so on.

Of course we knew which one we wanted to choose before the match started
__________________

I am N2IRZ - What's your callsign?
  #9   Spotlight this post!  
Unread 08-01-2013, 18:00
AndyBare AndyBare is offline
CAD Design and CNC Machinist
FRC #1261 (Robo Lions)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Burnsville, NC
Posts: 200
AndyBare is a glorious beacon of lightAndyBare is a glorious beacon of lightAndyBare is a glorious beacon of lightAndyBare is a glorious beacon of lightAndyBare is a glorious beacon of lightAndyBare is a glorious beacon of light
Re: Random autonomous

Quote:
Originally Posted by ekapalka View Post
This method sounds perfect. I was not aware that you were allowed to influence the robot in any way during disabled/autonomous mode. Thanks for the example! Thanks everyone else, as well I'm glad I'm not the only person who thinks something similar to this is a good idea.
ULTIMATE ASCENT is played by two competing alliances on a flat, 27 x 54 ft field. Each alliance consists of three robots. They compete to score as many discs into their goals as they can during a two (2)-minute and fifteen (15)-second match. The higher the goal in which the disc is scored, the more points the alliance receives.

The match begins with a fifteen (15)-second Autonomous Period in which robots operate independently of driver inputs. Hitting a button on the joystick is an input, so this is an illegal tactic.
  #10   Spotlight this post!  
Unread 08-01-2013, 18:57
slijin's Avatar
slijin slijin is offline
Pockets
AKA: Samuel Lijin
FRC #0694 (StuyPulse)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York City
Posts: 537
slijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to behold
Re: Random autonomous

What we've done traditionally is include a rotary binary switch (a more compact version of what Don mentioned) somewhere on our OI or robot, and tie a specific auton routine to each setting using a switch block. By changing the switch's state, we can choose between auton routines on the fly when we need to switch roles for a certain match.
__________________

2010-12 CT Chairman's
2011 Galileo 5th seed
2010 NY Regional Winners
  #11   Spotlight this post!  
Unread 08-01-2013, 19:23
PVCpirate's Avatar
PVCpirate PVCpirate is offline
FRC Data Nerd
AKA: Anthony Jennings
FRC #1058 (PVC Pirates)
Team Role: Alumni
 
Join Date: May 2010
Rookie Year: 2009
Location: Londonderry NH
Posts: 669
PVCpirate has much to be proud ofPVCpirate has much to be proud ofPVCpirate has much to be proud ofPVCpirate has much to be proud ofPVCpirate has much to be proud ofPVCpirate has much to be proud ofPVCpirate has much to be proud ofPVCpirate has much to be proud ofPVCpirate has much to be proud ofPVCpirate has much to be proud of
Re: Random autonomous

Quote:
Originally Posted by ekapalka View Post
This method sounds perfect. I was not aware that you were allowed to influence the robot in any way during disabled/autonomous mode. Thanks for the example! Thanks everyone else, as well I'm glad I'm not the only person who thinks something similar to this is a good idea.
I believe he meant before the match starts. The drivers can't touch the controls during autonomous.
__________________
My accomplishments with 1058:
2010 - Granite State Regoinal Winners, Galileo quarterfinalists, IRI quarterfinalists
2012 - GSR Chairman's Award winners
An incredible four years I will never forget
  #12   Spotlight this post!  
Unread 08-01-2013, 19:35
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: Random autonomous

Moreover, the joystick data sent to the robot during autonomous ignores never changes during auto. The values it uses are the last read during disable. To select an auto, you have many choices ...

Joystick values (like on the third axis),
FIRST Touch switches,
I/O tab switches without a I/O board,
Robot jumpers or switches,
Dashboard settings sent over SmartDashboard,
The cRIO DIP on the 8 slot,
and of course similar mechanisms with a pot compared to various ranges.

Greg McKaskle
  #13   Spotlight this post!  
Unread 09-01-2013, 15:25
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 591
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Random autonomous

There are some examples in Java and C++ of choosing a (not random) autonomous program from the SmartDashboard with Command based programs on this page:

http://wpilib.screenstepslive.com/s/...smartdashboard

The idea is that after caucusing with your alliance partners, you decide which of several strategies you might want to use and run the agreed one.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #14   Spotlight this post!  
Unread 09-01-2013, 15:54
flamer075 flamer075 is offline
Registered User
FRC #3200
 
Join Date: Jan 2013
Location: Colorado
Posts: 21
flamer075 is an unknown quantity at this point
Re: Random autonomous

This seems to be a cool idea, how would you do this if you were programming the robot in Java?
  #15   Spotlight this post!  
Unread 09-01-2013, 15:56
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Random autonomous

Normally, the Lunatecs select an autonomous mode by using the analog inputs on the dashboard. As soon as the robot is enabled, the code reads the analog input, and uses the appropriate autonomous mode.
__________________
2015 MAR District Champions




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:58.

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