public class TensorFlowManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TensorFlowManager.TFDetector
Enum containing all possible detections of the minerals .
|
static class |
TensorFlowManager.TFLocation
Enum containing all possible locations of the minerals .
|
Modifier and Type | Field and Description |
---|---|
private TensorFlowManager.TFDetector |
detector
Instance variable containing TensorFlow's detector
|
private static java.lang.String |
LABEL_GOLD_MINERAL |
private static java.lang.String |
LABEL_SILVER_MINERAL |
private TensorFlowManager.TFLocation |
location
Instance variable containing TensorFlow's locator
|
private org.firstinspires.ftc.robotcore.external.tfod.TFObjectDetector |
tfod |
private static java.lang.String |
TFOD_MODEL_ASSET
Constants for TensorFlow detectors + Vuforia Key
|
private org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer |
vuforia |
private static java.lang.String |
VUFORIA_KEY |
Constructor and Description |
---|
TensorFlowManager()
Default constructor for TensorFlowManager.
|
Modifier and Type | Method and Description |
---|---|
TensorFlowManager.TFDetector |
getDetector()
Returns updated classification of mineral.
|
TensorFlowManager.TFLocation |
getLocation()
Returns updated location of mineral.
|
void |
init(com.qualcomm.robotcore.hardware.HardwareMap hwMap)
Initializes Vuforia and starts TensorFlow detector if possible.
|
private void |
initTfod(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap)
Initialize the Tensor Flow Object Detection engine.
|
private void |
initVuforia()
Initialize the Vuforia localization engine.
|
void |
start()
Activates TensorFlow interface.
|
void |
stop()
Deactivate TensorFlow interface.
|
private void |
updateDetector()
Identifies mineral based on TensorFlow's classification.
|
private void |
updateLocation()
Identifies mineral's location based on TensorFlow's classification.
|
private static final java.lang.String TFOD_MODEL_ASSET
private static final java.lang.String LABEL_GOLD_MINERAL
private static final java.lang.String LABEL_SILVER_MINERAL
private static final java.lang.String VUFORIA_KEY
private org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer vuforia
private org.firstinspires.ftc.robotcore.external.tfod.TFObjectDetector tfod
private TensorFlowManager.TFLocation location
private TensorFlowManager.TFDetector detector
public TensorFlowManager()
public void init(com.qualcomm.robotcore.hardware.HardwareMap hwMap)
hwMap
- robot's hardware mappublic void start()
public void stop()
public TensorFlowManager.TFLocation getLocation()
public TensorFlowManager.TFDetector getDetector()
private void updateDetector()
private void updateLocation()
private void initVuforia()
private void initTfod(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap)