2015-04-06 20:36:35 -04:00
|
|
|
#include "BinOut.h"
|
|
|
|
#include "../../DentRobot.h"
|
|
|
|
#include "../../OI.h"
|
2015-07-31 12:52:15 -04:00
|
|
|
BinOut::BinOut(double timeout): Command("BinOut") {
|
2015-04-06 20:36:35 -04:00
|
|
|
SetTimeout(timeout);
|
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void BinOut::Initialize() {
|
2015-04-06 20:36:35 -04:00
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void BinOut::Execute() {
|
2015-04-18 05:03:06 -04:00
|
|
|
DentRobot::binCollector->MoveArms(-0.1);
|
2015-04-06 20:36:35 -04:00
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
bool BinOut::IsFinished() {
|
|
|
|
if(IsTimedOut()) {
|
2015-04-18 05:03:06 -04:00
|
|
|
printf("Robot stopped ejecting 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 BinOut::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 BinOut::Interrupted() {
|
2015-04-06 20:36:35 -04:00
|
|
|
End();
|
|
|
|
}
|
|
|
|
// vim: ts=2:sw=2:et
|