2015-02-10 20:12:41 -05:00
|
|
|
#include "BinRaise.h"
|
|
|
|
#include "../../DentRobot.h"
|
|
|
|
#include "../../OI.h"
|
2015-07-31 12:52:15 -04:00
|
|
|
BinRaise::BinRaise(double timeout): Command("BinRaise") {
|
2015-03-07 13:27:11 -05:00
|
|
|
SetTimeout(timeout);
|
2015-02-10 20:12:41 -05:00
|
|
|
}
|
2015-09-19 17:57:42 -04:00
|
|
|
void BinRaise::Initialize() {}
|
2015-07-31 12:52:15 -04:00
|
|
|
void BinRaise::Execute() {
|
2015-02-10 20:12:41 -05:00
|
|
|
DentRobot::binElevator->Run(1.0);
|
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
bool BinRaise::IsFinished() {
|
|
|
|
if(/*!DentRobot::binElevator->GetElevatorTop()||*/IsTimedOut()) {
|
2015-02-10 20:12:41 -05:00
|
|
|
printf("Robot stoped raising. Sensor based? %d\n", !DentRobot::binElevator->GetElevatorTop());
|
|
|
|
return true;
|
2015-07-31 12:52:15 -04:00
|
|
|
} else {
|
2015-02-10 20:12:41 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void BinRaise::End() {
|
2015-02-10 20:12:41 -05:00
|
|
|
DentRobot::binElevator->Run(0.0f);
|
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void BinRaise::Interrupted() {
|
2015-02-10 20:12:41 -05:00
|
|
|
End();
|
|
|
|
}
|
|
|
|
// vim: ts=2:sw=2:et
|