2015-01-17 12:55:51 -05:00
|
|
|
#include "Drive.h"
|
2015-01-17 13:28:27 -05:00
|
|
|
#include <cmath>
|
2015-01-17 12:55:51 -05:00
|
|
|
#include "../DentRobot.h"
|
|
|
|
Drive::Drive() : Command("Drive"){
|
2015-01-18 14:03:41 +00:00
|
|
|
Requires(DentRobot::drivetrain);
|
2015-01-17 12:55:51 -05:00
|
|
|
}
|
|
|
|
void Drive::Initialize(){
|
|
|
|
}
|
|
|
|
void Drive::Execute(){
|
2015-01-17 13:28:27 -05:00
|
|
|
static float sens=0.7;
|
|
|
|
float x, y, twist;
|
|
|
|
x=DentRobot::oi->GetLeftStick()->GetRawAxis(0);
|
|
|
|
y=DentRobot::oi->GetLeftStick()->GetRawAxis(1);
|
|
|
|
twist=DentRobot::oi->GetLeftStick()->GetRawAxis(2);
|
|
|
|
if(true){
|
|
|
|
x=sens*std::pow(x, 3)+(1.0f-sens)*x;
|
|
|
|
y=sens*std::pow(y, 3)+(1.0f-sens)*y;
|
|
|
|
}
|
|
|
|
//DentRobot::drivetrain->DriveMecanum(DentRobot::oi->GetLeftStick()->GetRawAxis(2), DentRobot::oi->GetLeftStick()->GetRawAxis(1), DentRobot::oi->GetLeftStick()->GetRawAxis(0));
|
|
|
|
DentRobot::drivetrain->DriveMecanum(x, y, twist);
|
2015-01-17 12:55:51 -05:00
|
|
|
}
|
|
|
|
bool Drive::IsFinished(){
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
void Drive::End(){
|
|
|
|
}
|
|
|
|
void Drive::Interrupted(){
|
|
|
|
}
|