Added constants from pyhton to c++. kSpringConstant and kMaxExtension are in python
diff --git a/frc971/control_loops/shooter/shooter.cc b/frc971/control_loops/shooter/shooter.cc
index 41d6448..9cf563e 100755
--- a/frc971/control_loops/shooter/shooter.cc
+++ b/frc971/control_loops/shooter/shooter.cc
@@ -118,7 +118,8 @@
double ShooterMotor::PowerToPosition(double power) {
// LOG(WARNING, "power to position not correctly implemented\n");
const frc971::constants::Values &values = constants::GetValues();
- double new_pos = ::std::min(::std::max(power, values.shooter.lower_limit),
+ double new_pos = kMaxExtension - sqrt((power + power) / kSpringConstant);
+ new_pos = ::std::min(::std::max(power, values.shooter.lower_limit),
values.shooter.upper_limit);
return new_pos;
}
diff --git a/frc971/control_loops/shooter/shooter_motor_plant.h b/frc971/control_loops/shooter/shooter_motor_plant.h
old mode 100755
new mode 100644
index 968fd04..40a2f25
--- a/frc971/control_loops/shooter/shooter_motor_plant.h
+++ b/frc971/control_loops/shooter/shooter_motor_plant.h
@@ -5,6 +5,10 @@
namespace frc971 {
namespace control_loops {
+static const double kMaxExtension = 0.323850;
+
+static const double kSpringConstant = 0.280000;
+
StateFeedbackPlantCoefficients<3, 1, 1> MakeSprungShooterPlantCoefficients();
diff --git a/frc971/control_loops/shooter/unaugmented_shooter_motor_plant.h b/frc971/control_loops/shooter/unaugmented_shooter_motor_plant.h
old mode 100755
new mode 100644