2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00
dent/Commands/Autonomous/Autonomous.cpp

52 lines
1.5 KiB
C++

#include "Autonomous.h"
#include "../../DentRobot.h"
#include "../Elevator/Raise.h"
#include "../Elevator/Lower.h"
#include "AutoDrive.h"
#include "Turn.h"
#include "../Collector/CloseCollector.h"
#include "../Collector/OpenCollector.h"
#include "../Collector/CollectTote.h"
Autonomous::Autonomous(int seq){
SmartDashboard::GetNumber("Auto Wait Time");
switch(seq){
case 0:
// Just for testing
AddSequential(new Raise());
AddSequential(new Lower());
AddSequential(new OpenCollector());
AddSequential(new CloseCollector());
AddSequential(new Turn());
AddParallel(new AutoDrive(0.5));
AddParallel(new CloseCollector());
AddSequential(new CollectTote());
AddSequential(new Turn());
break;
case 1:
// Drive forward a bit, turn around, collect tote then bin
AddParallel(new Raise());
AddSequential(new AutoDrive(0.5));
AddSequential(new Turn());
AddSequential(new Turn());
AddSequential(new CollectTote());
break;
case 2:
// Drive forward a bit, turn around, collect tote then bin
AddParallel(new Raise());
AddParallel(new AutoDrive(0.5));
AddSequential(new Turn());
AddSequential(new Turn());
AddSequential(new CollectTote());
break;
case 3:
// Wait a desigated value, drive to Auto Zone (TM)
Wait(SmartDashboard::GetNumber("Auto Wait Time"));
AddSequential(new AutoDrive(2.0));
break;
default:
printf("Invalid seq: %d\n", seq);
break;
}
}
// vim: ts=2:sw=2:et