mirror of
https://github.com/team2059/Dent
synced 2025-01-17 22:19:21 -05:00
fixed warnings
This commit is contained in:
parent
8930aaf23d
commit
a53f4ef5ff
@ -11,16 +11,7 @@ void Drivetrain::InitDefaultCommand() {
|
|||||||
SetDefaultCommand(new Drive());
|
SetDefaultCommand(new Drive());
|
||||||
}
|
}
|
||||||
void Drivetrain::DriveArcade(double x, double y, double z, double sensitivity, bool driveStraight) {
|
void Drivetrain::DriveArcade(double x, double y, double z, double sensitivity, bool driveStraight) {
|
||||||
double kP = SmartDashboard::GetNumber("Gyro kP");
|
//TODO add encoder support for driving straight
|
||||||
double correctX = -(sensitivity*(pow(x, 3))+(1-sensitivity)*x);
|
|
||||||
double correctY = (sensitivity*(pow(y, 3))+(1-sensitivity)*y);
|
|
||||||
double correctZ = z;
|
|
||||||
if(driveStraight) {
|
|
||||||
printf("Driving straight at: %f\n", -gyro->GetAngle()*kP);
|
|
||||||
correctZ = -gyro->GetAngle()*kP;
|
|
||||||
} else {
|
|
||||||
correctZ = -z * 0.5;
|
|
||||||
}
|
|
||||||
leftRear->Set(-y+(x+z));
|
leftRear->Set(-y+(x+z));
|
||||||
rightRear->Set(y+(x+z));
|
rightRear->Set(y+(x+z));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user