2015-04-06 20:36:35 -04:00
|
|
|
#include "BinIn.h"
|
|
|
|
#include "../../DentRobot.h"
|
|
|
|
#include "../../OI.h"
|
2015-07-31 12:52:15 -04:00
|
|
|
BinIn::BinIn(float timeout): Command("BinIn") {
|
2015-04-06 20:36:35 -04:00
|
|
|
SetTimeout(timeout);
|
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void BinIn::Initialize() {
|
2015-04-06 20:36:35 -04:00
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void BinIn::Execute() {
|
2015-04-18 05:03:06 -04:00
|
|
|
DentRobot::binCollector->MoveArms(0.75);
|
2015-04-06 20:36:35 -04:00
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
bool BinIn::IsFinished() {
|
|
|
|
if(IsTimedOut()) {
|
2015-04-18 05:03:06 -04:00
|
|
|
printf("Robot stopped collecting bin.\n");
|
2015-04-06 20:36:35 -04:00
|
|
|
return true;
|
2015-07-31 12:52:15 -04:00
|
|
|
} else {
|
2015-04-06 20:36:35 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void BinIn::End() {
|
2015-04-18 05:03:06 -04:00
|
|
|
DentRobot::binCollector->MoveArms(0.0);
|
2015-04-06 20:36:35 -04:00
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void BinIn::Interrupted() {
|
2015-04-06 20:36:35 -04:00
|
|
|
End();
|
|
|
|
}
|
|
|
|
// vim: ts=2:sw=2:et
|