Go to Post Pulling off an off season during a hurricane isn't easy. - Arefin Bari [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 10-01-2015, 18:14
Quantum Byte's Avatar
Quantum Byte Quantum Byte is offline
Lead Programmer
AKA: Domenic
FRC #4776 (S.C.O.T.S. Bots)
Team Role: Programmer
 
Join Date: May 2012
Rookie Year: 2011
Location: Hartland, Michigan
Posts: 16
Quantum Byte is an unknown quantity at this point
Multiple Autonomous Programs

Hello all,
I am currently trying to think of a way for my drivers to pick what autonomous code to use before a match, preferably queuing. I was wondering what would be a good way to do this. I was thinking that while the robot is disabled, I display what autonomous to pick in the SmartDashboard. What do you guys think?
  #2   Spotlight this post!  
Unread 10-01-2015, 19:25
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,058
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: Multiple Autonomous Programs

Yup, the SendableChooser object in C++/Java/Python works great for this sort of thing.
__________________
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
  #3   Spotlight this post!  
Unread 10-01-2015, 20:23
Quantum Byte's Avatar
Quantum Byte Quantum Byte is offline
Lead Programmer
AKA: Domenic
FRC #4776 (S.C.O.T.S. Bots)
Team Role: Programmer
 
Join Date: May 2012
Rookie Year: 2011
Location: Hartland, Michigan
Posts: 16
Quantum Byte is an unknown quantity at this point
Re: Multiple Autonomous Programs

Quote:
Originally Posted by virtuald View Post
Yup, the SendableChooser object in C++/Java/Python works great for this sort of thing.
Thanks man, works great!
  #4   Spotlight this post!  
Unread 11-01-2015, 09:32
wendells's Avatar
wendells wendells is offline
Registered User
FRC #2185 (RAMAZOIDZ)
Team Role: Teacher
 
Join Date: Feb 2009
Rookie Year: 2007
Location: toronto
Posts: 54
wendells is a name known to allwendells is a name known to allwendells is a name known to allwendells is a name known to allwendells is a name known to allwendells is a name known to all
Re: Multiple Autonomous Programs

One of the most important factor in this game is the PROGRAMMER. According to the Alliance the programmer must be able to redo their autonomous game to suit the alliance.
What do you think?
  #5   Spotlight this post!  
Unread 11-01-2015, 09:44
cjl2625's Avatar
cjl2625 cjl2625 is offline
apel py
AKA: Cory Lynch
FRC #2067 (Apple Pi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Guilford, CT
Posts: 412
cjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to behold
Re: Multiple Autonomous Programs

Quote:
Originally Posted by wendells View Post
One of the most important factor in this game is the PROGRAMMER. According to the Alliance the programmer must be able to redo their autonomous game to suit the alliance.
What do you think?
Yeah, I like the variety that the autonomous code must accommodate.
For that reason, I'd like to utilize my experimental auto scripting language, as I think it will be important to quickly modify auto modes during an event.
I was even considering some kind of graphical interface to quickly build and modify auto modes. Like maybe have a diagram of the field, and simply plot points that the robot should go to, and add actions at each point. It's certainly something I'll experiment with.
__________________
Head Programmer / Driver
  #6   Spotlight this post!  
Unread 11-01-2015, 10:13
one_each one_each is offline
Registered User
FRC #4057 (KB Bots)
Team Role: Mentor
 
Join Date: Jun 2012
Rookie Year: 2012
Location: Klamath Falls, Or
Posts: 25
one_each is an unknown quantity at this point
Re: Multiple Autonomous Programs

We will be using some kind of scripting this year, most likely Lua, for auton. The drive team will need some kind of UI to select what to do, but it needs to be quick and easy for them. The programmers will have more time to write and debug complex interactions then the drive team will have just before a match. It is my hope that the programming team will get it down to just a handful (<=5) of SendableChooser objects.
  #7   Spotlight this post!  
