Class LaunchCalculator.LaunchParameters
- Enclosing class:
- LaunchCalculator
This class contains all the parameters needed to execute a shot, plus diagnostic information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal doubleCalculated distance to target with lookahead (meters)final doubleDistance to target without motion compensation (meters)final doubleFlywheel speed in rad/sfinal Rotation2dTarget heading angle to face the goalfinal doubleAngular velocity for the heading mechanism (rad/s)final doubleHood angle in radiansfinal doubleHood angular velocity (rad/s) for feedforwardfinal booleanWhether the calculated parameters are valid (within min/max range)final doubleEstimated time of flight (seconds) -
Constructor Summary
ConstructorsConstructorDescriptionLaunchParameters(boolean is_valid, Rotation2d heading_angle, double heading_velocity, double hood_angle, double hood_velocity, double flywheel_speed, double distance, double distance_no_lookahead, double time_of_flight) -
Method Summary
Modifier and TypeMethodDescriptioninvalid()Creates an invalid parameter set (for when target is out of range)
-
Field Details
-
is_valid
public final boolean is_validWhether the calculated parameters are valid (within min/max range) -
heading_angle
Target heading angle to face the goalACTION REQUIRED: Set your heading mechanism's rotation setpoint to this angle. This could be:
- Robot rotation (swerve/tank drive)
- Turret rotation (if you have a turret)
- Both (robot rotation + turret for fine adjustment)
-
heading_velocity
public final double heading_velocityAngular velocity for the heading mechanism (rad/s)ACTION REQUIRED: Use this for feedforward in your heading controller (robot rotation or turret rotation) to improve tracking performance when moving
-
hood_angle
public final double hood_angleHood angle in radiansACTION REQUIRED: Set your hood/pivot mechanism to this angle
-
hood_velocity
public final double hood_velocityHood angular velocity (rad/s) for feedforwardACTION REQUIRED: Use this for feedforward in your hood controller to improve tracking when the shot distance is changing rapidly
-
flywheel_speed
public final double flywheel_speedFlywheel speed in rad/sACTION REQUIRED: Set your flywheel/shooter wheels to this speed
-
distance
public final double distanceCalculated distance to target with lookahead (meters)DIAGNOSTIC ONLY: This is the distance used for map lookups after accounting for motion compensation. Useful for logging and debugging.
-
distance_no_lookahead
public final double distance_no_lookaheadDistance to target without motion compensation (meters)DIAGNOSTIC ONLY: This is the direct distance from launcher to target. Useful for comparing against the compensated distance to see how much the motion compensation adjusted the shot.
-
time_of_flight
public final double time_of_flightEstimated time of flight (seconds)DIAGNOSTIC ONLY: How long the projectile will be in the air. Can be useful for visualization or for timing follow-up actions.
-
-
Constructor Details
-
LaunchParameters
public LaunchParameters(boolean is_valid, Rotation2d heading_angle, double heading_velocity, double hood_angle, double hood_velocity, double flywheel_speed, double distance, double distance_no_lookahead, double time_of_flight)
-
-
Method Details
-
invalid
Creates an invalid parameter set (for when target is out of range)
-