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

Removed compressor

This commit is contained in:
Austen Adler 2015-02-07 13:17:22 -05:00
parent aed1db3981
commit 1f6f1cf239
14 changed files with 1 additions and 122 deletions

View File

@ -2,11 +2,9 @@
#include "Subsystems/Drivetrain.h" #include "Subsystems/Drivetrain.h"
#include "Subsystems/Collector.h" #include "Subsystems/Collector.h"
#include "Subsystems/Elevator.h" #include "Subsystems/Elevator.h"
#include "Subsystems/AirCompressor.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;
AirCompressor* CommandBase::airCompressor = NULL;
OI* CommandBase::oi = NULL; OI* CommandBase::oi = NULL;
CommandBase::CommandBase(char const *name) : Command(name) { CommandBase::CommandBase(char const *name) : Command(name) {
} }
@ -16,6 +14,5 @@ void CommandBase::init(){
drivetrain = new Drivetrain(); drivetrain = new Drivetrain();
collector = new Collector(); collector = new Collector();
elevator = new Elevator(); elevator = new Elevator();
airCompressor = new AirCompressor();
oi = new OI(); oi = new OI();
} }

View File

@ -5,7 +5,6 @@
#include "Subsystems/Drivetrain.h" #include "Subsystems/Drivetrain.h"
#include "Subsystems/Collector.h" #include "Subsystems/Collector.h"
#include "Subsystems/Elevator.h" #include "Subsystems/Elevator.h"
#include "Subsystems/AirCompressor.h"
#include "OI.h" #include "OI.h"
#include "WPILib.h" #include "WPILib.h"
@ -17,7 +16,6 @@ class CommandBase: public Command {
static Drivetrain *drivetrain; static Drivetrain *drivetrain;
static Collector *collector; static Collector *collector;
static Elevator *elevator; static Elevator *elevator;
static AirCompressor *airCompressor;
static OI *oi; static OI *oi;
}; };
#endif #endif

View File

@ -4,4 +4,5 @@
#include "../Elevator/Raise.h" #include "../Elevator/Raise.h"
Autonomous::Autonomous(){ Autonomous::Autonomous(){
AddSequential(new AutoDrive()); AddSequential(new AutoDrive());
AddSequential(new Raise());
} }

View File

@ -1,18 +0,0 @@
#include "StartCompressing.h"
#include "../../DentRobot.h"
StartCompressing::StartCompressing() : Command("StartCompressing"){
Requires(DentRobot::airCompressor);
}
void StartCompressing::Initialize(){
}
void StartCompressing::Execute(){
DentRobot::airCompressor->StartCompressing();
}
bool StartCompressing::IsFinished(){
return false;
}
void StartCompressing::End(){
}
void StartCompressing::Interrupted(){
End();
}

View File

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

View File

@ -1,18 +0,0 @@
#include "StopCompressing.h"
#include "../../DentRobot.h"
StopCompressing::StopCompressing() : Command("StopCompressing"){
Requires(DentRobot::airCompressor);
}
void StopCompressing::Initialize(){
}
void StopCompressing::Execute(){
DentRobot::airCompressor->StopCompressing();
}
bool StopCompressing::IsFinished(){
return false;
}
void StopCompressing::End(){
}
void StopCompressing::Interrupted(){
End();
}

View File

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

View File

@ -4,14 +4,12 @@ OI* DentRobot::oi=NULL;
Collector* DentRobot::collector=NULL; Collector* DentRobot::collector=NULL;
Drivetrain* DentRobot::drivetrain=NULL; Drivetrain* DentRobot::drivetrain=NULL;
Elevator* DentRobot::elevator=NULL; Elevator* DentRobot::elevator=NULL;
AirCompressor* DentRobot::airCompressor=NULL;
CommandGroup* DentRobot::aut=NULL; CommandGroup* DentRobot::aut=NULL;
DentRobot::DentRobot(){ DentRobot::DentRobot(){
oi=new OI(); oi=new OI();
collector=new Collector(); collector=new Collector();
drivetrain=new Drivetrain(); drivetrain=new Drivetrain();
elevator=new Elevator(); elevator=new Elevator();
airCompressor=new AirCompressor();
aut=new Autonomous(); aut=new Autonomous();
printf("Initialized"); printf("Initialized");
} }

View File

@ -5,7 +5,6 @@
#include "Subsystems/Elevator.h" #include "Subsystems/Elevator.h"
#include "Subsystems/Drivetrain.h" #include "Subsystems/Drivetrain.h"
#include "Subsystems/Collector.h" #include "Subsystems/Collector.h"
#include "Subsystems/AirCompressor.h"
#include "Commands/Autonomous/Autonomous.h" #include "Commands/Autonomous/Autonomous.h"
class DentRobot: public IterativeRobot { class DentRobot: public IterativeRobot {
private: private:
@ -16,7 +15,6 @@ class DentRobot: public IterativeRobot {
static Collector* collector; static Collector* collector;
static Drivetrain* drivetrain; static Drivetrain* drivetrain;
static Elevator* elevator; static Elevator* elevator;
static AirCompressor* airCompressor;
static CommandGroup* aut; static CommandGroup* aut;
void RobotInit(); void RobotInit();
void DisabledPeriodic(); void DisabledPeriodic();

1
OI.cpp
View File

@ -5,7 +5,6 @@
#include "Commands/Collector/CloseCollector.h" #include "Commands/Collector/CloseCollector.h"
#include "Commands/Collector/CollectTote.h" #include "Commands/Collector/CollectTote.h"
#include "Commands/Collector/ReleaseTote.h" #include "Commands/Collector/ReleaseTote.h"
#include "Commands/Compressor/StartCompressing.h"
OI::OI() { OI::OI() {
leftStick=new Joystick(0); leftStick=new Joystick(0);

View File

@ -24,7 +24,4 @@
#define COLLECTOR_LEFT_CAN 8 #define COLLECTOR_LEFT_CAN 8
#define COLLECTOR_RIGHT_CAN 9 #define COLLECTOR_RIGHT_CAN 9
// Compressor
#define COMPRESSOR_CAN 10
#endif #endif

View File

@ -1,20 +0,0 @@
#include "AirCompressor.h"
#include "../RobotMap.h"
AirCompressor::AirCompressor() : Subsystem("AirCompressor") {
compressor = new Compressor(COMPRESSOR_CAN);
}
void AirCompressor::InitDefaultCommand() {
}
void AirCompressor::StartCompressing() {
if(compressor->Enabled()){
printf("Starting compressor\n");
compressor->Start();
}
}
void AirCompressor::StopCompressing() {
if(compressor->Enabled()){
printf("Stopping compressor\n");
compressor->Stop();
}
}

View File

@ -1,15 +0,0 @@
#ifndef AIRCOMPRESSOR_H
#define AIRCOMPRESSOR_H
#include "WPILib.h"
class AirCompressor: public Subsystem
{
private:
Compressor *compressor;
public:
AirCompressor();
void InitDefaultCommand();
void StartCompressing();
void StopCompressing();
};
#endif

View File

@ -1,2 +0,0 @@
Compressor isn't in use
(dos compressor on compressor start or stop)?