mirror of
https://github.com/TimeCrafters/FTC_2022
synced 2025-12-15 22:22: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 {
|
android {
|
||||||
namespace = 'org.firstinspires.ftc.teamcode'
|
namespace = 'org.firstinspires.ftc.teamcode'
|
||||||
|
buildFeatures {
|
||||||
|
mlModelBinding true
|
||||||
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
jniLibs.useLegacyPackaging true
|
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("- Position (Row/Col)","%.0f / %.0f", row, col);
|
||||||
engine.telemetry.addData("- Size (Width/Height)","%.0f / %.0f", width, height);
|
engine.telemetry.addData("- Size (Width/Height)","%.0f / %.0f", width, height);
|
||||||
|
|
||||||
if (recognition.getLabel().equals("2 Bulb")) {
|
if (recognition.getLabel().equals("Red 2")) {
|
||||||
engine.telemetry.addData("2 Bulb", engine.blackboard.put("parkPlace", "2"));
|
engine.telemetry.addData("Red 2", engine.blackboard.put("parkPlace", "2"));
|
||||||
} else if (recognition.getLabel().equals("3 Panel")) {
|
} else if (recognition.getLabel().equals("Blue 3")) {
|
||||||
engine.telemetry.addData("3 Panel",engine.blackboard.put("parkPlace", "3"));
|
engine.telemetry.addData("Blue 3",engine.blackboard.put("parkPlace", "3"));
|
||||||
} else {
|
} 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) {
|
if (recognition.getConfidence() >= minimumConfidence && recognition.getConfidence() > bestConfidence) {
|
||||||
bestConfidence = recognition.getConfidence();
|
bestConfidence = recognition.getConfidence();
|
||||||
|
|
||||||
if (recognition.getLabel().equals("2 Bulb")) {
|
if (recognition.getLabel().equals("Red 2")) {
|
||||||
engine.blackboard.put("parkPlace", "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");
|
engine.blackboard.put("parkPlace", "3");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ import org.timecrafters.TimeCraftersConfigurationTool.library.TimeCraftersConfig
|
|||||||
|
|
||||||
public class PhoenixBot1 {
|
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 = {
|
private static final String[] LABELS = {
|
||||||
"1 Bolt",
|
"Yellow 1",
|
||||||
"2 Bulb",
|
"Red 2",
|
||||||
"3 Panel"
|
"Blue 3"
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final String VUFORIA_KEY =
|
private static final String VUFORIA_KEY =
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public class SteeringDriveExperiment extends CyberarmState {
|
|||||||
public SteeringDriveExperiment(PhoenixBot1 robot) {
|
public SteeringDriveExperiment(PhoenixBot1 robot) {
|
||||||
this.robot = robot;
|
this.robot = robot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exec() {
|
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