Skip to content

Config

pathplannerlib Index / Pathplannerlib / Config

Auto-generated documentation for pathplannerlib.config module.

ModuleConfig

Show source in config.py:31

Signature

class ModuleConfig:
    def __init__(
        self,
        wheelRadiusMeters: float,
        maxDriveVelocityMPS: float,
        wheelCOF: float,
        driveMotor: DCMotor,
        driveCurrentLimit: float,
        numMotors: int,
    ): ...

PIDConstants

Show source in config.py:15

PID constants used to create PID controllers

Arguments

  • kP float - P
  • kI float - I
  • kD float - D
  • iZone float - Integral range

Signature

class PIDConstants: ...

RobotConfig

Show source in config.py:65

Signature

class RobotConfig:
    def __init__(
        self,
        massKG: float,
        MOI: float,
        moduleConfig: ModuleConfig,
        moduleOffsets: List[Translation2d] = None,
        trackwidthMeters: float = None,
    ): ...

See also

RobotConfig().chassisForcesToWheelForceVectors

Show source in config.py:161

Convert chassis forces (passed as ChassisSpeeds) to individual wheel force vectors

Arguments

  • chassisForces - The linear X/Y force and torque acting on the whole robot

Returns

List of individual wheel force vectors

Signature

def chassisForcesToWheelForceVectors(
    self, chassisForces: ChassisSpeeds
) -> List[Translation2d]: ...

RobotConfig.fromGUISettings

Show source in config.py:183

Load the robot config from the shared settings file created by the GUI

Returns

RobotConfig matching the robot settings in the GUI

Signature

@staticmethod
def fromGUISettings() -> "RobotConfig": ...

RobotConfig().toChassisSpeeds

Show source in config.py:147

Convert a list of swerve module states to robot-relative chassis speeds. This will use differential kinematics for diff drive robots.

Arguments

  • states - List of swerve module states

Returns

Robot-relative chassis speeds

Signature

def toChassisSpeeds(self, states: List[SwerveModuleState]) -> ChassisSpeeds: ...

RobotConfig().toSwerveModuleStates

Show source in config.py:130

Convert robot-relative chassis speeds to a list of swerve module states. This will use differential kinematics for diff drive robots, then convert the wheel speeds to module states.

Arguments

  • speeds - Robot-relative chassis speeds

Returns

List of swerve module states

Signature

def toSwerveModuleStates(self, speeds: ChassisSpeeds) -> List[SwerveModuleState]: ...