2015-02-10 20:12:41 -05:00
|
|
|
#include "BinRaise.h"
|
|
|
|
#include "../../DentRobot.h"
|
|
|
|
#include "../../OI.h"
|
2015-02-27 06:47:10 -05:00
|
|
|
BinRaise::BinRaise(float t) : Command("BinRaise"){
|
|
|
|
timeout=t;
|
2015-02-10 20:12:41 -05:00
|
|
|
}
|
|
|
|
void BinRaise::Initialize(){
|
2015-02-27 06:47:10 -05:00
|
|
|
SetTimeout(timeout);
|
2015-02-10 20:12:41 -05:00
|
|
|
}
|
|
|
|
void BinRaise::Execute(){
|
|
|
|
DentRobot::binElevator->Run(1.0);
|
|
|
|
}
|
|
|
|
bool BinRaise::IsFinished(){
|
2015-02-15 07:53:19 -05:00
|
|
|
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;
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void BinRaise::End(){
|
|
|
|
DentRobot::binElevator->Run(0.0f);
|
|
|
|
}
|
|
|
|
void BinRaise::Interrupted(){
|
|
|
|
End();
|
|
|
|
}
|
|
|
|
// vim: ts=2:sw=2:et
|