Unread 11-01-2015, 17:33
Randaline's Avatar
Randaline Randaline is offline
Registered User
AKA: Abby
FRC #0716 (The Who'sCTEKS)
Team Role: Programmer
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Connecticut
Posts: 12
Randaline is an unknown quantity at this point
Re: Multiple Autonomous Programs

In past years, our team has put 2 mechanical switches on the robot, and for every configuration of the switch (ON ON, ON OFF, OFF ON, OFF OFF), you could have a different autonomous code. All you had to do was put the code in an if statement and write a notecard out to the drivers explaining what flipping the switches would do for the autonomous. You could have as many as you wanted, but 4 seemed to be the magic number for us. This method worked the best when we didn't have any programmers, but a team full of mechanical kinds of people.

However, we've been experimenting in recent years with the SmartDashboard, and if you want a more updated method, picking straight from there is the way to go.
  #8   Spotlight this post!  
Unread 11-01-2015, 22:10
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
Re: Multiple Autonomous Programs

Just today our team put together a way of selecting autonomous programs through the SmartDashboard. We're not using a command-based framework, so we made it work using pointers to functions. You just make a function for each possible autonomous mode, use a SendableChooser to pick a function, and have the actual AutonPeriodic function just run the chosen function. Anyone who's curious can check it out on github here.

Function pointers are unholy magic though, so stick to Commands if you're not lazy and old-fashioned like us.
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)
  #9   Spotlight this post!  
Unread 11-01-2015, 22:24
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Multiple Autonomous Programs

So much work!

We just used A and Y to swap between modes.

https://github.com/1684Chimeras/2014...utonomous.java
  #10   Spotlight this post!  
Unread 11-01-2015, 22:45
dellagd's Avatar
dellagd dellagd is offline
Look for me on the field!
AKA: Griffin D
FRC #2590 (Nemesis) #2607 (The Fighting Robovikings)
Team Role: Mentor
 
Join Date: Sep 2011
Rookie Year: 2011
Location: PA
Posts: 890
dellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond repute
Re: Multiple Autonomous Programs

Quote:
Originally Posted by Arhowk View Post
So much work!

We just used A and Y to swap between modes.

https://github.com/1684Chimeras/2014...utonomous.java
Yep. Just put some selection code in the disabledPeriodic() looping method and have some cycle button on your joystick be used to cycle through the Auton modes. It would probably be a good idea to have some text display the currently selected mode on the dashboard too. I never understood why people made more work by actually mounting switches on their robot, this is so easy to implement.
__________________
Check out some cool personal projects in computers, electronics, and RC vehicles on my blog!

2016 MAR DCMP Engineering Excellence Award
2016 MAR Westtown Innovation in Control Award
2016 MAR Hatboro-Horsham Industrial Design Award
2015 Upper Darby District Winners - Thanks 225 and 4460!
2015 Upper Darby District Industrial Design Award
2015 Hatboro-Horsham District Winners - Thanks 2590 and 5407!
2014 Virginia Regional Winners - Thanks so much 384 and 1610, I will never forget that experience!
2014 Virginia Quality Award
2014 MAR Bridgewater-Raritan Innovation in Control Award
2014 MAR Hatboro-Horsham Gracious Professionalism Award
2013 MAR Bridgewater-Raritan Innovation in Control Award
2012 MAR Lenape Quality Award

Last edited by dellagd : 11-01-2015 at 22:58.
  #11   Spotlight this post!  
Unread 11-01-2015, 22:50
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
Re: Multiple Autonomous Programs

Quote:
Originally Posted by Arhowk View Post
So much work!

We just used A and Y to swap between modes.
I like using the SmartDashboard, rather than joystick controls, because there's no button mapping to keep track of. We can add as many auton programs as we want and add each to the chooser with a single line of code. Anyone using the driver station can see the list of the choices, with names/descriptions, and click one to choose it, without having to know the button scheme (or even have a controller). Also, compared to your code I have to say it seems a little simpler; we don't even need an array to keep track of all of our auton programs. (Although of course I have not ruled out the possibility that your code is simply more fancy than ours.)
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)

