Add 2022 joystick reader
Change-Id: I20a502c46a19c9b2e4170db3847eed740901e490
Signed-off-by: Henry Speiser <henry@speiser.net>
Signed-off-by: Milind Upadhyay <milind.upadhyay@gmail.com>
Signed-off-by: Ravago Jones <ravagojones@gmail.com>
diff --git a/y2022/constants.h b/y2022/constants.h
index 2c29950..460cde3 100644
--- a/y2022/constants.h
+++ b/y2022/constants.h
@@ -48,6 +48,9 @@
return 22 * 0.25 * 0.0254;
}
static constexpr double kClimberPotRatio() { return 1.0; }
+ // TODO(milind): figure this out
+ // Climber position when it's comfortably above the mid rung.
+ static constexpr double kClimberMidRungHeight() { return 1.0; }
struct PotConstants {
::frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystemParams<
@@ -94,6 +97,12 @@
};
}
+ // When the intake is atleast this much out, always spin the rollers
+ static constexpr double kIntakeSlightlyOutPosition() {
+ return kIntakeRange().middle();
+ }
+ static constexpr double kIntakeOutPosition() { return 1.24; }
+
// Intake rollers
static constexpr double kIntakeRollerSupplyCurrentLimit() { return 40.0; }
static constexpr double kIntakeRollerStatorCurrentLimit() { return 60.0; }
@@ -111,6 +120,10 @@
static constexpr double kTransferRollerBackWiggleVoltage() {
return -kTransferRollerFrontWiggleVoltage();
}
+ // Minimum roller speed when the intake is slightly out
+ static constexpr double kMinIntakeSlightlyOutRollerSpeed() { return 6.0; }
+ // Roller speeds when intake is out
+ static constexpr double kIntakeOutRollerSpeed() { return 7.0; }
// Turret
PotAndAbsEncoderConstants turret;
@@ -194,6 +207,9 @@
static constexpr double kCatapultEncoderCountsPerRevolution() {
return 4096.0;
}
+ static constexpr double kDefaultCatapultShotPosition() { return 3.0; }
+ static constexpr double kDefaultCatapultShotVelocity() { return 3.0; }
+ static constexpr double kCatapultReturnPosition() { return -0.85; }
static constexpr double kMaxCatapultEncoderPulsesPerSecond() {
return control_loops::superstructure::catapult::kFreeSpeed / (2.0 * M_PI) *