Quote:
Originally Posted by sparks-1784
Hope you can help.
|
I don't know if this would help you, but when our team was struggling with autonomous independent, the following thread was helpful to us:
http://www.chiefdelphi.com/forums/sh...ad.php?t=82564
especially the following two posts:
http://www.chiefdelphi.com/forums/sh...94&postcount=2
http://www.chiefdelphi.com/forums/sh...19&postcount=8
The above posts describe how to code autonomous independent as a state machine. We didn't wind up doing it that way though.
Eventually what we wound up doing is the following, based on various recommendations from knowledgeable folks here in the forum, and it has worked flawlessly:
- we moved our "kicker" and "mecanum drive" code to separate periodic tasks (kicker running at 50ms and mecanum drive running at 20ms), and communicate with them via global variables. The code in the "kicker" periodic task is implemented as a state machine which looks for limit switches to change states. A global boolean initiates the kicker, and the kicker changes the boolean back to "false" when it has cycled through all its states and is done. The drive task reads numerics which tell it what the joystick commands are.
- now the kicker and the drive code can each be "called" (or should I say "controlled", because they are not "called"... they are constantly running in parallel and receiving marching orders via the global variables) by both the TeleOP AND the Autonomous Indendent VIs.
- the autonomous independent VI is implemented as a flat sequence, with "watchdog delay and feed" used to introduce delays where desired.
~