mirror of
https://github.com/team2059/Dent
synced 2025-01-07 22:14:14 -05:00
30 lines
610 B
C++
30 lines
610 B
C++
#include "Raise.h"
|
|
#include "../../DentRobot.h"
|
|
#include "../../OI.h"
|
|
Raise::Raise(double timeout, bool useSoftLimits, double liftSpeed): Command("Raise") {
|
|
SetTimeout(timeout);
|
|
softLimits=useSoftLimits;
|
|
speed=liftSpeed;
|
|
}
|
|
void Raise::Initialize() {}
|
|
void Raise::Execute() {
|
|
if(DentRobot::oi->GetRightStick()->GetRawButton(11)){
|
|
speed*=0.5;
|
|
}
|
|
DentRobot::elevator->Run(speed);
|
|
}
|
|
bool Raise::IsFinished() {
|
|
if(IsTimedOut()) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
void Raise::End() {
|
|
DentRobot::elevator->Run(0.0f);
|
|
}
|
|
void Raise::Interrupted() {
|
|
End();
|
|
}
|
|
// vim: ts=2:sw=2:et
|