mirror of
https://github.com/TimeCrafters/FTC_2022
synced 2025-12-15 15:32:35 +00:00
Implemented Custom Model, and modified Cone identification state to look for the new models. Also modified steering drive tele op I'm doing.
This commit is contained in:
@@ -17,6 +17,9 @@ apply from: '../build.dependencies.gradle'
|
||||
|
||||
android {
|
||||
namespace = 'org.firstinspires.ftc.teamcode'
|
||||
buildFeatures {
|
||||
mlModelBinding true
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
jniLibs.useLegacyPackaging true
|
||||
|
||||
@@ -47,12 +47,12 @@ public class ConeIdentification extends CyberarmState {
|
||||
engine.telemetry.addData("- Position (Row/Col)","%.0f / %.0f", row, col);
|
||||
engine.telemetry.addData("- Size (Width/Height)","%.0f / %.0f", width, height);
|
||||
|
||||
if (recognition.getLabel().equals("2 Bulb")) {
|
||||
engine.telemetry.addData("2 Bulb", engine.blackboard.put("parkPlace", "2"));
|
||||
} else if (recognition.getLabel().equals("3 Panel")) {
|
||||
engine.telemetry.addData("3 Panel",engine.blackboard.put("parkPlace", "3"));
|
||||
if (recognition.getLabel().equals("Red 2")) {
|
||||
engine.telemetry.addData("Red 2", engine.blackboard.put("parkPlace", "2"));
|
||||
} else if (recognition.getLabel().equals("Blue 3")) {
|
||||
engine.telemetry.addData("Blue 3",engine.blackboard.put("parkPlace", "3"));
|
||||
} else {
|
||||
engine.telemetry.addData("1 Bolt", engine.blackboard.put("parkPlace", "1"));
|
||||
engine.telemetry.addData("Yellow 1", engine.blackboard.put("parkPlace", "1"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,9 +75,9 @@ public class ConeIdentification extends CyberarmState {
|
||||
if (recognition.getConfidence() >= minimumConfidence && recognition.getConfidence() > bestConfidence) {
|
||||
bestConfidence = recognition.getConfidence();
|
||||
|
||||
if (recognition.getLabel().equals("2 Bulb")) {
|
||||
if (recognition.getLabel().equals("Red 2")) {
|
||||
engine.blackboard.put("parkPlace", "2");
|
||||
} else if (recognition.getLabel().equals("3 Panel")) {
|
||||
} else if (recognition.getLabel().equals("Blue 3")) {
|
||||
engine.blackboard.put("parkPlace", "3");
|
||||
|
||||
} else {
|
||||
|
||||
@@ -19,12 +19,12 @@ import org.timecrafters.TimeCraftersConfigurationTool.library.TimeCraftersConfig
|
||||
|
||||
public class PhoenixBot1 {
|
||||
|
||||
private static final String TFOD_MODEL_ASSET = "PowerPlay.tflite";
|
||||
private static final String TFOD_MODEL_ASSET = "22-23_PowerPlay_Colors.tflite";
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"1 Bolt",
|
||||
"2 Bulb",
|
||||
"3 Panel"
|
||||
"Yellow 1",
|
||||
"Red 2",
|
||||
"Blue 3"
|
||||
};
|
||||
|
||||
private static final String VUFORIA_KEY =
|
||||
|
||||
@@ -16,6 +16,7 @@ public class SteeringDriveExperiment extends CyberarmState {
|
||||
public SteeringDriveExperiment(PhoenixBot1 robot) {
|
||||
this.robot = robot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exec() {
|
||||
|
||||
|
||||
BIN
TeamCode/src/main/ml/22-23_PowerPlay_Colors.tflite
Normal file
BIN
TeamCode/src/main/ml/22-23_PowerPlay_Colors.tflite
Normal file
Binary file not shown.
Reference in New Issue
Block a user