Added intake joint constants
Change-Id: I4ed4d27fb334c9cd5e5a8959a0bb708252bbc05d
diff --git a/y2020/constants.h b/y2020/constants.h
index 47b8543..69e7f28 100644
--- a/y2020/constants.h
+++ b/y2020/constants.h
@@ -11,6 +11,7 @@
#include "frc971/control_loops/static_zeroing_single_dof_profiled_subsystem.h"
#include "y2020/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
#include "y2020/control_loops/superstructure/hood/hood_plant.h"
+#include "y2020/control_loops/superstructure/intake/intake_plant.h"
namespace y2020 {
namespace constants {
@@ -33,7 +34,7 @@
// Hood
static constexpr double kHoodEncoderCountsPerRevolution() { return 4096.0; }
- //TODO(sabina): Update constants
+ // TODO(sabina): Update constants
static constexpr double kHoodEncoderRatio() { return 1.0; }
static constexpr double kMaxHoodEncoderPulsesPerSecond() {
@@ -52,17 +53,42 @@
};
}
+ // Intake
+ static constexpr double kIntakeEncoderCountsPerRevolution() { return 4096.0; }
+
+ static constexpr double kIntakeEncoderRatio() { return (16.0 / 32.0); }
+
+ static constexpr double kMaxIntakeEncoderPulsesPerSecond() {
+ return control_loops::superstructure::intake::kFreeSpeed *
+ control_loops::superstructure::intake::kOutputRatio /
+ kIntakeEncoderRatio() / (2.0 * M_PI) *
+ kIntakeEncoderCountsPerRevolution();
+ }
+
+ // TODO(sabina): update range
+ static constexpr ::frc971::constants::Range kIntakeRange() {
+ return ::frc971::constants::Range{
+ -1, // Back Hard
+ 1, // Front Hard
+ -0.95, // Back Soft
+ 0.95 // Front Soft
+ };
+ }
+
::frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystemParams<
::frc971::zeroing::AbsoluteEncoderZeroingEstimator>
hood;
+ ::frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystemParams<
+ ::frc971::zeroing::AbsoluteEncoderZeroingEstimator>
+ intake;
};
// Creates (once) a Values instance for ::aos::network::GetTeamNumber() and
// returns a reference to it.
const Values &GetValues();
-// Creates Values instances for each team number it is called with and returns
-// them.
+// Creates Values instances for each team number it is called with and
+// returns them.
const Values &GetValuesForTeam(uint16_t team_number);
} // namespace constants