diff --git a/constants.py b/constants.py index a36f48d..9118f6f 100644 --- a/constants.py +++ b/constants.py @@ -78,18 +78,18 @@ class ElevatorConstants: SETPOINT_TOLERANCE = 0.1 class PivotConstants: - INSIDE_ELEVATOR_ANGLE = 0.2 # Used for subsystem collision checking - ELEVATOR_PRIORITY_ANGLE = 0.123535 # We move the pivot to this position until the elevator has reached its setpoint. - STOW_ANGLE = 0.188 - GROUND_INTAKE_ANGLE = -0.119385 - FUNNEL_INTAKE_ANGLE = 0.28 - ALGAE_INTAKE_ANGLE = -0.05 - HIGH_SCORING_ANGLE = 0.21 - MID_SCORING_ANGLE = 0.22 - LOW_SCORING_ANGLE = -0.119385 + INSIDE_ELEVATOR_ANGLE = 0.279297 # Used for subsystem collision checking + ELEVATOR_PRIORITY_ANGLE = 0.241943 # We move the pivot to this position until the elevator has reached its setpoint. + STOW_ANGLE = 0.267334 + GROUND_INTAKE_ANGLE = -0.054688 + FUNNEL_INTAKE_ANGLE = 0.373 + ALGAE_INTAKE_ANGLE = -0.04 + HIGH_SCORING_ANGLE = 0.30 + MID_SCORING_ANGLE = 0.30 + LOW_SCORING_ANGLE = -0.065186 NET_SCORING_ANGLE = 0.131 PROCESSOR_SCORING_ANGLE = 0.001 - CLIMBER_PRIORITY_ANGLE = 0.201943 + CLIMBER_PRIORITY_ANGLE = 0.349365 MINIMUM_ANGLE = -0.091 MAXIMUM_ANGLE = 0.392822 @@ -97,7 +97,7 @@ class PivotConstants: CRUISE_VELOCITY = 3 MM_ACCELERATION = 3 - GEAR_RATIO = 961/36 + GEAR_RATIO = 23/1 GAINS = (Slot0Configs() .with_k_g(0.518) .with_k_p(45) @@ -110,16 +110,16 @@ class PivotConstants: ) CANCODER_DISCONTINUITY = 0.5 - CANCODER_OFFSET = 0.35009765625 + CANCODER_OFFSET = -0.168701171875 SETPOINT_TOLERANCE = 0.03125 class IntakeConstants: - CORAL_INTAKE_SPEED = 0.4*1.2*1.1 - FUNNEL_INTAKE_SPEED = 0.8*0.75 - CORAL_OUTPUT_SPEED = 0.6 - L1_OUTPUT_SPEED = -0.4 + CORAL_INTAKE_SPEED = 1 + FUNNEL_INTAKE_SPEED = 1 + CORAL_OUTPUT_SPEED = 2 + L1_OUTPUT_SPEED = -0.6 ALGAE_HOLD = 0.125 ALGAE_INTAKE_SPEED = 0.75 diff --git a/generated/tuner_constants.py b/generated/tuner_constants.py index 1732673..65b5c48 100644 --- a/generated/tuner_constants.py +++ b/generated/tuner_constants.py @@ -132,7 +132,7 @@ class TunerConstants: _front_left_drive_motor_id = 3 _front_left_steer_motor_id = 7 _front_left_encoder_id = 7 - _front_left_encoder_offset: units.rotation = 0.155029296875 + _front_left_encoder_offset: units.rotation = 0.146240234375 _front_left_steer_motor_inverted = True _front_left_encoder_inverted = False @@ -143,7 +143,7 @@ class TunerConstants: _front_right_drive_motor_id = 1 _front_right_steer_motor_id = 5 _front_right_encoder_id = 5 - _front_right_encoder_offset: units.rotation = -0.27978515625 + _front_right_encoder_offset: units.rotation = -0.282958984375 _front_right_steer_motor_inverted = True _front_right_encoder_inverted = False @@ -154,7 +154,7 @@ class TunerConstants: _back_left_drive_motor_id = 4 _back_left_steer_motor_id = 8 _back_left_encoder_id = 8 - _back_left_encoder_offset: units.rotation = -0.241943359375 + _back_left_encoder_offset: units.rotation = -0.45703125 _back_left_steer_motor_inverted = True _back_left_encoder_inverted = False @@ -165,7 +165,7 @@ class TunerConstants: _back_right_drive_motor_id = 2 _back_right_steer_motor_id = 6 _back_right_encoder_id = 6 - _back_right_encoder_offset: units.rotation = -0.06494140625 + _back_right_encoder_offset: units.rotation = -0.069580078125 _back_right_steer_motor_inverted = True _back_right_encoder_inverted = False diff --git a/pyproject.toml b/pyproject.toml index 70813f0..9921c54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.robotpy] -robotpy_version = "2025.3.2.0" +robotpy_version = "2025.3.2.2" robotpy_extras = [ "apriltag", diff --git a/subsystems/pivot.py b/subsystems/pivot.py index d900b95..1edab66 100644 --- a/subsystems/pivot.py +++ b/subsystems/pivot.py @@ -54,7 +54,7 @@ class SubsystemState(Enum): .with_feedback_sensor_source(FeedbackSensorSourceValue.REMOTE_CANCODER) .with_feedback_remote_sensor_id(Constants.CanIDs.PIVOT_CANCODER) ) - _master_config.motor_output.inverted = InvertedValue.CLOCKWISE_POSITIVE + _master_config.motor_output.inverted = InvertedValue.COUNTER_CLOCKWISE_POSITIVE _master_config.motor_output.neutral_mode = NeutralModeValue.BRAKE _master_config.with_slot0(Constants.PivotConstants.GAINS)