Mongu
A generic motor wrapper class that allows configuration of different motor types.
The control type is locked at initialization and cannot be changed during runtime. This ensures type safety and prevents accidental control type switching.
Usage Examples:
// Create a motor with PWM control
val motor = Mongu(TalonFX(1), control = ControlType.PWM)
motor.move(0.5) // 50% forward
// Create a motor with position control
val posMotor = Mongu(TalonFX(2), control = ControlType.POSITION) {
this as TalonFXConfig
pingu.p = 0.1
}
posMotor.move(10.0) // move to position 10
Parameters
The type of motor being wrapped.
A lambda that applies configuration settings to the motor.
A lambda that applies configuration settings to the encoder.
Constructors
Properties
Retrieves the current acceleration of the TalonFX motor.
Holds the last configuration applied to this motor. This property is updated whenever the configure method is called. It allows retrieval of the configuration settings for inspection or reuse.
The control type that this motor is locked to.
Indicates whether the TalonFX motor is currently connected.
Retrieves the stall current of the TalonFX motor.
Retrieves the motor voltage of the TalonFX motor.
Retrieves the custom pingu
property from the TalonFXConfig configuration.
Retrieves the rotor position of the TalonFX motor.
Retrieves the rotor velocity of the TalonFX motor.
Retrieves the stator current of the TalonFX motor.
Retrieves the supply current of the TalonFX motor.
Retrieves the supply voltage of the TalonFX motor.