![]() |
Simple Autonomous Mode Example
Although you cannot just drop this in without any modifications (it wouldn't really do anything of use in its current form), this code does provide a good foundation for a simple blind-reckoning (no sensor input) autonomous mode. It is expandable to have as many steps as wanted, and simple to use for timing. It doesn't use interrupts for timing, if you want to do that instead, you'll have to implement it yourself. This code is only for teams that need to get off the ground because they don't quite understand autonomous, and want a working example they can play with. Essentially, this is just a simple state machine and timer combo.
Code:
//define as many states as you want here |
Re: Simple Autonomous Mode Example
You know, I'm doing basically the same thing using simpler code. Plus, You can write REALLY LONG scripts without REALLY lengthening the code. I'll Release my source about a week or 2 after regionals.
Hint: Arrays |
Re: Simple Autonomous Mode Example
Quote:
|
Re: Simple Autonomous Mode Example
A NOTE TO ANYONE USING THE ABOVE CODE:
I made a slight error in the definitions of the SECS_TO_TICKS and MSECS_TO_TICKS macros. You'll need to change them to the following: Code:
#define SECS_TO_TICKS(a) ( ((long)(a)) * 10000 / 262 ) |
Re: Simple Autonomous Mode Example
I'm sure rookie teams without much programming experience will find that helpful. :)
|
Re: Simple Autonomous Mode Example
another simple auton example is our code... basicly it goes strait. then it turns about 75degrees. then it goes foward, opens its arms, and swings and knocks off the ball. it is based on a wheel counter inturpt... so you can make it go as fast or as slow as you want.
Code:
/******************************************************** |
| All times are GMT -5. The time now is 14:10. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi