mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
27 lines
598 B
C++
27 lines
598 B
C++
|
#include "BinRaise.h"
|
||
|
#include "../../DentRobot.h"
|
||
|
#include "../../OI.h"
|
||
|
BinRaise::BinRaise() : Command("BinRaise"){
|
||
|
}
|
||
|
void BinRaise::Initialize(){
|
||
|
SetTimeout(3.0);
|
||
|
}
|
||
|
void BinRaise::Execute(){
|
||
|
DentRobot::binElevator->Run(1.0);
|
||
|
}
|
||
|
bool BinRaise::IsFinished(){
|
||
|
if (!DentRobot::binElevator->GetElevatorTop()||IsTimedOut()){
|
||
|
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
|