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

Constructor consistency update

This commit is contained in:
Austen Adler 2015-03-07 13:27:11 -05:00
parent 110f064f80
commit 7476f4f5d4
20 changed files with 27 additions and 32 deletions

View File

@ -1,7 +1,7 @@
#include "AutoDrive.h" #include "AutoDrive.h"
#include "../../DentRobot.h" #include "../../DentRobot.h"
// Drive for a short while then stop. Just for testing // 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); Requires(DentRobot::drivetrain);
SetTimeout(duration); SetTimeout(duration);
x=xtmp; x=xtmp;

View File

@ -10,8 +10,7 @@ class AutoDrive: public Command{
private: private:
double x, y; double x, y;
public: public:
AutoDrive(double); AutoDrive(double duration, double xtmp = 0.0, double ytmp = -0.75);
AutoDrive(double, double, double);
void Initialize(); void Initialize();
void Execute(); void Execute();
bool IsFinished(); bool IsFinished();

View File

@ -1,9 +1,8 @@
#include "Turn.h" #include "Turn.h"
#include "../../DentRobot.h" #include "../../DentRobot.h"
// Drive for a short while then stop. Just for testing Turn::Turn(double timeout) : Command("Turn"){
Turn::Turn(double k) : Command("Turn"){
Requires(DentRobot::drivetrain); Requires(DentRobot::drivetrain);
SetTimeout(k); SetTimeout(timeout);
} }
void Turn::Initialize(){ void Turn::Initialize(){
} }

View File

