Quote:
Originally Posted by Dave Scheck
...On the autonomous side, we simply make these same types of calls and reuse the entire drive base objects. In addition, all of our programs run in a common engine that takes simple commands like driveByTime or driveByEncoder. This makes writing programs as simple as defining the steps and calling an addCommand function. Our individual autonomous programs last year didn't have a single line of logic in them. They simply assigned values to the step parameters and called addStep. Since they all derive from the same base class, they all have a run in the base that handles stepping through the commands...
|
We did something fairly similar, except instead of adding commands to a list, we simply called the commands directly. We wrote our code in LabVIEW, and it runs in a virtual thread, so we can do things like this c++-equivalent code:
Code:
void auton_f1(void)
{
set_ball-o-fier(RUN);
drive_Straight(36,0.6); //Drive forward 36 inches max speed 0.6
drive_to_ball(0.3); //Creep to broken-beam sensor
kick(); //Kicker manipulates ball-o-fier as necessary, leaving it in its original state
drive_Straight(24,0.4); //Drive to almost next ball
drive_to_ball(0.3);
kick();
.....
We initially wanted to write the Auton code in Python, but decided that the Python-Labview interface would be too challenging to write compared to its advantages, so now we just put a bunch of VI's together and execute them sequentially.