mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Constructor consistency update
This commit is contained in:
parent
110f064f80
commit
7476f4f5d4
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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(){
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
class BinCloseArms: public Command{
|
||||
public:
|
||||
BinCloseArms();
|
||||
BinCloseArms(double timeout = 0.5);
|
||||
void Initialize();
|
||||
void Execute();
|
||||
bool IsFinished();
|
||||
|
@ -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);
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
class BinLower: public Command{
|
||||
private:
|
||||
double timeout;
|
||||
public:
|
||||
BinLower(double);
|
||||
void Initialize();
|
||||
|
@ -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);
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
class BinOpenArms: public Command{
|
||||
public:
|
||||
BinOpenArms();
|
||||
BinOpenArms(double);
|
||||
void Initialize();
|
||||
void Execute();
|
||||
bool IsFinished();
|
||||
|
@ -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);
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
class BinRaise: public Command{
|
||||
private:
|
||||
double timeout;
|
||||
public:
|
||||
BinRaise(double);
|
||||
void Initialize();
|
||||
|
@ -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");
|
||||
|
@ -10,6 +10,7 @@ class RollIn: public Command{
|
||||
private:
|
||||
double rawSpeed;
|
||||
public:
|
||||
RollIn();
|
||||
RollIn(double);
|
||||
void Initialize();
|
||||
void Execute();
|
||||
|
@ -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
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
class RollOut: public Command{
|
||||
public:
|
||||
RollOut();
|
||||
RollOut(double timeout = 2.0);
|
||||
void Initialize();
|
||||
void Execute();
|
||||
bool IsFinished();
|
||||
|
@ -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;
|
||||
//}
|
||||
|
@ -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);
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
class Lower: public Command{
|
||||
public:
|
||||
Lower();
|
||||
Lower(double timeout=3.0);
|
||||
void Initialize();
|
||||
void Execute();
|
||||
bool IsFinished();
|
||||
|
@ -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);
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
class Raise: public Command{
|
||||
public:
|
||||
Raise();
|
||||
Raise(double timeout=3.5);
|
||||
void Initialize();
|
||||
void Execute();
|
||||
bool IsFinished();
|
||||
|
Loading…
Reference in New Issue
Block a user