@ -1,10 +1,10 @@
#include "BinCloseArms.h" #include "BinCloseArms.h"
#include "../../DentRobot.h" #include "../../DentRobot.h"
#include "../../OI.h" #include "../../OI.h"
BinCloseArms::BinCloseArms() : Command("BinCloseArms"){ BinCloseArms::BinCloseArms(double timeout) : Command("BinCloseArms"){
SetTimeout(timeout);
} }
void BinCloseArms::Initialize(){ void BinCloseArms::Initialize(){
SetTimeout(0.5);
} }
void BinCloseArms::Execute(){ void BinCloseArms::Execute(){
DentRobot::pneumatics->SetOpen(false); DentRobot::pneumatics->SetOpen(false);

View File

@ -6,7 +6,7 @@
class BinCloseArms: public Command{ class BinCloseArms: public Command{
public: public:
BinCloseArms(); BinCloseArms(double timeout = 0.5);
void Initialize(); void Initialize();
void Execute(); void Execute();
bool IsFinished(); bool IsFinished();

View File

@ -1,11 +1,10 @@
#include "BinLower.h" #include "BinLower.h"
#include "../../DentRobot.h" #include "../../DentRobot.h"
#include "../../OI.h" #include "../../OI.h"
BinLower::BinLower(double t) : Command("BinLower"){ BinLower::BinLower(double timeout) : Command("BinLower"){
timeout=t; SetTimeout(timeout);
} }
void BinLower::Initialize(){ void BinLower::Initialize(){
SetTimeout(timeout);
} }
void BinLower::Execute(){ void BinLower::Execute(){
DentRobot::binElevator->Run(-1.0); DentRobot::binElevator->Run(-1.0);

View File

@ -6,7 +6,6 @@
class BinLower: public Command{ class BinLower: public Command{
private: private:
double timeout;
public: public:
BinLower(double); BinLower(double);
void Initialize(); void Initialize();

View File

@ -1,10 +1,10 @@
#include "BinOpenArms.h" #include "BinOpenArms.h"
#include "../../DentRobot.h" #include "../../DentRobot.h"
#include "../../OI.h" #include "../../OI.h"
BinOpenArms::BinOpenArms() : Command("BinOpenArms"){ BinOpenArms::BinOpenArms(double timeout) : Command("BinOpenArms"){
SetTimeout(timeout);
} }
void BinOpenArms::Initialize(){ void BinOpenArms::Initialize(){
SetTimeout(0.5);
} }
void BinOpenArms::Execute(){ void BinOpenArms::Execute(){
DentRobot::pneumatics->SetOpen(true); DentRobot::pneumatics->SetOpen(true);

View File

@ -6,7 +6,7 @@
class BinOpenArms: public Command{ class BinOpenArms: public Command{
public: public:
BinOpenArms(); BinOpenArms(double);
void Initialize(); void Initialize();
void Execute(); void Execute();
bool IsFinished(); bool IsFinished();

View File

@ -1,11 +1,10 @@
#include "BinRaise.h" #include "BinRaise.h"
#include "../../DentRobot.h" #include "../../DentRobot.h"
#include "../../OI.h" #include "../../OI.h"
BinRaise::BinRaise(double t) : Command("BinRaise"){ BinRaise::BinRaise(double timeout) : Command("BinRaise"){
timeout=t; SetTimeout(timeout);
} }
void BinRaise::Initialize(){ void BinRaise::Initialize(){
SetTimeout(timeout);
} }
void BinRaise::Execute(){ void BinRaise::Execute(){
DentRobot::binElevator->Run(1.0); DentRobot::binElevator->Run(1.0);

View File

@ -6,7 +6,6 @@
class BinRaise: public Command{ class BinRaise: public Command{
private: private:
double timeout;
public: public:
BinRaise(double); BinRaise(double);
void Initialize(); void Initialize();

View File

@ -1,6 +1,6 @@
#include "RollIn.h" #include "RollIn.h"
RollIn::RollIn(double k) : Command("RollIn"){ RollIn::RollIn(double speed) : Command("RollIn"){
rawSpeed=k; rawSpeed=speed;
} }
void RollIn::Initialize(){ void RollIn::Initialize(){
printf("Initialized RollIn\n"); printf("Initialized RollIn\n");

View File

@ -10,6 +10,7 @@ class RollIn: public Command{
private: private:
double rawSpeed; double rawSpeed;
public: public:
RollIn();
RollIn(double); RollIn(double);
void Initialize(); void Initialize();
void Execute(); void Execute();

View File

@ -1,9 +1,9 @@
#include "RollOut.h" #include "RollOut.h"
RollOut::RollOut() : Command("RollOut"){ RollOut::RollOut(double timeout) : Command("RollOut"){
Requires(DentRobot::collector); Requires(DentRobot::collector);
SetTimeout(timeout);
} }
void RollOut::Initialize(){ void RollOut::Initialize(){
SetTimeout(2.0);
} }
void RollOut::Execute(){ void RollOut::Execute(){
//TODO check this value to move the motors in the right direction //TODO check this value to move the motors in the right direction

View File

@ -8,7 +8,7 @@
class RollOut: public Command{ class RollOut: public Command{
public: public:
RollOut(); RollOut(double timeout = 2.0);
void Initialize(); void Initialize();
void Execute(); void Execute();
bool IsFinished(); bool IsFinished();

View File

@ -10,7 +10,7 @@ void Drive::Execute(){
x = DentRobot::oi->GetLeftStick()->GetRawAxis(0); x = DentRobot::oi->GetLeftStick()->GetRawAxis(0);
y = -DentRobot::oi->GetLeftStick()->GetRawAxis(1); y = -DentRobot::oi->GetLeftStick()->GetRawAxis(1);
z = DentRobot::oi->GetLeftStick()->GetRawAxis(2); 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)){ //if (DentRobot::oi->GetLeftStick()->GetRawButton(1)){
// x=0; // x=0;
//} //}

View File

@ -1,10 +1,10 @@
#include "Lower.h" #include "Lower.h"
#include "../../DentRobot.h" #include "../../DentRobot.h"
#include "../../OI.h" #include "../../OI.h"
Lower::Lower() : Command("Lower"){ Lower::Lower(double timeout) : Command("Lower"){
SetTimeout(timeout);
} }
void Lower::Initialize(){ void Lower::Initialize(){
SetTimeout(3.0);
} }
void Lower::Execute(){ void Lower::Execute(){
DentRobot::elevator->Run(-1.0); DentRobot::elevator->Run(-1.0);

View File

@ -6,7 +6,7 @@
class Lower: public Command{ class Lower: public Command{
public: public:
Lower(); Lower(double timeout=3.0);
void Initialize(); void Initialize();
void Execute(); void Execute();
bool IsFinished(); bool IsFinished();

View File

@ -1,10 +1,10 @@
#include "Raise.h" #include "Raise.h"
#include "../../DentRobot.h" #include "../../DentRobot.h"
#include "../../OI.h" #include "../../OI.h"
Raise::Raise() : Command("Raise"){ Raise::Raise(double timeout) : Command("Raise"){
SetTimeout(timeout);
} }
void Raise::Initialize(){ void Raise::Initialize(){
SetTimeout(3.5);
} }
void Raise::Execute(){ void Raise::Execute(){
DentRobot::elevator->Run(1.0); DentRobot::elevator->Run(1.0);

View File

@ -6,7 +6,7 @@
class Raise: public Command{ class Raise: public Command{
public: public:
Raise(); Raise(double timeout=3.5);
void Initialize(); void Initialize();
void Execute(); void Execute();
bool IsFinished(); bool IsFinished();