View Single Post
  #8   Spotlight this post!  
Unread 01-05-2014, 16:01
Toa Circuit's Avatar
Toa Circuit Toa Circuit is offline
Thaddeus Maximus
AKA: Thad Hughes
FRC #4213 (MetalCow Robotics)
Team Role: Leadership
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Shirley, IL
Posts: 131
Toa Circuit is an unknown quantity at this point
Re: Share you Autonomous

Scripted autonomous is fairly... interesting.
4213 'used' it this year, but left it as the same script. We searched the cRIO root directory for the first '.auton' file, and then execute through that via state machines. Our basic structure is a bunch of <subsystem> <state> or <wait> <subsystem>. To wait for multiple subsystems, wait multiple times.

Script looks like this:
Code:
drivetrain 0.5 0 0 1 //0.5 Y, 0 X, 0 W, 1 second
catapult winched
sides deploy 3
wait drivetrain
wait catapult
wait sides
catapult fired
So this way, we know the 'bot is trying to achieve certain states. Understandable code that allows for 'parallelism' without actually using separate threads.

I'll see if I can find the source code. I think it got diked/subverted/buried.

We use state machines... a lot. I highly recommend you learn how to use and implement a state machine if you don't already. It makes coding so much easier.
__________________

2012 Head of Programming and Electrical
2013-14 Overall Team Captain and Programming Head
2012-14 Mentor of FLL Team Power Surge
2014 Dean's List Finalist
2014 CIR Xerox Creativity Award
Webpage