Class LaunchCalculator.LaunchParameters

java.lang.Object
com.marswars.geometry.LaunchCalculator.LaunchParameters
Enclosing class:
LaunchCalculator

public static class LaunchCalculator.LaunchParameters extends Object
Container for calculated launch parameters

This class contains all the parameters needed to execute a shot, plus diagnostic information.

  • Field Details

    • is_valid

      public final boolean is_valid
      Whether the calculated parameters are valid (within min/max range)
    • heading_angle

      public final Rotation2d heading_angle
      Target heading angle to face the goal

      ACTION 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_velocity
      Angular 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_angle
      Hood angle in radians

      ACTION REQUIRED: Set your hood/pivot mechanism to this angle

    • hood_velocity

      public final double hood_velocity
      Hood angular velocity (rad/s) for feedforward

      ACTION 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_speed
      Flywheel speed in rad/s

      ACTION REQUIRED: Set your flywheel/shooter wheels to this speed

    • distance

      public final double distance
      Calculated 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_lookahead
      Distance 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_flight
      Estimated 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