TeamCode / org.firstinspires.ftc.teamcode.sensing / MineralDetection

MineralDetection

open class MineralDetection

Wrapper class for Vuforia and TFOD. Improves code reusability. Unlike most other classes, you usually do not call standard; instead, you use its constructor.

Constructors

<init>

MineralDetection(hardwareMap: HardwareMap)

Initializer that takes a hardware map as an argument.

Properties

LABEL_GOLD_MINERAL

static val LABEL_GOLD_MINERAL: String

LABEL_SILVER_MINERAL

static val LABEL_SILVER_MINERAL: String

cameraDirection

var cameraDirection: CameraDirection

hardwareMap

var hardwareMap: HardwareMap

tfod

var tfod: TFObjectDetector

vuforia

var vuforia: VuforiaLocalizer

Functions

activate

open fun activate(): Unit

Activate TFOD. This method is typically called in an OpMode's start function.

getUpdatedRecognitions

open fun getUpdatedRecognitions(): MutableList<Recognition>

Asks TFOD for updated recognitions.

init

open fun init(): Unit

Convenience method to initialize Vuforia and TensorFlow at the same time. Usually called during the init phase of an op mode.

initTfod

open fun initTfod(): Unit

Initialize the Tensor Flow Object Detection engine.

initVuforia

open fun initVuforia(): Unit

Initialize the Vuforia localization engine.

shutdown

open fun shutdown(): Unit

Shut down TFOD. This method is typically called in an OpMode's stop function.

Inheritors

Vision

open class Vision : MineralDetection

This class takes care of all your vision needs. Wrapper class for Vuforia that extends MineralDetection. Improves code reusability.

IMPORTANT: Use of the Vision class requires a Vuforia auth key. To learn how to set one up, browse to the VuforiaAuthKey class.