Class PIDConstants

java.lang.Object
frc.robot.util.tunable.PIDConstants
All Implemented Interfaces:
Tunable, Cloneable, org.littletonrobotics.junction.inputs.LoggableInputs

public class PIDConstants extends Object implements org.littletonrobotics.junction.inputs.LoggableInputs, Cloneable, Tunable
Tunable constants for PID controllers
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
     
    double
     
    double
     
    double
     
    double
     
    double
     
    double
     
    double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PIDConstants(String name, com.ctre.phoenix6.signals.GravityTypeValue gravityType, double kP, double kI, double kD, double kV, double kS, double kG, double kA)
    Create new PID Constants
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(com.ctre.phoenix6.configs.Slot0Configs config)
    Write PID constants to TalonFX
     
    void
    fromLog(org.littletonrobotics.junction.LogTable table)
     
    void
    Run function with constants if they've changed.
    void
    toLog(org.littletonrobotics.junction.LogTable table)
     

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • kP

      public double kP
    • kD

      public double kD
    • kI

      public double kI
    • kV

      public double kV
    • kS

      public double kS
    • kG

      public double kG
    • kA

      public double kA
    • isArm

      public boolean isArm
  • Constructor Details

    • PIDConstants

      public PIDConstants(String name, com.ctre.phoenix6.signals.GravityTypeValue gravityType, double kP, double kI, double kD, double kV, double kS, double kG, double kA)
      Create new PID Constants
  • Method Details

    • apply

      public void apply(com.ctre.phoenix6.configs.Slot0Configs config)
      Write PID constants to TalonFX
    • ifDirty

      public void ifDirty(Consumer<PIDConstants> consumer)
      Run function with constants if they've changed.
    • toLog

      public void toLog(org.littletonrobotics.junction.LogTable table)
      Specified by:
      toLog in interface org.littletonrobotics.junction.inputs.LoggableInputs
    • fromLog

      public void fromLog(org.littletonrobotics.junction.LogTable table)
      Specified by:
      fromLog in interface org.littletonrobotics.junction.inputs.LoggableInputs
    • clone

      public PIDConstants clone()
      Overrides:
      clone in class Object