2015-02-08 16:51:35 -05:00
|
|
|
#include "Turn.h"
|
|
|
|
#include "../../DentRobot.h"
|
|
|
|
// Drive for a short while then stop. Just for testing
|
2015-02-21 08:43:19 -05:00
|
|
|
Turn::Turn(int k) : Command("Turn"){
|
2015-02-08 16:51:35 -05:00
|
|
|
Requires(DentRobot::drivetrain);
|
2015-02-27 09:51:02 -05:00
|
|
|
SetTimeout(k);
|
2015-02-08 16:51:35 -05:00
|
|
|
}
|
|
|
|
void Turn::Initialize(){
|
|
|
|
}
|
|
|
|
void Turn::Execute(){
|
|
|
|
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle), gyro
|
2015-02-27 09:51:02 -05:00
|
|
|
DentRobot::drivetrain->DriveMecanum(0.0,0.0,0.65,0.9,0.0);
|
2015-02-08 16:51:35 -05:00
|
|
|
}
|
|
|
|
bool Turn::IsFinished(){
|
|
|
|
return IsTimedOut();
|
|
|
|
}
|
|
|
|
void Turn::End(){
|
2015-02-13 22:30:15 -05:00
|
|
|
// Stop driving
|
|
|
|
DentRobot::drivetrain->DriveMecanum(0.0,0.0,0.0,0.9,0.0);
|
2015-02-08 16:51:35 -05:00
|
|
|
}
|
|
|
|
void Turn::Interrupted(){
|
|
|
|
End();
|
|
|
|
}
|
|
|
|
// vim: ts=2:sw=2:et
|