Class ModuleIOSim
java.lang.Object
com.stuypulse.robot.subsystems.swerve.ModuleIOSim
- All Implemented Interfaces:
ModuleIO
Physics sim implementation of module IO. The sim models are configured using a set of module
constants from Phoenix. Simulation is always based on voltage control.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ModuleIO
ModuleIO.ModuleIOInputs -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.wpilib.math.system.DCMotorprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate doubleprivate booleanprivate org.wpilib.math.controller.PIDControllerprivate doubleprivate final org.wpilib.simulation.DCMotorSimprivate static final org.wpilib.math.system.DCMotorprivate static final doubleprivate static final doubleprivate doubleprivate booleanprivate org.wpilib.math.controller.PIDControllerprivate final org.wpilib.simulation.DCMotorSim -
Constructor Summary
ConstructorsConstructorDescriptionModuleIOSim(com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> constants) -
Method Summary
Modifier and TypeMethodDescriptionvoidsetDriveOpenLoop(double output) Run the drive motor at the specified open loop value.voidsetDriveVelocity(double velocityRadPerSec) Run the drive motor at the specified velocity.voidsetTurnOpenLoop(double output) Run the turn motor at the specified open loop value.voidsetTurnPosition(org.wpilib.math.geometry.Rotation2d rotation) Run the turn motor to the specified rotation.voidupdateInputs(ModuleIO.ModuleIOInputs inputs) Updates the set of loggable inputs.
-
Field Details
-
DRIVE_KP
- See Also:
-
DRIVE_KD
- See Also:
-
DRIVE_KS
- See Also:
-
DRIVE_KV_ROT
- See Also:
-
DRIVE_KV
-
TURN_KP
- See Also:
-
TURN_KD
- See Also:
-
DRIVE_GEARBOX
-
TURN_GEARBOX
-
driveSim
-
turnSim
-
driveClosedLoop
-
turnClosedLoop
-
driveController
-
turnController
-
driveFFVolts
-
driveAppliedVolts
-
turnAppliedVolts
-
-
Constructor Details
-
ModuleIOSim
public ModuleIOSim(com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> constants)
-
-
Method Details
-
updateInputs
Description copied from interface:ModuleIOUpdates the set of loggable inputs.- Specified by:
updateInputsin interfaceModuleIO
-
setDriveOpenLoop
Description copied from interface:ModuleIORun the drive motor at the specified open loop value.- Specified by:
setDriveOpenLoopin interfaceModuleIO
-
setTurnOpenLoop
Description copied from interface:ModuleIORun the turn motor at the specified open loop value.- Specified by:
setTurnOpenLoopin interfaceModuleIO
-
setDriveVelocity
Description copied from interface:ModuleIORun the drive motor at the specified velocity.- Specified by:
setDriveVelocityin interfaceModuleIO
-
setTurnPosition
Description copied from interface:ModuleIORun the turn motor to the specified rotation.- Specified by:
setTurnPositionin interfaceModuleIO
-