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

Started working on autonomous

This commit is contained in:
Austen Adler 2015-02-06 13:45:01 -05:00
parent 3ee24abced
commit 28d266c8c2
5 changed files with 77 additions and 8 deletions

View File

@ -4,14 +4,6 @@
#include "Subsystems/Elevator.h" #include "Subsystems/Elevator.h"
#include "Subsystems/DIO.h" #include "Subsystems/DIO.h"
#include "Subsystems/AirCompressor.h" #include "Subsystems/AirCompressor.h"
//#include "Commands/Drive.h"
//#include "Commands/CloseCollector.h"
//#include "Commands/OpenCollector.h"
//#include "Commands/CollectTote.h"
//#include "Commands/ReleaseTote.h"
//#include "Commands/Raise.h"
//#include "Commands/Lower.h"
//#include "Commands/Calibrate.h"
Drivetrain* CommandBase::drivetrain = NULL; Drivetrain* CommandBase::drivetrain = NULL;
Collector* CommandBase::collector = NULL; Collector* CommandBase::collector = NULL;
Elevator* CommandBase::elevator = NULL; Elevator* CommandBase::elevator = NULL;

View File

@ -0,0 +1,21 @@
#include "AutoDrive.h"
#include <cmath>
#include "../../DentRobot.h"
AutoDrive::AutoDrive() : Command("AutoDrive"){
Requires(DentRobot::drivetrain);
SetTimeout(1.0);
}
void AutoDrive::Initialize(){
}
void AutoDrive::Execute(){
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle), gyro
DentRobot::drivetrain->DriveMecanum(0.5,0,0,0.9,0);
}
bool AutoDrive::IsFinished(){
return false;
}
void AutoDrive::End(){
}
void AutoDrive::Interrupted(){
End();
}

View File

@ -0,0 +1,18 @@
#ifndef AUTODRIVE_H
#define AUTODRIVE_H
#include "Commands/Command.h"
#include "../../CommandBase.h"
#include "../../DentRobot.h"
#include "WPILib.h"
class AutoDrive: public Command{
public:
AutoDrive();
void Initialize();
void Execute();
bool IsFinished();
void End();
void Interrupted();
};
#endif

View File

@ -0,0 +1,20 @@
#include "Autonomous.h"
#include "AutoDrive.h"
#include <cmath>
#include "Commands/CommandGroup.h"
#include "../../DentRobot.h"
Autonomous::Autonomous() : CommandGroup("Autonomous"){
AddSequential(new AutoDrive());
}
void Autonomous::Initialize(){
}
void Autonomous::Execute(){
}
bool Autonomous::IsFinished(){
return false;
}
void Autonomous::End(){
}
void Autonomous::Interrupted(){
End();
}

View File

@ -0,0 +1,18 @@
#ifndef AUTONOMOUS_H
#define AUTONOMOUS_H
#include "Commands/Command.h"
#include "../../CommandBase.h"
#include "../../DentRobot.h"
#include "WPILib.h"
class Autonomous: public CommandGroup{
public:
Autonomous();
void Initialize();
void Execute();
bool IsFinished();
void End();
void Interrupted();
};
#endif