2015-02-06 13:45:01 -05:00
|
|
|
#include "Autonomous.h"
|
|
|
|
#include "Commands/CommandGroup.h"
|
|
|
|
#include "../../DentRobot.h"
|
2015-02-07 12:50:36 -05:00
|
|
|
#include "../Elevator/Raise.h"
|
2015-02-08 16:51:35 -05:00
|
|
|
#include "../Elevator/Lower.h"
|
|
|
|
#include "AutoDrive.h"
|
|
|
|
#include "Turn.h"
|
2015-02-13 19:40:23 -05:00
|
|
|
#include "../Collector/RollIn.h"
|
2015-02-24 12:02:30 -05:00
|
|
|
#include "CollectTote.h"
|
2015-02-24 15:03:59 -05:00
|
|
|
#include "ReleaseTote.h"
|
2015-02-13 17:34:38 -05:00
|
|
|
Autonomous::Autonomous(int seq){
|
2015-02-13 22:30:15 -05:00
|
|
|
//SmartDashboard::GetNumber("Auto Wait Time");
|
2015-02-13 17:34:38 -05:00
|
|
|
switch(seq){
|
|
|
|
case 0:
|
|
|
|
// Just for testing
|
2015-02-13 22:30:15 -05:00
|
|
|
AddSequential(new CollectTote());
|
2015-02-21 08:43:19 -05:00
|
|
|
AddSequential(new Turn(90));
|
2015-02-13 17:34:38 -05:00
|
|
|
break;
|
|
|
|
case 1:
|
2015-02-24 12:02:30 -05:00
|
|
|
// Wait a desigated value, drive to Auto Zone (TM)
|
|
|
|
Wait(SmartDashboard::GetNumber("Auto Wait Time"));
|
|
|
|
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), -0.75));
|
2015-02-13 17:34:38 -05:00
|
|
|
break;
|
|
|
|
case 2:
|
2015-02-24 15:03:59 -05:00
|
|
|
// Get one tote and go to Auto Zone (TM)
|
2015-02-24 12:02:30 -05:00
|
|
|
AddSequential(new CollectTote());
|
|
|
|
AddSequential(new Turn(90));
|
2015-02-24 15:03:59 -05:00
|
|
|
AddSequential(new ReleaseTote());
|
2015-02-13 17:34:38 -05:00
|
|
|
break;
|
|
|
|
case 3:
|
2015-02-24 12:02:30 -05:00
|
|
|
// Collect three totes, drive to Auto Zone (TM)
|
|
|
|
printf("Waiting: %f\n",SmartDashboard::GetNumber("Auto Wait Time"));
|
|
|
|
Wait(SmartDashboard::GetNumber("Auto Wait Time"));
|
|
|
|
printf("Done");
|
|
|
|
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Tote Distance"), -0.75));
|
|
|
|
AddSequential(new CollectTote());
|
|
|
|
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Tote Distance"), -0.75));
|
|
|
|
AddSequential(new CollectTote());
|
|
|
|
printf("Three totes?: %d\n",SmartDashboard::GetBoolean("Three totes"));
|
|
|
|
if(SmartDashboard::GetBoolean("Three totes")){
|
|
|
|
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Tote Distance"), -0.75));
|
|
|
|
AddSequential(new CollectTote());
|
|
|
|
}
|
|
|
|
AddSequential(new Turn(90));
|
|
|
|
AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), -0.75));
|
2015-02-24 15:03:59 -05:00
|
|
|
AddSequential(new ReleaseTote());
|
2015-02-13 17:34:38 -05:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("Invalid seq: %d\n", seq);
|
|
|
|
break;
|
|
|
|
}
|
2015-02-06 13:45:01 -05:00
|
|
|
}
|
2015-02-08 12:26:15 -05:00
|
|
|
// vim: ts=2:sw=2:et
|