2
0
mirror of https://github.com/team2059/Dent synced 2025-01-07 22:14:14 -05:00
dent/Commands/BinElevator/BinLower.cpp

26 lines
636 B
C++
Raw Permalink Normal View History

2015-02-10 20:12:41 -05:00
#include "BinLower.h"
#include "../../DentRobot.h"
#include "../../OI.h"
2015-07-31 12:52:15 -04:00
BinLower::BinLower(float timeout): Command("BinLower") {
2015-03-07 13:27:11 -05:00
SetTimeout(timeout);
2015-02-10 20:12:41 -05:00
}
2015-09-19 21:57:42 +00:00
void BinLower::Initialize() {}
2015-07-31 12:52:15 -04:00
void BinLower::Execute() {
2015-02-10 20:12:41 -05:00
DentRobot::binElevator->Run(-1.0);
}
2015-07-31 12:52:15 -04:00
bool BinLower::IsFinished() {
if(/*!DentRobot::binElevator->GetElevatorBottom()||*/IsTimedOut()) {
2015-02-10 20:12:41 -05:00
printf("Robot stoped BinLowering. Sensor based? %d\n", !DentRobot::binElevator->GetElevatorBottom());
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 BinLower::End() {
2015-02-10 20:12:41 -05:00
DentRobot::binElevator->Run(0.0f);
}
2015-07-31 12:52:15 -04:00
void BinLower::Interrupted() {
2015-02-10 20:12:41 -05:00
End();
}
// vim: ts=2:sw=2:et