TriWheels

object TriWheels : API

An API for controlling the wheels of the triangle robot.

Properties

Link copied to clipboard
lateinit var blue: DcMotorEx
Link copied to clipboard
const val BLUE_ANGLE: Double
Link copied to clipboard
open val dependencies: Set<API>

Configures all APIs that must be initialized in order to use this API.

Link copied to clipboard
lateinit var green: DcMotorEx
Link copied to clipboard
const val GREEN_ANGLE: Double
Link copied to clipboard

Returns true if init has been called for this opmode.

Link copied to clipboard
open val isLinear: Boolean = false

Defines whether this API requires features from LinearOpMode.

Link copied to clipboard
lateinit var red: DcMotorEx
Link copied to clipboard
const val RED_ANGLE: Double

Functions

Link copied to clipboard

fun compute(radians: Double, magnitude: Double): Triple<Double, Double, Double>

Returns the ratio of how much each wheel should spin for given angle in radians and strength in magnitude.

Link copied to clipboard
fun drive(polar: Polar2d, rotation: Double = 0.0)

fun drive(radians: Double, magnitude: Double, rotation: Double = 0.0)

Makes the robot drive in a certain direction radians with a given strength magnitude.

Link copied to clipboard
open override fun init(opMode: OpMode)

Initializes this API.

Link copied to clipboard
fun inverse(ratio: Triple<Double, Double, Double>): Vector2d
Link copied to clipboard
fun power(redPower: Double, greenPower: Double, bluePower: Double)

Sets the power of each wheel respectively.

Link copied to clipboard
fun rotate(power: Double)

Rotates all of the wheels with a given power.

Link copied to clipboard
fun stop()

Makes all 3 wheels stop.

Link copied to clipboard

This function resets all 3 motors.

Link copied to clipboard
fun wheels(): Array<DcMotorEx>

Returns an array containing red, green, and blue.