Calibrate the sensors on the practice bot
Change-Id: I8d44af57778f1b09843ef760a9a357fdd9e11270
diff --git a/y2019/constants.cc b/y2019/constants.cc
index 574f299..ad25fc5 100644
--- a/y2019/constants.cc
+++ b/y2019/constants.cc
@@ -142,17 +142,21 @@
break;
case kPracticeTeamNumber:
- elevator_params->zeroing_constants.measured_absolute_position = 0.0;
- elevator->potentiometer_offset = 0.0;
+ elevator_params->zeroing_constants.measured_absolute_position = 0.049419;
+ elevator->potentiometer_offset = -0.022320;
- intake->zeroing_constants.measured_absolute_position = 0.0;
- intake->zeroing_constants.middle_position = 0.0;
-
- wrist_params->zeroing_constants.measured_absolute_position = 0.0;
- wrist->potentiometer_offset = 0.0;
+ intake->zeroing_constants.measured_absolute_position = 2.303729;
+ intake->zeroing_constants.middle_position =
+ Values::kIntakeRange().middle();
stilts_params->zeroing_constants.measured_absolute_position = 0.0;
stilts->potentiometer_offset = 0.0;
+
+ wrist_params->zeroing_constants.measured_absolute_position = 0.357394;
+ wrist->potentiometer_offset = -1.479097 - 2.740303;
+
+ stilts_params->zeroing_constants.measured_absolute_position = 0.047838;
+ stilts->potentiometer_offset = -0.093820;
break;
case kCodingRobotTeamNumber:
diff --git a/y2019/constants.h b/y2019/constants.h
index 2cffaae..46d28f1 100644
--- a/y2019/constants.h
+++ b/y2019/constants.h
@@ -63,10 +63,10 @@
static constexpr ::frc971::constants::Range kElevatorRange() {
return ::frc971::constants::Range{
- 0.0, // Bottom Hard
- 1.44, // Top Hard
- 0.025, // Bottom Soft
- 1.415 // Top Soft
+ -0.01, // Bottom Hard
+ 1.62, // Top Hard
+ 0.01, // Bottom Soft
+ 1.59 // Top Soft
};
}
@@ -84,10 +84,10 @@
static constexpr ::frc971::constants::Range kIntakeRange() {
return ::frc971::constants::Range{
- -1.15, // Back Hard
- 1.36, // Front Hard
- -1.14, // Back Soft
- 1.22 // Front Soft
+ -1.30, // Back Hard
+ 1.35, // Front Hard
+ -1.25, // Back Soft
+ 1.30 // Front Soft
};
}
@@ -110,7 +110,7 @@
static constexpr ::frc971::constants::Range kWristRange() {
return ::frc971::constants::Range{
-3.14, // Back Hard
- 2.58, // Front Hard
+ 3.14, // Front Hard
-2.97, // Back Soft
2.41 // Front Soft
};
@@ -139,10 +139,10 @@
static constexpr ::frc971::constants::Range kStiltsRange() {
return ::frc971::constants::Range{
- -0.026, // Top Hard
- 0.693, // Bottom Hard
- -0.02, // Top Soft
- 0.673 // Bottom Soft
+ -0.01, // Top Hard
+ 0.72, // Bottom Hard
+ 0.00, // Top Soft
+ 0.71 // Bottom Soft
};
}
diff --git a/y2019/control_loops/drivetrain/drivetrain_base.cc b/y2019/control_loops/drivetrain/drivetrain_base.cc
index 0c34882..71f7cb9 100644
--- a/y2019/control_loops/drivetrain/drivetrain_base.cc
+++ b/y2019/control_loops/drivetrain/drivetrain_base.cc
@@ -26,7 +26,7 @@
::frc971::control_loops::drivetrain::ShifterType::SIMPLE_SHIFTER,
::frc971::control_loops::drivetrain::LoopType::OPEN_LOOP,
::frc971::control_loops::drivetrain::GyroType::IMU_Z_GYRO,
- ::frc971::control_loops::drivetrain::IMUType::IMU_Y,
+ ::frc971::control_loops::drivetrain::IMUType::IMU_X,
drivetrain::MakeDrivetrainLoop,
drivetrain::MakeVelocityDrivetrainLoop,
diff --git a/y2019/control_loops/superstructure/collision_avoidance.h b/y2019/control_loops/superstructure/collision_avoidance.h
index 1ad9582..5a8a772 100644
--- a/y2019/control_loops/superstructure/collision_avoidance.h
+++ b/y2019/control_loops/superstructure/collision_avoidance.h
@@ -53,10 +53,10 @@
// TODO(sabina): set all the numbers to correctly match the robot.
// Height above which we can move the wrist freely.
- static constexpr double kElevatorClearHeight = 0.5;
+ static constexpr double kElevatorClearHeight = 0.35;
// Height above which we can move the wrist down.
- static constexpr double kElevatorClearWristDownHeight = 0.3;
+ static constexpr double kElevatorClearWristDownHeight = 0.25;
// Height the carriage needs to be above to move the intake.
static constexpr double kElevatorClearIntakeHeight = 0.4;
@@ -65,8 +65,8 @@
static constexpr double kWristMinAngle = -M_PI / 2.0;
// Angles outside of which the intake is fully clear of the wrist.
- static constexpr double kIntakeOutAngle = M_PI / 6.0;
- static constexpr double kIntakeInAngle = -M_PI / 3.0;
+ static constexpr double kIntakeOutAngle = 0.3;
+ static constexpr double kIntakeInAngle = -1.1;
// Angles within which we will crash the wrist into the elevator if the
// elevator is below kElevatorClearHeight.
diff --git a/y2019/wpilib_interface.cc b/y2019/wpilib_interface.cc
index a679cf1..cdcedcc 100644
--- a/y2019/wpilib_interface.cc
+++ b/y2019/wpilib_interface.cc
@@ -93,11 +93,11 @@
double elevator_pot_translate(double voltage) {
return voltage * Values::kElevatorPotRatio() *
- (3.0 /*turns*/ / 5.0 /*volts*/) * (2 * M_PI /*radians*/);
+ (10.0 /*turns*/ / 5.0 /*volts*/) * (2 * M_PI /*radians*/);
}
double wrist_pot_translate(double voltage) {
- return voltage * Values::kWristPotRatio() * (10.0 /*turns*/ / 5.0 /*volts*/) *
+ return voltage * Values::kWristPotRatio() * (5.0 /*turns*/ / 5.0 /*volts*/) *
(2 * M_PI /*radians*/);
}