Turret

object Turret : API

An API to control the turret

Properties

Link copied to clipboard
lateinit var aimer: DcMotorEx

The motor that aims the turret

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 encoder: AnalogInput
Link copied to clipboard

Soft Limits

Link copied to clipboard
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

Variables for turret launcher

Link copied to clipboard
Link copied to clipboard
lateinit var launcherL: DcMotorEx

The motors that launch the ball

Link copied to clipboard
lateinit var launcherR: DcMotorEx
Link copied to clipboard
Link copied to clipboard
lateinit var light: Servo

The lights

Link copied to clipboard
lateinit var light2: Servo
Link copied to clipboard
Link copied to clipboard
lateinit var servo: Servo

The hood

Link copied to clipboard
Link copied to clipboard
val VISION_KD: Double = 7.0E-6
Link copied to clipboard
val VISION_KI: Double = 0.0
Link copied to clipboard
val VISION_KP: Double = 0.015

*variables for aimer PID

Functions

Link copied to clipboard
Link copied to clipboard

PID for Aiming

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

Initializes this API.

Link copied to clipboard
fun launch()

fun launch(power: Double)

Fires the ball

Link copied to clipboard
fun light(PWM: Double)

Turns the light a certain color given a PWM value

Link copied to clipboard
fun light2(PWM: Double)
Link copied to clipboard
fun lockServo()

Locks the servo

Link copied to clipboard
fun moveHood(pos: Double)

Moves the servo to a given position

Link copied to clipboard
fun moveToTick(targetTick: Int)

Moves the turret to a certain tick

Link copied to clipboard
fun setAimerPower(power: Double)

Powers the aimer

Link copied to clipboard
fun stop()

Stops the launcher

Link copied to clipboard

Constantly makes sure that the turret is facing the basket.