TeamCode / org.firstinspires.ftc.teamcode.movement / LinearMotion

LinearMotion

open class LinearMotion

A linear motion system driven by a DcMotor.

Constructors

<init>

LinearMotion(motor: DcMotor, range: IntRange? = null, powerMultiplier: Double = 1.0)

A linear motion system driven by a DcMotor.

Properties

currentPosition

val currentPosition: Int

The current position of the linear motion system.

motor

val motor: DcMotor

The motor controlled by the linear motion system.

powerMultiplier

val powerMultiplier: Double

Constant to multiply powers by.

range

val range: IntRange?

The range of movement that this system supports.

Functions

canMove

fun canMove(power: Double? = null, at: Int? = null): Boolean

Checks whether the linear motion system is allowed to move at a given power.

move

fun move(power: Double): Unit

Moves the linear motion system at a given power.

moveIfAble

fun moveIfAble(power: Double): Boolean

Moves the linear motion system at a given power if it is allowed to; stops it if it is not.

moveRaw

fun moveRaw(power: Double): Unit

Move the linear motion system at a power, bypassing powerMultiplier.

stop

fun stop(): Unit

Stops the linear motion system.

Inheritors

ElevatorExtake

class ElevatorExtake : LinearMotion, Extake

Extake comprised of an elevator that extends and retracts a rotatable bin.

ElevatorIntake

class ElevatorIntake : LinearMotion, Intake

Intake comprised of an elevator that extends and retracts a rotatable bin and roller.