Go to Post I wouldn't want to face THAT bad boy in competition... - Iain McLeod [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
  #16   Spotlight this post!  
Unread 05-04-2010, 22:53
ideasrule's Avatar
ideasrule ideasrule is offline
Registered User
FRC #0610 (Coyotes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Toronto
Posts: 108
ideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the rough
Re: Modular Autonomous?

Quote:
Originally Posted by LukeS View Post
But, code doesn't need to be object-oriented to be modular, powerful, elegant, and avoid copy/pasting. Yes, modularity is one of OO's strengths. I feel that they are teaching the benefits of OO, playing it as a superior paradigm. Yes, it has strengths, but so do others. And I've written more C code that is more modular than the better part of the Object-Oriented C++ and Java code I have seen.
I agree with this. I just find it's easier to write modular code with object-oriented programming, but that's just a matter of preference.
  #17   Spotlight this post!  
Unread 05-04-2010, 23:09
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: Modular Autonomous?

I made my code too modular, i think i broke 30 classes of java code
  #18   Spotlight this post!  
Unread 05-04-2010, 23:21
Nick_K's Avatar
Nick_K Nick_K is offline
Elec., CAD, Prog., and Field Coach
AKA: Nick
FRC #1305 (Near North Student Robotics Initiative)
Team Role: Student
 
Join Date: Apr 2008
Rookie Year: 2006
Location: North Bay, ON, Canada
Posts: 1
Nick_K is an unknown quantity at this point
Re: Modular Autonomous?

I made a rather simple autonomous that works for all 3 zones, using one of the old banner sensors as a ball detector.

Autonomous is a simple loop of :
  • Drive Forward
  • Check if the banner sensor has tripped
  • Check if the kicker has reloaded
  • Fire the ball if it is, and reload if it's not
  • Rinse, repeat

However, it times out after about 2 seconds to prevent hitting the bump or the wall in case there's no more balls in the zone.
__________________
  #19   Spotlight this post!  
Unread 06-04-2010, 10:23
CoachPoore CoachPoore is offline
Registered User
AKA: Noel Poore
FRC #1519 (Mechanical Mayhem)
Team Role: Coach
 
Join Date: Jun 2008
Rookie Year: 2006
Location: Mont Vernon, NH
Posts: 30
CoachPoore has a spectacular aura aboutCoachPoore has a spectacular aura about
Send a message via AIM to CoachPoore
Re: Modular Autonomous?

Quote:
Originally Posted by Ken Streeter View Post
Since 2006, Team 1519 has broken our autonomous programs down into a series of more general specific operations, exactly like the ones you describe. This actions are the "instructions" that we want an autonomous program to perform. Our autonomous programs are then collections of these "instructions" in a specific sequence. Once each of the individual instructions is written and debugged, these can be quickly composed into a multitude of variations of autonomous programs.
Another benefit we (team 1519) get from our autonomous mode virtual machine is that adding a new autonomous mode or changing an existing one does not really involve changing code, so we can do it with much less risk of breaking something important. This made it very easy to take our existing 3 ball autonomous and turn it into a 5 ball autonomous program at GSR, our local week 1 regional.

I'd be interested to hear how other teams select which autonomous mode to use. We select the program number using joystick buttons on the OI, displaying the current program number using the DriverStationLCD. We have +/- 1 and +/- 10 buttons. Also, we allow the operator to select a delay before the program starts running. This has been useful when we've been playing with an alliance partner who would otherwise block our shots at the start of autonomous.

Noel
__________________
2011 Granite State Regional Winners with teams 175 and 176
2010 Granite State Regional Winners with teams 1073 and 1058
2010 Granite State Regional Innovation In Controls Award Winners
2010 North Carolina Regional Engineering Excellence Award Winners
2010 North Carolina Regional Finalists with teams 1772 and 1741
  #20   Spotlight this post!  
Unread 06-04-2010, 10:30
CoachPoore CoachPoore is offline
Registered User
AKA: Noel Poore
FRC #1519 (Mechanical Mayhem)
Team Role: Coach
 
Join Date: Jun 2008
Rookie Year: 2006
Location: Mont Vernon, NH
Posts: 30
CoachPoore has a spectacular aura aboutCoachPoore has a spectacular aura about
Send a message via AIM to CoachPoore
Re: Modular Autonomous?

Quote:
Originally Posted by Robototes2412 View Post
I made my code too modular, i think i broke 30 classes of java code
That doesn't necessarily sound "too modular" to me. Team 1519's C++ code this year has 27 classes which between them cover autonomous, teleop and self test.

Noel
__________________
2011 Granite State Regional Winners with teams 175 and 176
2010 Granite State Regional Winners with teams 1073 and 1058
2010 Granite State Regional Innovation In Controls Award Winners
2010 North Carolina Regional Engineering Excellence Award Winners
2010 North Carolina Regional Finalists with teams 1772 and 1741
  #21   Spotlight this post!  
Unread 06-04-2010, 11:06
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: Modular Autonomous?

The beauty of modular autonomous is that if the architecture is set up right, any team should be able to use the state machine of maneuver implemented by another team, and all they should have to do is code the mechanisms to execute those basic maneuvers.

