Mongu

interface Mongu<T : MonguConfig<*>>

Interface for motor control that defines common methods all motors must have.

This interface provides a common abstraction for motor control, allowing different motor types to be used interchangeably while providing type-safe access to their specific features through implementations.

Usage Examples:

// Create a TalonFX motor with direct access to control classes
val motor = TonguFX(1)
motor.configure {
pingu.p = 0.1
inverted = InvertedValue.Clockwise_Positive
}
motor.move(0.5) // Move using configured control

// Direct access to control classes
motor.setControl(motor.positionControl.withPosition(10.0))

Parameters

T

The type of motor configuration used.

Inheritors

Properties

Link copied to clipboard
abstract val configuration: T

The configuration for this motor instance. This property is updated whenever the configure method is called.

Functions

Link copied to clipboard
abstract fun configure(block: T.() -> Unit)

Configures the motor using a DSL-style configuration block.

Link copied to clipboard
abstract fun movePWM(value: Double)

Moves the motor using the default control method.

Link copied to clipboard
abstract operator fun not()

Stops the motor immediately.