Generator

class Generator(motor: DcMotor, ticksPerRevolution: Int, reduction: Double, wheelDiameter: Measure<Distance>?)

Dynamic generator for encoder tick conversions based on a motor.

Constructors

Link copied to clipboard
constructor(motor: DcMotor, ticksPerRevolution: Int, reduction: Double, wheelDiameter: Measure<Distance>?)

Functions

Link copied to clipboard
fun angle(ticks: Int): Measure<Angle>

Get an angle from the provided encoder ticks.

Link copied to clipboard
fun distance(ticks: Int): Measure<Distance>?

Get a distance from the provided encoder ticks.

Link copied to clipboard

Get the current encoder acceleration in a distance. Note that the motor attached to this generator must be an instance of Motor, or an exception will be thrown.

Link copied to clipboard

Get the current encoder ticks in an angle.

Link copied to clipboard

Get the angular acceleration of the encoder. Note that the motor attached to this generator must be an instance of Motor, or an exception will be thrown.

Link copied to clipboard

Get the angular velocity of the encoder.

Link copied to clipboard

Get the current encoder ticks in a distance.

Link copied to clipboard

Get the current encoder velocity in a distance.

Link copied to clipboard
fun ticks(angle: Measure<Angle>): Int

Get encoder ticks from the provided angle.

fun ticks(distance: Measure<Distance>): Int?

Get encoder ticks from the provided distance.