createGenerator

fun createGenerator(motor: DcMotor, reduction: Double = 1.0, wheelDiameter: Measure<Distance>? = null): EncoderTicks.Generator

Create a dynamic generator for encoder tick conversions based on a motor. This will try to automatically determine the number of encoder ticks per revolution, if this is not provided, use the other constructor.

Return

The encoder tick generator.

Parameters

motor

The motor.

reduction

The gear reduction (input speed / output speed). If not provided, the reduction will be 1.

wheelDiameter

The diameter of the wheel. If not provided, distance conversions will not be available.


fun createGenerator(motor: DcMotor, ticksPerRevolution: Number, reduction: Double = 1.0, wheelDiameter: Measure<Distance>? = null): EncoderTicks.Generator

Create a dynamic generator for encoder tick conversions based on a motor.

Return

The encoder tick generator.

Parameters

motor

The motor.

ticksPerRevolution

The number of encoder ticks per revolution.

reduction

The gear reduction (input speed / output speed). If not provided, the reduction will be 1.

wheelDiameter

The diameter of the wheel. If not provided, distance conversions will not be available.