Package frc.robot.subsystems.shooter
Class ShooterConstants
java.lang.Object
frc.robot.subsystems.shooter.ShooterConstants
Physical constants and hardware configurations for the shooter subsystem.
Includes data on the game piece, actuator geometry, gear ratios, and motor controller settings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AngularVelocityAllowed velocity error before the shooter is considered "ready".static final intCAN ID for the flywheel motor controller.static final DistanceLength of the cranking arm in the hood mechanism.static final AngleOffset angle between the crank tangent and the actual launch angle.static final Shooter.ShooterStateDefault shooter state with zero velocity and angle.static final TimeEstimated time of flight for the game piece from shooter to target.static final doubleConverts motor rotations to mechanism radians.static final doubleConverts motor RPM to mechanism rad/s.static final booleanWhether the flywheel motor is inverted.static final doubleAcceleration feedforward gain for the flywheel.static final doubleDerivative gain for flywheel velocity control.static final doubleIntegral gain for flywheel velocity control.static final doubleProportional gain for flywheel velocity control.static final doubleStatic friction feedforward gain for the flywheel.static final doubleVelocity feedforward gain for the flywheel.static final DCMotorMotor model for the flywheel (Neo Vortex driven by SparkFlex).static final DistanceDistance between the pivot points of the hood linkage.static final DistanceTolerance for the hood servo actuator length.static final AngleTotal angular range of the hood mechanism.static final Shooter.ShooterStatePreset shooter state for lobbing game pieces into the coral station.static final LinearVelocityMaximum linear speed of the hood servo actuator.static final MomentOfInertiaMoment of inertia of the flywheel assembly.static final CurrentMaximum current limit for the flywheel motor.static final doubleGear reduction ratio for the flywheel (motor to wheel).static final intPWM channel for the hood servo motor.static final DistanceMaximum physical length of the hood servo actuator.static final DistanceMinimum physical length of the hood servo actuator.static final Translation2dPosition of the shooter on the robot relative to the robot center (robot-frame).static final DistanceRadius of the flywheel driving wheel. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CAN_ID
public static final int CAN_IDCAN ID for the flywheel motor controller.- See Also:
-
SERVO_CHANNEL
public static final int SERVO_CHANNELPWM channel for the hood servo motor.- See Also:
-
FLYWHEEL_INVERTED
public static final boolean FLYWHEEL_INVERTEDWhether the flywheel motor is inverted.- See Also:
-
CRANK_ARM_LENGTH
Length of the cranking arm in the hood mechanism. -
GROUND_LINK_DISTANCE
Distance between the pivot points of the hood linkage. -
CRANK_TANGENT_TO_LAUNCH_ANGLE
Offset angle between the crank tangent and the actual launch angle. -
HOOD_TOTAL_ANGLE
Total angular range of the hood mechanism. -
SERVO_MIN_LENGTH
Minimum physical length of the hood servo actuator. -
SERVO_MAX_LENGTH
Maximum physical length of the hood servo actuator. -
MAX_SERVO_VELOCITY
Maximum linear speed of the hood servo actuator. -
HOOD_LENGTH_TOLERANCE
Tolerance for the hood servo actuator length. -
GEARBOX
Motor model for the flywheel (Neo Vortex driven by SparkFlex). -
REDUCTION
public static final double REDUCTIONGear reduction ratio for the flywheel (motor to wheel).- See Also:
-
MOI
Moment of inertia of the flywheel assembly. -
WHEEL_RADIUS
Radius of the flywheel driving wheel. -
ANGULAR_TOLERANCE
Allowed velocity error before the shooter is considered "ready". -
MOTOR_CURRENT_LIMIT
Maximum current limit for the flywheel motor. -
FLYWHEEL_ENCODER_POSITION_FACTOR
public static final double FLYWHEEL_ENCODER_POSITION_FACTORConverts motor rotations to mechanism radians.- See Also:
-
FLYWHEEL_ENCODER_VELOCITY_FACTOR
public static final double FLYWHEEL_ENCODER_VELOCITY_FACTORConverts motor RPM to mechanism rad/s.- See Also:
-
FLYWHEEL_KP
public static final double FLYWHEEL_KPProportional gain for flywheel velocity control.- See Also:
-
FLYWHEEL_KI
public static final double FLYWHEEL_KIIntegral gain for flywheel velocity control.- See Also:
-
FLYWHEEL_KD
public static final double FLYWHEEL_KDDerivative gain for flywheel velocity control.- See Also:
-
FLYWHEEL_KS
public static final double FLYWHEEL_KSStatic friction feedforward gain for the flywheel.- See Also:
-
FLYWHEEL_KV
public static final double FLYWHEEL_KVVelocity feedforward gain for the flywheel.- See Also:
-
FLYWHEEL_KA
public static final double FLYWHEEL_KAAcceleration feedforward gain for the flywheel.- See Also:
-
LOB_STATE
Preset shooter state for lobbing game pieces into the coral station. -
DEFAULT_STATE
Default shooter state with zero velocity and angle. -
ESTIMATED_TOF
Estimated time of flight for the game piece from shooter to target. -
SHOOTER_ROBOT_OFFSET
Position of the shooter on the robot relative to the robot center (robot-frame). X is forward, Y is left.
-
-
Constructor Details
-
ShooterConstants
public ShooterConstants()
-