MotorToVelocity
class MotorToVelocity(val motor: DcMotorEx, val targetVelocity: Double, val controller: PIDFController, val subsystems: Set<Subsystem>, val outCondition: () -> Boolean = { abs(motor.velocity)-targetVelocity < 10 }) : Command
Deprecated
Deprecated in favor of controllables
Replace with
RunToVelocity
Content copied to clipboard
This implements a PID controller to drive a motor to a specified target velocity.
Parameters
motor
the motor to control
targetVelocity
the target velocity
controller
the controller to implement
subsystems
the list of subsystems this command interacts with (should be whatever subsystem holds this command)
outCondition
will be evaluated every update, and the command will stop once it returns true
Constructors
Link copied to clipboard
constructor(motor: DcMotorEx, targetVelocity: Double, controller: PIDFController, subsystem: Subsystem, outCondition: () -> Boolean = { abs(motor.velocity)-targetVelocity < 10 })
constructor(motor: DcMotorEx, targetVelocity: Double, controller: PIDFController, subsystems: Set<Subsystem>)
constructor(motor: DcMotorEx, targetVelocity: Double, controller: PIDFController, subsystem: Subsystem)
constructor(motor: DcMotorEx, targetVelocity: Double, controller: PIDFController, subsystems: Set<Subsystem>, outCondition: () -> Boolean = { abs(motor.velocity)-targetVelocity < 10 })