Last edited by alopex_rex : 11-01-2015 at 22:54. Reason: if a post is edited on a forum, and no one saw it beforehand, was it really edited?
  #12   Spotlight this post!  
Unread 13-01-2015, 12:34
jtrv's Avatar
jtrv jtrv is offline
github.com/jhtervay
AKA: Justin
FRC #2791 (Shaker Robotics)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Latham, NY
Posts: 147
jtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to all
Re: Multiple Autonomous Programs

Quote:
Originally Posted by one_each View Post
We will be using some kind of scripting this year, most likely Lua, for auton. The drive team will need some kind of UI to select what to do, but it needs to be quick and easy for them. The programmers will have more time to write and debug complex interactions then the drive team will have just before a match. It is my hope that the programming team will get it down to just a handful (<=5) of SendableChooser objects.
scripting via LUA?

jeez, have fun friend. LUA is a major pain, speaking from personal experience.
__________________
2791 (2012-2017)

Last edited by jtrv : 13-01-2015 at 14:25.
  #13   Spotlight this post!  
Unread 13-01-2015, 14:12
MrTechCenter's Avatar
MrTechCenter MrTechCenter is offline
INTENSITY
AKA: Harsharan "Harsh" Dhaliwal
FRC #2073 (Eagleforce)
Team Role: Mentor
 
Join Date: Sep 2011
Rookie Year: 2010
Location: Sacramento, CA
Posts: 559
MrTechCenter has a brilliant futureMrTechCenter has a brilliant futureMrTechCenter has a brilliant futureMrTechCenter has a brilliant futureMrTechCenter has a brilliant futureMrTechCenter has a brilliant futureMrTechCenter has a brilliant futureMrTechCenter has a brilliant futureMrTechCenter has a brilliant futureMrTechCenter has a brilliant futureMrTechCenter has a brilliant future
Re: Multiple Autonomous Programs

We used the driver station digital inputs to select our autonomous mode last year. We originally had a physical 3-stage switch on our driver station which was wired into the Cypress which was connected to our driver station laptop, however, our Cypress stopped working so we literally just clicked an individual digital Input on the driver station, under "D I/O" and referenced each digital input in our autonomous code, so different digital inputs would correspond to a different auton mode. I mean....it worked...
__________________
2011 Sacramento Regional Finalists; 2011 MadTown Throwdown VIP Excellence in Engineering Award; 2012 Sacramento Regional Innovation in Control Award; 2012 Silicon Valley Regional Judges' Award; 2012 CalGames Autonomous Challenge Award; 2012 MadTown Throwdown Finalists; 2013 P0W3RH0U53 PWNAGE Gracios Professionalism Award; 2014 Central Valley Regional Innovation in Control; 2014 Sacramento Regional Innovation in Control; 2014 Curie Division Gracious Professionalism Award; 2015 Sacramento Regional Innovation in Control
  #14   Spotlight this post!  
Unread 13-01-2015, 14:23
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,356
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Multiple Autonomous Programs

Sparkfun has a great 10 position switch and a breakout board for it that would make it quite simple to add up to 10 different Auto modes to you drive's station.

You can use the TI LaunchPad from the KOP as another HID device and connect all 10 inputs to it if you needed that many.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #15   Spotlight this post!  
Unread 31-01-2015, 12:31
Quantum Byte's Avatar
Quantum Byte Quantum Byte is offline
Lead Programmer
AKA: Domenic
FRC #4776 (S.C.O.T.S. Bots)
Team Role: Programmer
 
Join Date: May 2012
Rookie Year: 2011
Location: Hartland, Michigan
Posts: 16
Quantum Byte is an unknown quantity at this point
Re: Multiple Autonomous Programs

Sorry to revive this thread after a couple weeks, haven't checked this thread in while

Anyway, i have made a system in java where it loads a autonomous mode inheriting a base class, makes it pretty simple to create. It also loads depending on the robot, since our team uses multiple robots

https://github.com/SCOTS-Bots/FRC-20...peration/auton
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 02:43.

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