2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00

Changeable gyro kP (untested)

This commit is contained in:
Austen Adler 2015-03-13 19:47:37 -04:00
parent 49ad9dac39
commit d06f436f11
2 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,6 @@ void DentRobot::RobotInit(){
SmartDashboard::PutNumber("Auto Tote Distance", 0.5);
SmartDashboard::PutNumber("Auto Bin Distance", 0.25);
SmartDashboard::PutNumber("TurnAmount", 1.8);
// Elevators
SmartDashboard::PutBoolean("Bin Elevator Bottom", false);
SmartDashboard::PutBoolean("Bin Elevator Top", false);
@ -43,6 +42,8 @@ void DentRobot::RobotInit(){
SmartDashboard::PutBoolean("Elevator Top", false);
//Drive speed
SmartDashboard::PutNumber("DriveSpeedReductionThresh", 2.0);
//Gyro
SmartDashboard::PutNumber("Gyro kP", 0.02);
}
void DentRobot::DisabledPeriodic(){
Scheduler::GetInstance()->Run();

View File

@ -14,7 +14,7 @@ void Drivetrain::InitDefaultCommand(){
}
void Drivetrain::DriveMecanum(double x, double y, double z, double sensitivity, bool driveStraight){
//TODO: Find the correct value for kP
double kP=0.02;
double kP=SmartDashboard::GetNumber("Gyro kP");
double correctX = -(sensitivity*(pow(x, 3))+(1-sensitivity)*x);
double correctY = -(sensitivity*(pow(y, 3))+(1-sensitivity)*y);
double correctZ;