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

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 })

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val isDone: Boolean
Link copied to clipboard
val motor: DcMotorEx
Link copied to clipboard
Link copied to clipboard
open override val subsystems: Set<Subsystem>
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun and(vararg commands: Command): ParallelGroup
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
operator fun invoke()
Link copied to clipboard
Link copied to clipboard
fun raceWith(vararg commands: Command): ParallelRaceGroup
Link copied to clipboard
open override fun start()
Link copied to clipboard
open fun stop(interrupted: Boolean)
Link copied to clipboard
fun then(vararg commands: Command): SequentialGroup
Link copied to clipboard
Link copied to clipboard
open override fun update()
Link copied to clipboard