Class ModuleConfig

java.lang.Object
com.pathplanner.lib.config.ModuleConfig

public class ModuleConfig extends Object
Configuration class describing a robot's drive module
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    The current limit of the drive motor, in Amps
    final DCMotor
    The DCMotor representing the drive gearbox, including gear reduction
    final double
    The max RPM that the drive motor can reach while actually driving the robot at full output.
    final double
    Max drive motor velocity in MPS
    final double
    The amount of motor torque lost while driving.
    final double
    The coefficient of friction between the drive wheel and the carpet.
    final double
    Wheel radius in meters
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModuleConfig(double wheelRadiusMeters, double maxDriveVelocityMPS, double wheelCOF, DCMotor driveMotor, double driveCurrentLimit, int numMotors)
    Configuration of a robot drive module.
    ModuleConfig(edu.wpi.first.units.measure.Distance wheelRadius, edu.wpi.first.units.measure.LinearVelocity maxDriveVelocity, double wheelCOF, DCMotor driveMotor, edu.wpi.first.units.measure.Current driveCurrentLimit, int numMotors)
    Configuration of a robot drive module.
  • Method Summary

    Methods inherited from class java.lang.Object

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

    • wheelRadiusMeters

      public final double wheelRadiusMeters
      Wheel radius in meters
    • maxDriveVelocityMPS

      public final double maxDriveVelocityMPS
      The max RPM that the drive motor can reach while actually driving the robot at full output.
    • wheelCOF

      public final double wheelCOF
      The coefficient of friction between the drive wheel and the carpet.
    • driveMotor

      public final DCMotor driveMotor
      The DCMotor representing the drive gearbox, including gear reduction
    • driveCurrentLimit

      public final double driveCurrentLimit
      The current limit of the drive motor, in Amps
    • maxDriveVelocityRadPerSec

      public final double maxDriveVelocityRadPerSec
      Max drive motor velocity in MPS
    • torqueLoss

      public final double torqueLoss
      The amount of motor torque lost while driving. Calculated by getting the torque of the motor at the motor's max speed under load.
  • Constructor Details

    • ModuleConfig

      public ModuleConfig(double wheelRadiusMeters, double maxDriveVelocityMPS, double wheelCOF, DCMotor driveMotor, double driveCurrentLimit, int numMotors)
      Configuration of a robot drive module. This can either be a swerve module, or one side of a differential drive train.
      Parameters:
      wheelRadiusMeters - Radius of the drive wheels, in meters.
      maxDriveVelocityMPS - The max speed that the drive motor can reach while actually driving the robot at full output, in M/S.
      wheelCOF - The coefficient of friction between the drive wheel and the carpet. If you are unsure, just use a placeholder value of 1.0.
      driveMotor - The DCMotor representing the drive motor gearbox, including gear reduction
      driveCurrentLimit - The current limit of the drive motor, in Amps
      numMotors - The number of motors per module. For swerve, this is 1. For differential, this is usually 2.
    • ModuleConfig

      public ModuleConfig(edu.wpi.first.units.measure.Distance wheelRadius, edu.wpi.first.units.measure.LinearVelocity maxDriveVelocity, double wheelCOF, DCMotor driveMotor, edu.wpi.first.units.measure.Current driveCurrentLimit, int numMotors)
      Configuration of a robot drive module. This can either be a swerve module, or one side of a differential drive train.
      Parameters:
      wheelRadius - Radius of the drive wheels.
      maxDriveVelocity - The max speed that the drive motor can reach while actually driving the robot at full output.
      wheelCOF - The coefficient of friction between the drive wheel and the carpet. If you are unsure, just use a placeholder value of 1.0.
      driveMotor - The DCMotor representing the drive motor gearbox, including gear reduction
      driveCurrentLimit - The current limit of the drive motor
      numMotors - The number of motors per module. For swerve, this is 1. For differential, this is usually 2.