Removed redundant turn_width.
Change-Id: I68d70930c3d25afa05d00e381b73cd34bdfe6f33
diff --git a/frc971/control_loops/drivetrain/drivetrain_config.h b/frc971/control_loops/drivetrain/drivetrain_config.h
index dda65bd..a2d9fdd 100644
--- a/frc971/control_loops/drivetrain/drivetrain_config.h
+++ b/frc971/control_loops/drivetrain/drivetrain_config.h
@@ -37,7 +37,6 @@
double v; // Motor velocity constant.
double t; // Torque constant.
- double turn_width; // Robot turn width, in meters.
// Gear ratios, from wheel to motor shaft.
double high_gear_ratio;
double low_gear_ratio;
diff --git a/frc971/control_loops/drivetrain/drivetrain_lib_test.cc b/frc971/control_loops/drivetrain/drivetrain_lib_test.cc
index 9d7e223..9d3e6c6 100644
--- a/frc971/control_loops/drivetrain/drivetrain_lib_test.cc
+++ b/frc971/control_loops/drivetrain/drivetrain_lib_test.cc
@@ -47,7 +47,6 @@
::y2014::control_loops::drivetrain::kV,
::y2014::control_loops::drivetrain::kT,
- ::y2014::constants::GetValuesForTeam(971).turn_width,
::y2014::constants::GetValuesForTeam(971).high_gear_ratio,
::y2014::constants::GetValuesForTeam(971).low_gear_ratio,
::y2014::constants::GetValuesForTeam(971).left_drive,
diff --git a/frc971/control_loops/drivetrain/ssdrivetrain.cc b/frc971/control_loops/drivetrain/ssdrivetrain.cc
index 9fdfe1c..19bbef1 100644
--- a/frc971/control_loops/drivetrain/ssdrivetrain.cc
+++ b/frc971/control_loops/drivetrain/ssdrivetrain.cc
@@ -139,8 +139,7 @@
}
void DrivetrainMotorsSS::SetPosition(double left, double right, double gyro) {
// Decay the offset quickly because this gyro is great.
- const double offset =
- (right - left - gyro * dt_config_.turn_width) / 2.0;
+ const double offset = (right - left) / 2.0 - gyro * dt_config_.robot_radius;
filtered_offset_ = 0.25 * offset + 0.75 * filtered_offset_;
gyro_ = gyro;
SetRawPosition(left, right);