Package-level declarations

Types

Link copied to clipboard
interface Controllable

An item that has a position and a power.

Link copied to clipboard
class HoldPosition @JvmOverloads constructor(val controllable: Controllable, val controller: Controller, val subsystems: Set<Subsystem> = setOf()) : Command

This implements a Controller to hold a Controllable in its current position.

Link copied to clipboard
class HoldVelocity @JvmOverloads constructor(val controllable: Controllable, val controller: Controller, val subsystems: Set<Subsystem> = setOf()) : Command

This implements a PID controller to hold a motor at its current velocity. This command never finishes, so it should be implemented as a DefaultCommand in your subsystem.

Link copied to clipboard
class MotorEx(val motor: DcMotorEx) : Controllable

Wrapper class for motors that implements controllable (and can therefore be used with RunToPosition commands).

Link copied to clipboard
class MotorGroup(val leader: MotorEx, val followers: MotorEx) : Controllable

A MotorGroup is a collection of MotorExs that are all controlled by a single encoder (connected to the leader motor)

Link copied to clipboard
class ResetEncoder @JvmOverloads constructor(val motor: MotorEx, val subsystems: Set<Subsystem> = setOf()) : Command

This command resets the encoder using a custom implementation (in other words, it does not change the RunMode of the motor.

Link copied to clipboard
class RunToPosition @JvmOverloads constructor(val controllable: Controllable, val target: Double, val controller: Controller, val subsystems: Set<Subsystem> = setOf()) : Command

This implements a Controller to drive a Controllable to a specified target position. When it finishes, it will set the Controllable's power to 0. To have it hold position, set the default command to a HoldPosition command.

Link copied to clipboard
class RunToVelocity @JvmOverloads constructor(val controllable: Controllable, val targetVelocity: Double, val controller: Controller, val subsystems: Set<Subsystem> = setOf(), val outCondition: () -> Boolean = { abs(controllable.velocity)-targetVelocity < 10 }) : Command

This implements a PID controller to drive a motor to a specified target velocity. Note that this command will spin a motor to a specific velocity, and then depower the motor. To have it hold velocity, set the subsystem's default command to a HoldVelocity command.

Link copied to clipboard
class SetPower @JvmOverloads constructor(val controllable: Controllable, val power: Double, val subsystems: Set<Subsystem> = setOf()) : Command

Sets a controllable to a specific power without any internal feedback