2015-02-08 16:51:35 -05:00
|
|
|
#include "Turn.h"
|
|
|
|
#include "../../DentRobot.h"
|
2015-07-31 12:52:15 -04:00
|
|
|
Turn::Turn(double timeout): Command("Turn") {
|
2015-02-08 16:51:35 -05:00
|
|
|
Requires(DentRobot::drivetrain);
|
2015-03-07 13:27:11 -05:00
|
|
|
SetTimeout(timeout);
|
2015-02-08 16:51:35 -05:00
|
|
|
}
|
2015-09-19 17:57:42 -04:00
|
|
|
void Turn::Initialize() {}
|
2015-07-31 12:52:15 -04:00
|
|
|
void Turn::Execute() {
|
2015-03-10 20:14:38 -04:00
|
|
|
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle)
|
2015-09-17 15:59:58 -04:00
|
|
|
DentRobot::drivetrain->DriveArcade(0.0, 0.0, 0.6, 0.9);
|
2015-02-08 16:51:35 -05:00
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
bool Turn::IsFinished() {
|
2015-02-08 16:51:35 -05:00
|
|
|
return IsTimedOut();
|
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void Turn::End() {
|
2015-02-13 22:30:15 -05:00
|
|
|
// Stop driving
|
2015-09-17 15:59:58 -04:00
|
|
|
DentRobot::drivetrain->DriveArcade(0.0, 0.0, 0.0, 0.9);
|
2015-02-08 16:51:35 -05:00
|
|
|
}
|
2015-07-31 12:52:15 -04:00
|
|
|
void Turn::Interrupted() {
|
2015-02-08 16:51:35 -05:00
|
|
|
End();
|
|
|
|
}
|
|
|
|
// vim: ts=2:sw=2:et
|