Skip to content

SmartProfile

Used to store multiple gains and configuration values for several different types of controllers. This can optionally interface with NetworkTables so that the gains may be dynamically updated without needing to redeploy code. This class has several helper methods which can be used to create SmartController objects already supplied with the necessary gains. Please note that gains will NOT be dynamically updated in SmartController objects: therefore it is recommended to create a new SmartController object on enable.

Creates a SmartProfile. Recommended gain keys (for use with SmartController): kP: Proportional Gain kI: Integral Gain kD: Derivative Gain kS: Static Gain kV: Velocity Gain kG: Gravity Gain kA: Acceleration Gain kMinInput: Minimum expected measurement value (used for continuous input) kMaxInput: Maximum expected measurement value (used for continuous input)

Q1, Q2, Q3: State weighting for LTV controllers R1, R2: Input weighting for LTV controllers

:param str profile_key: Prefix for associated NetworkTables keys :param dict[str, float] gains: Dictionary containing gain_key: value pairs :param bool tuning_enabled: Specify whether or not to send and retrieve data from NetworkTables. If true, values from NetworkTables are given precedence over values set in code.

Creates a PID controller. Requires kP, kI, kD, [kMinInput, kMaxInput optional]

Creates a wpilib PIDController. Use create_pid_controller() instead if possible. Requires kP, kI, kD, [kMinInput, kMaxInput optional]

Creates a CTRE PIDController. Use create_pid_controller() instead if possible.

Creates a CTRE PIDController. Use create_pid_controller() instead if possible. Requires kP,kI,kD,kS,kV,kMaxV,kMaxA

Creates a CTRE PIDController. Use create_pid_controller() instead if possible. Requires kP,kI,kD,kS,kG,kV,kMaxV,kMaxA

Creates a CTRE PIDController. Use create_pid_controller() instead if possible. Requires kP,kI,kD,kS,kG,kV,kMaxV,kMaxA

Creates a CTRE PIDController. Use create_pid_controller() instead if possible. Requires kP, kI, kD,kS, kV,kA

Creates a profiled PID controller. Requires kP, kI, kD, kMaxV, kMaxA, [kMinInput, kMaxInput optional]

create_wpi_profiled_pid_controller_radians()

Section titled “create_wpi_profiled_pid_controller_radians()”

Creates a wpilib ProfiledPIDControllerRadians. Requires kP, kI, kD, kMaxV, kMaxA, kMinInput, kMaxInput

Creates a wpilib LTVUnicycleController. Optional Q1, Q2, Q3 (max desired x, y, heading error) and R1, R2 (max desired linear, angular velocity effort). If any are missing, wpilib’s default tolerances are used. plant and trackwidth are unused and kept for compatibility.

Creates a simple DC motor feedforward controller. Requires kS, kV, [kA optional]

Creates a PID controller combined with a DC motor feedforward controller. Requires kP, kI, kD, kS, kV, [kA optional]

Creates a profiled PID controller combined with a DC motor feedforward controller. Requires kP, kI, kD, kS, kV, [kA, kMinInput, kMaxInput optional]

Creates a profiled PID controller combined with an elevator feedforward controller. Requires kP, kI, kD, kS, kV, kG, [kA optional]

Creates a profiled PID controller combined with an arm feedforward controller. Requires kP, kI, kD, kS, kV, kG, [kA optional], kMaxV, kMaxA