From c8acfae930c4642fe83e820e954f386e135c3de3 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sat, 14 Feb 2015 15:24:42 -0500 Subject: [PATCH] Removed window motors (untested) --- Commands/Autonomous/Autonomous.cpp | 5 ----- Commands/Collector/CloseCollector.cpp | 27 --------------------------- Commands/Collector/CloseCollector.h | 20 -------------------- Commands/Collector/CollectTote.cpp | 4 ---- Commands/Collector/OpenCollector.cpp | 22 ---------------------- Commands/Collector/OpenCollector.h | 20 -------------------- Commands/Collector/ReleaseTote.cpp | 2 -- OI.cpp | 6 ------ Subsystems/Collector.cpp | 6 ------ Subsystems/Collector.h | 3 +-- TODO.txt | 0 11 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 Commands/Collector/CloseCollector.cpp delete mode 100644 Commands/Collector/CloseCollector.h delete mode 100644 Commands/Collector/OpenCollector.cpp delete mode 100644 Commands/Collector/OpenCollector.h delete mode 100644 TODO.txt diff --git a/Commands/Autonomous/Autonomous.cpp b/Commands/Autonomous/Autonomous.cpp index 1ee23c4..e13fac2 100644 --- a/Commands/Autonomous/Autonomous.cpp +++ b/Commands/Autonomous/Autonomous.cpp @@ -4,8 +4,6 @@ #include "../Elevator/Lower.h" #include "AutoDrive.h" #include "Turn.h" -#include "../Collector/CloseCollector.h" -#include "../Collector/OpenCollector.h" #include "../Collector/RollIn.h" #include "../Collector/CollectTote.h" Autonomous::Autonomous(int seq){ @@ -16,11 +14,8 @@ Autonomous::Autonomous(int seq){ AddSequential(new CollectTote()); //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 RollIn()); //AddSequential(new Turn()); break; diff --git a/Commands/Collector/CloseCollector.cpp b/Commands/Collector/CloseCollector.cpp deleted file mode 100644 index 31e2431..0000000 --- a/Commands/Collector/CloseCollector.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "CloseCollector.h" -CloseCollector::CloseCollector() : Command("CloseCollector"){ -} -void CloseCollector::Initialize(){ - printf("Initialized collector: 0.5\n"); - SetTimeout(1); -} -void CloseCollector::Execute(){ - //printf("Closing collector: -0.5f\n"); - DentRobot::collector->MoveArms(-0.5); - //DentRobot::collector->MoveArms(-(-DentRobot::oi->GetRightStick()->GetRawAxis(3)+1)/2*.3/.5); -} -bool CloseCollector::IsFinished(){ - if(DentRobot::collector->ArmSensor()||IsTimedOut()){ - printf("Stopped Closing: %d, %d\n",DentRobot::collector->ArmSensor(), IsTimedOut()); - return true; - }else{ - return false; - } -} -void CloseCollector::End(){ - DentRobot::collector->MoveArms(0.0f); -} -void CloseCollector::Interrupted(){ - End(); -} -// vim: ts=2:sw=2:et diff --git a/Commands/Collector/CloseCollector.h b/Commands/Collector/CloseCollector.h deleted file mode 100644 index cd26268..0000000 --- a/Commands/Collector/CloseCollector.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CLOSECOLLECTOR_H -#define CLOSECOLLECTOR_H - -#include "Commands/Command.h" -#include "../../CommandBase.h" -#include "../../DentRobot.h" -#include "WPILib.h" - -class CloseCollector: public Command{ - public: - CloseCollector(); - void Initialize(); - void Execute(); - bool IsFinished(); - void End(); - void Interrupted(); -}; - -#endif -// vim: ts=2:sw=2:et diff --git a/Commands/Collector/CollectTote.cpp b/Commands/Collector/CollectTote.cpp index d4ab890..39e134a 100644 --- a/Commands/Collector/CollectTote.cpp +++ b/Commands/Collector/CollectTote.cpp @@ -2,15 +2,11 @@ #include "../../DentRobot.h" #include "../Autonomous/AutoDrive.h" #include "RollIn.h" -#include "CloseCollector.h" CollectTote::CollectTote(){ - AddParallel(new CloseCollector()); AddParallel(new AutoDrive(0.5, -1.0)); AddSequential(new RollIn()); - AddParallel(new CloseCollector()); AddParallel(new AutoDrive(0.5, 1.0)); AddSequential(new RollIn()); - AddParallel(new CloseCollector()); AddParallel(new AutoDrive(0.5, -1.0)); AddSequential(new RollIn()); } diff --git a/Commands/Collector/OpenCollector.cpp b/Commands/Collector/OpenCollector.cpp deleted file mode 100644 index 5cebc3e..0000000 --- a/Commands/Collector/OpenCollector.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "OpenCollector.h" -OpenCollector::OpenCollector() : Command("OpenCollector"){ - Requires(DentRobot::collector); -} -void OpenCollector::Initialize(){ - SetTimeout(0.5); -} -void OpenCollector::Execute(){ - DentRobot::collector->MoveArms(0.35); - //DentRobot::collector->MoveArms((-DentRobot::oi->GetRightStick()->GetRawAxis(3)+1)/2*.3/.5); -} -bool OpenCollector::IsFinished(){ - //return DentRobot::collector->ArmSensor(); - return IsTimedOut(); -} -void OpenCollector::End(){ - DentRobot::collector->MoveArms(0.0f); -} -void OpenCollector::Interrupted(){ - End(); -} -// vim: ts=2:sw=2:et diff --git a/Commands/Collector/OpenCollector.h b/Commands/Collector/OpenCollector.h deleted file mode 100644 index 2686251..0000000 --- a/Commands/Collector/OpenCollector.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef OPENCOLLECTOR_H -#define OPENCOLLECTOR_H - -#include "Commands/Command.h" -#include "../../CommandBase.h" -#include "../../DentRobot.h" -#include "WPILib.h" - -class OpenCollector: public Command{ - public: - OpenCollector(); - void Initialize(); - void Execute(); - bool IsFinished(); - void End(); - void Interrupted(); -}; - -#endif -// vim: ts=2:sw=2:et diff --git a/Commands/Collector/ReleaseTote.cpp b/Commands/Collector/ReleaseTote.cpp index c136661..c10ddd2 100644 --- a/Commands/Collector/ReleaseTote.cpp +++ b/Commands/Collector/ReleaseTote.cpp @@ -2,10 +2,8 @@ #include "../../DentRobot.h" #include "RollOut.h" #include "../Autonomous/AutoDrive.h" -#include "CloseCollector.h" ReleaseTote::ReleaseTote(){ AddParallel(new RollOut()); AddParallel(new AutoDrive(0.5, 0.75)); - AddSequential(new CloseCollector()); } // vim: ts=2:sw=2:et diff --git a/OI.cpp b/OI.cpp index 3107635..656da90 100644 --- a/OI.cpp +++ b/OI.cpp @@ -1,8 +1,6 @@ #include "OI.h" #include "Commands/Elevator/Lower.h" #include "Commands/Elevator/Raise.h" -#include "Commands/Collector/OpenCollector.h" -#include "Commands/Collector/CloseCollector.h" #include "Commands/Collector/RollIn.h" #include "Commands/Collector/RollOut.h" #include "Commands/BinElevator/BinLower.h" @@ -13,12 +11,8 @@ OI::OI() { leftStick=new Joystick(0); rightStick=new Joystick(1); // Collector - JoystickButton *right1=new JoystickButton(rightStick, 1); - JoystickButton *right2=new JoystickButton(rightStick, 2); JoystickButton *left1=new JoystickButton(leftStick, 1); JoystickButton *left2=new JoystickButton(leftStick, 2); - right1->WhileHeld(new CloseCollector()); - right2->WhileHeld(new OpenCollector()); left1->WhileHeld(new RollIn()); left2->WhileHeld(new RollOut()); // Elevator diff --git a/Subsystems/Collector.cpp b/Subsystems/Collector.cpp index fcc7959..fe8c589 100644 --- a/Subsystems/Collector.cpp +++ b/Subsystems/Collector.cpp @@ -2,18 +2,12 @@ #include "../RobotMap.h" Collector::Collector() : Subsystem("Collector") { - windowMotorLeft=new CANTalon(COLLECTOR_WINDOW_LEFT_CAN); - windowMotorRight=new CANTalon(COLLECTOR_WINDOW_RIGHT_CAN); collectorMotorLeft=new CANTalon(COLLECTOR_LEFT_CAN); collectorMotorBottom=new CANTalon(COLLECTOR_BOTTOM_CAN); collectorMotorRight=new CANTalon(COLLECTOR_RIGHT_CAN); } void Collector::InitDefaultCommand() { } -void Collector::MoveArms(double a){ - windowMotorLeft->Set(a); - windowMotorRight->Set(-a); -} void Collector::MoveRollers(double a){ collectorMotorLeft->Set(a); collectorMotorBottom->Set(a); diff --git a/Subsystems/Collector.h b/Subsystems/Collector.h index 92262ac..c74ed35 100644 --- a/Subsystems/Collector.h +++ b/Subsystems/Collector.h @@ -5,11 +5,10 @@ class Collector: public Subsystem { private: - CANTalon *windowMotorLeft, *windowMotorRight, *collectorMotorLeft, *collectorMotorBottom, *collectorMotorRight; + CANTalon *collectorMotorLeft, *collectorMotorBottom, *collectorMotorRight; public: Collector(); void InitDefaultCommand(); - void MoveArms(double); void MoveRollers(double); bool ArmSensor(); bool BoxCollected(); diff --git a/TODO.txt b/TODO.txt deleted file mode 100644 index e69de29..0000000