From dc593a328236fb16c732dc5241f64e1f391a06a9 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Fri, 13 Feb 2015 19:40:23 -0500 Subject: [PATCH] Renamed collector commands (untested) --- Commands/Autonomous/Autonomous.cpp | 8 ++++---- .../Collector/{CollectTote.cpp => RollIn.cpp} | 16 ++++++++-------- Commands/Collector/{CollectTote.h => RollIn.h} | 8 ++++---- .../Collector/{ReleaseTote.cpp => RollOut.cpp} | 14 +++++++------- Commands/Collector/{ReleaseTote.h => RollOut.h} | 8 ++++---- OI.cpp | 8 ++++---- 6 files changed, 31 insertions(+), 31 deletions(-) rename Commands/Collector/{CollectTote.cpp => RollIn.cpp} (57%) rename Commands/Collector/{CollectTote.h => RollIn.h} (72%) rename Commands/Collector/{ReleaseTote.cpp => RollOut.cpp} (64%) rename Commands/Collector/{ReleaseTote.h => RollOut.h} (72%) diff --git a/Commands/Autonomous/Autonomous.cpp b/Commands/Autonomous/Autonomous.cpp index 55b62d2..1201f93 100644 --- a/Commands/Autonomous/Autonomous.cpp +++ b/Commands/Autonomous/Autonomous.cpp @@ -6,7 +6,7 @@ #include "Turn.h" #include "../Collector/CloseCollector.h" #include "../Collector/OpenCollector.h" -#include "../Collector/CollectTote.h" +#include "../Collector/RollIn.h" Autonomous::Autonomous(int seq){ SmartDashboard::GetNumber("Auto Wait Time"); switch(seq){ @@ -19,7 +19,7 @@ Autonomous::Autonomous(int seq){ AddSequential(new Turn()); AddParallel(new AutoDrive(0.5)); AddParallel(new CloseCollector()); - AddSequential(new CollectTote()); + AddSequential(new RollIn()); AddSequential(new Turn()); break; case 1: @@ -28,7 +28,7 @@ Autonomous::Autonomous(int seq){ AddSequential(new AutoDrive(0.5)); AddSequential(new Turn()); AddSequential(new Turn()); - AddSequential(new CollectTote()); + AddSequential(new RollIn()); break; case 2: // Drive forward a bit, turn around, collect tote then bin @@ -36,7 +36,7 @@ Autonomous::Autonomous(int seq){ AddParallel(new AutoDrive(0.5)); AddSequential(new Turn()); AddSequential(new Turn()); - AddSequential(new CollectTote()); + AddSequential(new RollIn()); break; case 3: // Wait a desigated value, drive to Auto Zone (TM) diff --git a/Commands/Collector/CollectTote.cpp b/Commands/Collector/RollIn.cpp similarity index 57% rename from Commands/Collector/CollectTote.cpp rename to Commands/Collector/RollIn.cpp index acabd4e..68c49b8 100644 --- a/Commands/Collector/CollectTote.cpp +++ b/Commands/Collector/RollIn.cpp @@ -1,22 +1,22 @@ -#include "CollectTote.h" -CollectTote::CollectTote() : Command("CollectTote"){ +#include "RollIn.h" +RollIn::RollIn() : Command("RollIn"){ Requires(DentRobot::collector); } -void CollectTote::Initialize(){ - printf("Initialized CollectTote\n"); +void RollIn::Initialize(){ + printf("Initialized RollIn\n"); SetTimeout(2.0); } -void CollectTote::Execute(){ +void RollIn::Execute(){ //TODO check this value to move the motors in the right direction DentRobot::collector->MoveRollers(-(-DentRobot::oi->GetLeftStick()->GetRawAxis(3)+1.0)/2); } -bool CollectTote::IsFinished(){ +bool RollIn::IsFinished(){ return DentRobot::collector->BoxCollected()||IsTimedOut(); } -void CollectTote::End(){ +void RollIn::End(){ DentRobot::collector->MoveRollers(0.0); } -void CollectTote::Interrupted(){ +void RollIn::Interrupted(){ End(); } // vim: ts=2:sw=2:et diff --git a/Commands/Collector/CollectTote.h b/Commands/Collector/RollIn.h similarity index 72% rename from Commands/Collector/CollectTote.h rename to Commands/Collector/RollIn.h index 03074fd..8a222aa 100644 --- a/Commands/Collector/CollectTote.h +++ b/Commands/Collector/RollIn.h @@ -1,14 +1,14 @@ -#ifndef COLLECTTOTE_H -#define COLLECTTOTE_H +#ifndef ROLLIN_H +#define ROLLIN_H #include "Commands/Command.h" #include "../../CommandBase.h" #include "../../DentRobot.h" #include "WPILib.h" -class CollectTote: public Command{ +class RollIn: public Command{ public: - CollectTote(); + RollIn(); void Initialize(); void Execute(); bool IsFinished(); diff --git a/Commands/Collector/ReleaseTote.cpp b/Commands/Collector/RollOut.cpp similarity index 64% rename from Commands/Collector/ReleaseTote.cpp rename to Commands/Collector/RollOut.cpp index 744efcb..7f7297d 100644 --- a/Commands/Collector/ReleaseTote.cpp +++ b/Commands/Collector/RollOut.cpp @@ -1,22 +1,22 @@ -#include "ReleaseTote.h" -ReleaseTote::ReleaseTote() : Command("ReleaseTote"){ +#include "RollOut.h" +RollOut::RollOut() : Command("RollOut"){ Requires(DentRobot::collector); } -void ReleaseTote::Initialize(){ +void RollOut::Initialize(){ SetTimeout(2.0); } -void ReleaseTote::Execute(){ +void RollOut::Execute(){ //TODO check this value to move the motors in the right direction // Devide by 2 twice because this speed should be half the collector speed DentRobot::collector->MoveRollers((-DentRobot::oi->GetLeftStick()->GetRawAxis(3)+1.0)/2/2); } -bool ReleaseTote::IsFinished(){ +bool RollOut::IsFinished(){ return DentRobot::collector->BoxCollected(); } -void ReleaseTote::End(){ +void RollOut::End(){ DentRobot::collector->MoveRollers(0.0f); } -void ReleaseTote::Interrupted(){ +void RollOut::Interrupted(){ End(); } // vim: ts=2:sw=2:et diff --git a/Commands/Collector/ReleaseTote.h b/Commands/Collector/RollOut.h similarity index 72% rename from Commands/Collector/ReleaseTote.h rename to Commands/Collector/RollOut.h index 722680f..7143d07 100644 --- a/Commands/Collector/ReleaseTote.h +++ b/Commands/Collector/RollOut.h @@ -1,14 +1,14 @@ -#ifndef RELEASETOTE_H -#define RELEASETOTE_H +#ifndef ROLLOUT_H +#define ROLLOUT_H #include "Commands/Command.h" #include "../../CommandBase.h" #include "../../DentRobot.h" #include "WPILib.h" -class ReleaseTote: public Command{ +class RollOut: public Command{ public: - ReleaseTote(); + RollOut(); void Initialize(); void Execute(); bool IsFinished(); diff --git a/OI.cpp b/OI.cpp index e01e119..84abd5c 100644 --- a/OI.cpp +++ b/OI.cpp @@ -3,8 +3,8 @@ #include "Commands/Elevator/Raise.h" #include "Commands/Collector/OpenCollector.h" #include "Commands/Collector/CloseCollector.h" -#include "Commands/Collector/CollectTote.h" -#include "Commands/Collector/ReleaseTote.h" +#include "Commands/Collector/RollIn.h" +#include "Commands/Collector/RollOut.h" OI::OI() { // Joysticks @@ -17,8 +17,8 @@ OI::OI() { JoystickButton *left2=new JoystickButton(leftStick, 2); right1->WhileHeld(new CloseCollector()); right2->WhileHeld(new OpenCollector()); - left1->WhileHeld(new CollectTote()); - left2->WhileHeld(new ReleaseTote()); + left1->WhileHeld(new RollIn()); + left2->WhileHeld(new RollOut()); // Elevator raise=new Raise(); lower=new Lower();