Class TunablePid

java.lang.Object
com.marswars.util.TunablePid

public class TunablePid extends Object
  • Method Details

    • create

      public static void create(String key, Consumer<SlotConfigs> config_applier, SlotConfigs config)
      Creates tunable PID parameters for CTRE Phoenix 6 SlotConfigs. Publishes kP, kI, kD, kS, kV, kA, and kG to NetworkTables for live tuning.
      Parameters:
      key - The NetworkTables key prefix for the PID parameters
      config_applier - Consumer that applies the updated configuration to the motor
      config - The initial SlotConfigs to use as default values
    • create

      public static void create(String key, PIDController controller)
      Creates tunable PID parameters for a single WPILib PIDController. Publishes kP, kI, and kD to NetworkTables for live tuning.
      Parameters:
      key - The NetworkTables key prefix for the PID parameters
      controller - The PIDController to tune
    • create

      public static void create(String key, PIDController... controllers)
      Creates tunable PID parameters for multiple synchronized WPILib PIDControllers. All controllers will be updated together when any parameter changes. Publishes kP, kI, and kD to NetworkTables for live tuning.
      Parameters:
      key - The NetworkTables key prefix for the PID parameters
      controllers - Variable number of PIDControllers to tune together
    • create

      public static void create(String key, PhoenixPIDController controller)
      Creates tunable PID parameters for a Phoenix PIDController (used in swerve). Publishes kP, kI, and kD to NetworkTables for live tuning.
      Parameters:
      key - The NetworkTables key prefix for the PID parameters
      controller - The PhoenixPIDController to tune