mirror of
https://github.com/team2059/Dent
synced 2025-01-07 22:14:14 -05:00
Changeable gyro kP (untested)
This commit is contained in:
parent
49ad9dac39
commit
d06f436f11
@ -35,7 +35,6 @@ void DentRobot::RobotInit(){
|
|||||||
SmartDashboard::PutNumber("Auto Tote Distance", 0.5);
|
SmartDashboard::PutNumber("Auto Tote Distance", 0.5);
|
||||||
SmartDashboard::PutNumber("Auto Bin Distance", 0.25);
|
SmartDashboard::PutNumber("Auto Bin Distance", 0.25);
|
||||||
SmartDashboard::PutNumber("TurnAmount", 1.8);
|
SmartDashboard::PutNumber("TurnAmount", 1.8);
|
||||||
|
|
||||||
// Elevators
|
// Elevators
|
||||||
SmartDashboard::PutBoolean("Bin Elevator Bottom", false);
|
SmartDashboard::PutBoolean("Bin Elevator Bottom", false);
|
||||||
SmartDashboard::PutBoolean("Bin Elevator Top", false);
|
SmartDashboard::PutBoolean("Bin Elevator Top", false);
|
||||||
@ -43,6 +42,8 @@ void DentRobot::RobotInit(){
|
|||||||
SmartDashboard::PutBoolean("Elevator Top", false);
|
SmartDashboard::PutBoolean("Elevator Top", false);
|
||||||
//Drive speed
|
//Drive speed
|
||||||
SmartDashboard::PutNumber("DriveSpeedReductionThresh", 2.0);
|
SmartDashboard::PutNumber("DriveSpeedReductionThresh", 2.0);
|
||||||
|
//Gyro
|
||||||
|
SmartDashboard::PutNumber("Gyro kP", 0.02);
|
||||||
}
|
}
|
||||||
void DentRobot::DisabledPeriodic(){
|
void DentRobot::DisabledPeriodic(){
|
||||||
Scheduler::GetInstance()->Run();
|
Scheduler::GetInstance()->Run();
|
||||||
|
@ -14,7 +14,7 @@ void Drivetrain::InitDefaultCommand(){
|
|||||||
}
|
}
|
||||||
void Drivetrain::DriveMecanum(double x, double y, double z, double sensitivity, bool driveStraight){
|
void Drivetrain::DriveMecanum(double x, double y, double z, double sensitivity, bool driveStraight){
|
||||||
//TODO: Find the correct value for kP
|
//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 correctX = -(sensitivity*(pow(x, 3))+(1-sensitivity)*x);
|
||||||
double correctY = -(sensitivity*(pow(y, 3))+(1-sensitivity)*y);
|
double correctY = -(sensitivity*(pow(y, 3))+(1-sensitivity)*y);
|
||||||
double correctZ;
|
double correctZ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user