Package com.pathplanner.lib.config
Class ModuleConfig
java.lang.Object
com.pathplanner.lib.config.ModuleConfig
Configuration class describing a robot's drive module
-
Field Summary
Modifier and TypeFieldDescriptionfinal double
The current limit of the drive motor, in Ampsfinal DCMotor
The DCMotor representing the drive gearbox, including gear reductionfinal 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 MPSfinal 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
ConstructorDescriptionModuleConfig
(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
-
Field Details
-
wheelRadiusMeters
public final double wheelRadiusMetersWheel radius in meters -
maxDriveVelocityMPS
public final double maxDriveVelocityMPSThe max RPM that the drive motor can reach while actually driving the robot at full output. -
wheelCOF
public final double wheelCOFThe coefficient of friction between the drive wheel and the carpet. -
driveMotor
The DCMotor representing the drive gearbox, including gear reduction -
driveCurrentLimit
public final double driveCurrentLimitThe current limit of the drive motor, in Amps -
maxDriveVelocityRadPerSec
public final double maxDriveVelocityRadPerSecMax drive motor velocity in MPS -
torqueLoss
public final double torqueLossThe 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 reductiondriveCurrentLimit
- The current limit of the drive motor, in AmpsnumMotors
- 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 reductiondriveCurrentLimit
- The current limit of the drive motornumMotors
- The number of motors per module. For swerve, this is 1. For differential, this is usually 2.
-