diff --git a/Commands/Autonomous/AutoDrive.cpp b/Commands/Autonomous/AutoDrive.cpp index ba14f03..4f8dea5 100644 --- a/Commands/Autonomous/AutoDrive.cpp +++ b/Commands/Autonomous/AutoDrive.cpp @@ -1,7 +1,7 @@ #include "AutoDrive.h" #include "../../DentRobot.h" // Drive for a short while then stop. Just for testing -AutoDrive::AutoDrive(double duration, double xtmp=0, double ytmp=-0.75) : Command("AutoDrive"){ +AutoDrive::AutoDrive(double duration, double xtmp, double ytmp) : Command("AutoDrive"){ Requires(DentRobot::drivetrain); SetTimeout(duration); x=xtmp; diff --git a/Commands/Autonomous/AutoDrive.h b/Commands/Autonomous/AutoDrive.h index 6fa66ef..fd0c5e3 100644 --- a/Commands/Autonomous/AutoDrive.h +++ b/Commands/Autonomous/AutoDrive.h @@ -10,8 +10,7 @@ class AutoDrive: public Command{ private: double x, y; public: - AutoDrive(double); - AutoDrive(double, double, double); + AutoDrive(double duration, double xtmp = 0.0, double ytmp = -0.75); void Initialize(); void Execute(); bool IsFinished(); diff --git a/Commands/Autonomous/Turn.cpp b/Commands/Autonomous/Turn.cpp index 848cc6e..d9a68d7 100644 --- a/Commands/Autonomous/Turn.cpp +++ b/Commands/Autonomous/Turn.cpp @@ -1,9 +1,8 @@ #include "Turn.h" #include "../../DentRobot.h" -// Drive for a short while then stop. Just for testing -Turn::Turn(double k) : Command("Turn"){ +Turn::Turn(double timeout) : Command("Turn"){ Requires(DentRobot::drivetrain); - SetTimeout(k); + SetTimeout(timeout); } void Turn::Initialize(){ } diff --git a/Commands/BinElevator/BinCloseArms.cpp b/Commands/BinElevator/BinCloseArms.cpp index 37a4534..f16cab0 100644 --- a/Commands/BinElevator/BinCloseArms.cpp +++ b/Commands/BinElevator/BinCloseArms.cpp @@ -1,10 +1,10 @@ #include "BinCloseArms.h" #include "../../DentRobot.h" #include "../../OI.h" -BinCloseArms::BinCloseArms() : Command("BinCloseArms"){ +BinCloseArms::BinCloseArms(double timeout) : Command("BinCloseArms"){ + SetTimeout(timeout); } void BinCloseArms::Initialize(){ - SetTimeout(0.5); } void BinCloseArms::Execute(){ DentRobot::pneumatics->SetOpen(false); diff --git a/Commands/BinElevator/BinCloseArms.h b/Commands/BinElevator/BinCloseArms.h index b6322b9..2eee806 100644 --- a/Commands/BinElevator/BinCloseArms.h +++ b/Commands/BinElevator/BinCloseArms.h @@ -6,7 +6,7 @@ class BinCloseArms: public Command{ public: - BinCloseArms(); + BinCloseArms(double timeout = 0.5); void Initialize(); void Execute(); bool IsFinished(); diff --git a/Commands/BinElevator/BinLower.cpp b/Commands/BinElevator/BinLower.cpp index 336e896..cdb659e 100644 --- a/Commands/BinElevator/BinLower.cpp +++ b/Commands/BinElevator/BinLower.cpp @@ -1,11 +1,10 @@ #include "BinLower.h" #include "../../DentRobot.h" #include "../../OI.h" -BinLower::BinLower(double t) : Command("BinLower"){ - timeout=t; +BinLower::BinLower(double timeout) : Command("BinLower"){ + SetTimeout(timeout); } void BinLower::Initialize(){ - SetTimeout(timeout); } void BinLower::Execute(){ DentRobot::binElevator->Run(-1.0); diff --git a/Commands/BinElevator/BinLower.h b/Commands/BinElevator/BinLower.h index 79e5286..4d97be5 100644 --- a/Commands/BinElevator/BinLower.h +++ b/Commands/BinElevator/BinLower.h @@ -6,7 +6,6 @@ class BinLower: public Command{ private: - double timeout; public: BinLower(double); void Initialize(); diff --git a/Commands/BinElevator/BinOpenArms.cpp b/Commands/BinElevator/BinOpenArms.cpp index 2a415d3..694f357 100644 --- a/Commands/BinElevator/BinOpenArms.cpp +++ b/Commands/BinElevator/BinOpenArms.cpp @@ -1,10 +1,10 @@ #include "BinOpenArms.h" #include "../../DentRobot.h" #include "../../OI.h" -BinOpenArms::BinOpenArms() : Command("BinOpenArms"){ +BinOpenArms::BinOpenArms(double timeout) : Command("BinOpenArms"){ + SetTimeout(timeout); } void BinOpenArms::Initialize(){ - SetTimeout(0.5); } void BinOpenArms::Execute(){ DentRobot::pneumatics->SetOpen(true); diff --git a/Commands/BinElevator/BinOpenArms.h b/Commands/BinElevator/BinOpenArms.h index 533d71c..1e3fde0 100644 --- a/Commands/BinElevator/BinOpenArms.h +++ b/Commands/BinElevator/BinOpenArms.h @@ -6,7 +6,7 @@ class BinOpenArms: public Command{ public: - BinOpenArms(); + BinOpenArms(double); void Initialize(); void Execute(); bool IsFinished(); diff --git a/Commands/BinElevator/BinRaise.cpp b/Commands/BinElevator/BinRaise.cpp index 2b53e81..8ac189f 100644 --- a/Commands/BinElevator/BinRaise.cpp +++ b/Commands/BinElevator/BinRaise.cpp @@ -1,11 +1,10 @@ #include "BinRaise.h" #include "../../DentRobot.h" #include "../../OI.h" -BinRaise::BinRaise(double t) : Command("BinRaise"){ - timeout=t; +BinRaise::BinRaise(double timeout) : Command("BinRaise"){ + SetTimeout(timeout); } void BinRaise::Initialize(){ - SetTimeout(timeout); } void BinRaise::Execute(){ DentRobot::binElevator->Run(1.0); diff --git a/Commands/BinElevator/BinRaise.h b/Commands/BinElevator/BinRaise.h index cdea982..344519b 100644 --- a/Commands/BinElevator/BinRaise.h +++ b/Commands/BinElevator/BinRaise.h @@ -6,7 +6,6 @@ class BinRaise: public Command{ private: - double timeout; public: BinRaise(double); void Initialize(); diff --git a/Commands/Collector/RollIn.cpp b/Commands/Collector/RollIn.cpp index 4d3e7c3..87ec0f9 100644 --- a/Commands/Collector/RollIn.cpp +++ b/Commands/Collector/RollIn.cpp @@ -1,6 +1,6 @@ #include "RollIn.h" -RollIn::RollIn(double k) : Command("RollIn"){ - rawSpeed=k; +RollIn::RollIn(double speed) : Command("RollIn"){ + rawSpeed=speed; } void RollIn::Initialize(){ printf("Initialized RollIn\n"); diff --git a/Commands/Collector/RollIn.h b/Commands/Collector/RollIn.h index 25e4924..90ec585 100644 --- a/Commands/Collector/RollIn.h +++ b/Commands/Collector/RollIn.h @@ -10,6 +10,7 @@ class RollIn: public Command{ private: double rawSpeed; public: + RollIn(); RollIn(double); void Initialize(); void Execute(); diff --git a/Commands/Collector/RollOut.cpp b/Commands/Collector/RollOut.cpp index ddfdf2a..eb07ad6 100644 --- a/Commands/Collector/RollOut.cpp +++ b/Commands/Collector/RollOut.cpp @@ -1,9 +1,9 @@ #include "RollOut.h" -RollOut::RollOut() : Command("RollOut"){ +RollOut::RollOut(double timeout) : Command("RollOut"){ Requires(DentRobot::collector); + SetTimeout(timeout); } void RollOut::Initialize(){ - SetTimeout(2.0); } void RollOut::Execute(){ //TODO check this value to move the motors in the right direction diff --git a/Commands/Collector/RollOut.h b/Commands/Collector/RollOut.h index 7143d07..eeb921e 100644 --- a/Commands/Collector/RollOut.h +++ b/Commands/Collector/RollOut.h @@ -8,7 +8,7 @@ class RollOut: public Command{ public: - RollOut(); + RollOut(double timeout = 2.0); void Initialize(); void Execute(); bool IsFinished(); diff --git a/Commands/Drivetrain/Drive.cpp b/Commands/Drivetrain/Drive.cpp index 553302f..4354717 100644 --- a/Commands/Drivetrain/Drive.cpp +++ b/Commands/Drivetrain/Drive.cpp @@ -10,7 +10,7 @@ void Drive::Execute(){ x = DentRobot::oi->GetLeftStick()->GetRawAxis(0); y = -DentRobot::oi->GetLeftStick()->GetRawAxis(1); z = DentRobot::oi->GetLeftStick()->GetRawAxis(2); - //Code to lock the x axis when not holding button 1 + // Lock the x axis when not holding button 1 //if (DentRobot::oi->GetLeftStick()->GetRawButton(1)){ // x=0; //} diff --git a/Commands/Elevator/Lower.cpp b/Commands/Elevator/Lower.cpp index 637a88b..3b11e4f 100644 --- a/Commands/Elevator/Lower.cpp +++ b/Commands/Elevator/Lower.cpp @@ -1,10 +1,10 @@ #include "Lower.h" #include "../../DentRobot.h" #include "../../OI.h" -Lower::Lower() : Command("Lower"){ +Lower::Lower(double timeout) : Command("Lower"){ + SetTimeout(timeout); } void Lower::Initialize(){ - SetTimeout(3.0); } void Lower::Execute(){ DentRobot::elevator->Run(-1.0); diff --git a/Commands/Elevator/Lower.h b/Commands/Elevator/Lower.h index 92c8535..ec0188a 100644 --- a/Commands/Elevator/Lower.h +++ b/Commands/Elevator/Lower.h @@ -6,7 +6,7 @@ class Lower: public Command{ public: - Lower(); + Lower(double timeout=3.0); void Initialize(); void Execute(); bool IsFinished(); diff --git a/Commands/Elevator/Raise.cpp b/Commands/Elevator/Raise.cpp index ce42ab8..48286c7 100644 --- a/Commands/Elevator/Raise.cpp +++ b/Commands/Elevator/Raise.cpp @@ -1,10 +1,10 @@ #include "Raise.h" #include "../../DentRobot.h" #include "../../OI.h" -Raise::Raise() : Command("Raise"){ +Raise::Raise(double timeout) : Command("Raise"){ + SetTimeout(timeout); } void Raise::Initialize(){ - SetTimeout(3.5); } void Raise::Execute(){ DentRobot::elevator->Run(1.0); diff --git a/Commands/Elevator/Raise.h b/Commands/Elevator/Raise.h index b19f470..76a0ef4 100644 --- a/Commands/Elevator/Raise.h +++ b/Commands/Elevator/Raise.h @@ -6,7 +6,7 @@ class Raise: public Command{ public: - Raise(); + Raise(double timeout=3.5); void Initialize(); void Execute(); bool IsFinished();