This is actually at the heart of the ADK project which I have started. This project is an open source collaborative project to attempt to bring an autonomous framework to first which all teams can implement.
http://firstforge.wpi.edu/sf/projects/bobotics

As you said so many teams this year implemented a drive forward - kick for n number of times. Think about how much time was spent programming the same things on different teams. Rather than all of us doing the same thing, I would like to see FIRST teams work as a company, code something once, not have 100 teams code the same thing, by doing this we will much better use our time as programmers and make debugging for all of us easier, and bring autonomous to a lot more, if not all, FIRST teams.

anyone interested in working on this project please join it on first forge.
We have had several teams sign up, and more express interest. Lets raise the bar of the entire FIRST autonomous program , not just the leaders by the rookies also.
__________________
"Never let your schooling interfere with your education" -Mark Twain
  #22   Spotlight this post!  
Unread 06-04-2010, 12:43
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Modular Autonomous?

Quote:
Originally Posted by Jared341 View Post
We do something very similar to the above (but in Java).

We defined a custom "scripting format" that lets you describe high level robot behaviors in a plain text format. The "autonomous mode text file" can be created on a laptop (either with Notepad or, hopefully next year, in a full-featured GUI) and FTP'd down to the cRIO. Upon autonomous mode starting, our system searches the file system for the autonomous.txt file and executes the commands sequentially.

The actual bit of code that executes each command (or Action, as we call them) is highly object oriented. An "AutonomousThread" instance receives an array of Action objects. Actions each have "execute()" and "cancel()" methods that are implemented to provide the desired robot behavior. Because of the beauty of polymorphism, you just need to loop through each Action and call "execute()" for each step of the recipe.

If you have the time (and interest), a system like this is fun to create and can lead to more maintainable code. Of course, it takes a lot of boilerplate to get it up and running, and you need to be absolutely sure it is bug free or you will be doing yourself no favors.
Well, excellent, I guess I don't have to mention that idea then.
I made a simple parser where you list out the commands and values for the commands in an cluster (aka struct).The datatype is
array[cluster[enum "action" (forward, strafe, turn, kick), dbl "value"]]

These are the actions (and order) that it executes.

This could be very easily expanded to read that array from a text file.
One modification that SHOULD be made is to send the action and action# back to the driver station.
As for chosing the section of the field, there is a function that tells you that in the WPI libraries (under Driver Station. I think it's called "get alliance", but it also get you your position, which is either set by FMS or your driver station).


However, I have a question:
Is anyone else here working in LabVIEW, or am I on my own for now?
__________________
-- Marshal Horn
  #23   Spotlight this post!  
Unread 06-04-2010, 12:51
kenavt's Avatar
kenavt kenavt is offline
Registered User
AKA: Colin S
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Ann Arbor
Posts: 253
kenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond repute
Re: Modular Autonomous?

I am not an official programmer on my team, but I plan to be one next year. We use LabView, so you're not on your own, I think.
__________________
University of Michigan Computer Engineering '17

FRC 2337 student alumni (2010-2013)
  #24   Spotlight this post!  
Unread 06-04-2010, 14:20
billbo911's Avatar
billbo911 billbo911 is online now
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,387
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: Modular Autonomous?

We used an approach that just might fit your "modular" model.

We developed four autonomous routines, each was it's own vi and existed in it's own case in a case structure which were selectable by a single potentiometer on the robot. Two possibilities for the Home zone (Zone 1), and one for each of the other zones. Each routine was unique to their approach in playing the game, and each used different sensors to perform the routines.

Each routine used a "State Machine" structure to perform it's tasks, this is where the modularity really begins to shine. If extra steps are needed, an additional "State" gets added, ie. backing up from your example. If one portion of any routine needed to be modified, you just modified it in that one state in that particular vi.

We never had a single failure of the code to perform exactly as it was written. The only issues we had were do to the positioning of the balls and the routines of our alliance partners.
__________________
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
  #25   Spotlight this post!  
Unread 06-04-2010, 15:49
GGCO's Avatar
GGCO GGCO is offline
Registered User
AKA: Grant
FRC #3357
Team Role: Alumni
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Michigan
Posts: 406
GGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to behold
Send a message via AIM to GGCO
Re: Modular Autonomous?

For the most part, all of our code is modularly designed.

Our team reads in values from the virtual digital outputs on the Classmate UI. We then assign those values to variables used by a switch statement in our AutonInit() mode to determine what zone our robot is in. For example if DO 1 == true, then we call a series of drive/kick functions.
__________________
"Great spirits have always encountered violent opposition from mediocre minds" - Albert Einstein
The FIRST Alliance
COMETS Robotics
Website

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
pic: Modular Ramp TheOtherGuy Extra Discussion 2 19-02-2007 11:52
pic: Installing a modular transmission Wayne C. Extra Discussion 12 16-09-2006 23:10
Modular Robot Jeff Rodriguez Chit-Chat 0 12-04-2005 14:08
Modular Bots?? BBFIRSTCHICK General Forum 21 11-01-2003 04:45
Modular Designs archiver 2001 6 24-06-2002 00:43


All times are GMT -5. The time now is 20:10.

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