MotorToPosition

constructor(motor: MotorEx, controller: ControlLoop, target: Int, speed: Double, requirement: Subsystem, protected: Boolean = false, errorThreshold: Int = 30, holdPosition: Boolean = true)


constructor(motor: MotorEx, controller: ControlLoop, target: Int, speed: Double, requirements: List<Subsystem>, protected: Boolean = false, errorThreshold: Int = 30, holdPosition: Boolean = true)

Parameters

motor

the motor to control

controller

the controller to use

target

the target position in ticks

speed

the maximum speed for the motor

requirements

the subsystems involved in the command

protected

whether this command is unable to be stopped by an incoming command with the same subsystem

errorThreshold

the maximum distance from the target position to be considered correct (in ticks)

holdPosition

whether the motor should actively hold its position once it has reached the target