That worked amazingly well! Thank You So Much!
Now for our next question:
Where would we put our team marker file in our current programs? We have attached our code. What we do currently is rely on the “No Object Detected” value to move left and look for the duck, If it’s not on the center, we move left and look again, if it’s not on the center or left we know where it is. Will the “no object detected” still be able to be used with our "/sdcard/FIRST/tflitemodels/TeamMarker.tflite” file?
here is our code:
@Autonomous(name = “Red_Carousel_Duck”, group=“Pushbot”)
public class Red_Carousel_Duck extends LinearOpMode {
HardwarePushbot robot = new HardwarePushbot(); // Use a Pushbot’s hardware
private ElapsedTime runtime = new ElapsedTime();
private VuforiaCurrentGame vuforiaFreightFrenzy;
private TfodCurrentGame tfodFreightFrenzy;
private DcMotor left1;
Recognition recognition;
/**
- This function is executed when this Op Mode is selected from the Driver Station.
*/
@Override
public void runOpMode() {
robot.init(hardwareMap);
List recognitions;
int index;
vuforiaFreightFrenzy = new VuforiaCurrentGame();
tfodFreightFrenzy = new TfodCurrentGame();
// Sample TFOD Op Mode
// Initialize Vuforia.
vuforiaFreightFrenzy.initialize(
, // vuforiaLicenseKey
hardwareMap.get(WebcamName.class, “Webcam 1”),
// cameraName
“”, // webcamCalibrationFilename
false, // useExtendedTracking
false, // enableCameraMonitoring
VuforiaLocalizer.Parameters.CameraMonitorFeedback.NONE, // cameraMonitorFeedback
0, // dx
0, // dy
0, // dz
AxesOrder.XZY, // axesOrder
90, // firstAngle
90, // secondAngle
0, // thirdAngle
true); // useCompetitionFieldTargetLocations
// Set min confidence threshold to 0.7
tfodFreightFrenzy.initialize(vuforiaFreightFrenzy, (float) 0.85, true, true);
// Initialize TFOD before waitForStart.
// Init TFOD here so the object detection labels are visible
// in the Camera Stream preview window on the Driver Station.
tfodFreightFrenzy.activate();
// Enable following block to zoom in on target.
tfodFreightFrenzy.setZoom(2.5, 16 / 9);
telemetry.addData(“DS preview on/off”, “3 dots, Camera Stream”);
telemetry.addData(“>”, “Press Play to start”);
telemetry.update();
// Wait for start command from Driver Station.
waitForStart();
if (opModeIsActive()) {
// Put run blocks here.
// while (opModeIsActive()) {
// Put loop blocks here.
// Get a list of recognitions from TFOD.
{ recognitions = tfodFreightFrenzy.getRecognitions();
// If list is empty, inform the user. Otherwise, go
// through list and display info for each recognition.
if (recognitions.size() == 0) {
telemetry.addData(“TFOD”, “No items detected.”);
//nothing on the center square, move left and look again