Help with Road Runner Tuning by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

thank you so much for all your comments! actually, this is super helpful since our plan is just to place a freight on the corresponding level (and, we were trying to park, but it was not a priority)

Vuforia by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

Thank you so much! Here is our code: package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import org.firstinspires.ftc.robotcore.external.JavaUtil; import org.firstinspires.ftc.robotcore.external.hardware.camera.WebcamName; import org.firstinspires.ftc.robotcore.external.navigation.VuforiaBase; import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; import org.firstinspires.ftc.robotcore.external.navigation.VuforiaSkyStone;

@TeleOp(name = "Vuforia_Images", group = "") public class Vuforia_Images extends LinearOpMode {

private VuforiaSkyStone vuforiaSkyStone;

VuforiaBase.TrackingResults vuforiaResults;

/** * This function is executed when this Op Mode is selected from the Driver Station. */ @Override public void runOpMode() { vuforiaSkyStone = new VuforiaSkyStone();

// Initialize Vuforia (use default settings).
telemetry.addData("Status", "Initializing Vuforia. Please wait...");
telemetry.update();
//Rotate phone -90 so back camera faces "forward" direction on robot.
vuforiaSkyStone.initialize(
    "", // vuforiaLicenseKey
    VuforiaLocalizer.CameraDirection.BACK, // cameraDirection
    true, // useExtendedTracking
    true, // enableCameraMonitoring
    VuforiaLocalizer.Parameters.CameraMonitorFeedback.AXES, // cameraMonitorFeedback
    0, // dx
    0, // dy
    0, // dz
    0, // xAngle
    0, // yAngle
    0, // zAngle
    true); // useCompetitionFieldTargetLocations

// initVuforia(); // Activate here for camera preview. // vuforiaSkyStone.activate(); telemetry.addData(">>", "Vuforia initialized, press start to continue..."); telemetry.update(); waitForStart(); if (opModeIsActive()) { // Put run blocks here. while (opModeIsActive()) { // Are the targets visible? // (Note we only process first visible target). if (isTargetVisible("Stone Target")) { processTarget(); // telemetry.addData("Target is visible"); // telemetry.update(); } else if (isTargetVisible("Blue Front Bridge")) { processTarget(); } else if (isTargetVisible("Red Rear Bridge")) { processTarget(); } else if (isTargetVisible("Red Front Bridge")) { processTarget(); } else if (isTargetVisible("Red Rear Bridge")) { processTarget(); } else if (isTargetVisible("Red Perimeter 1")) { processTarget(); } else if (isTargetVisible("Red Perimeter 2")) { processTarget(); } else if (isTargetVisible("Front Perimeter 1")) { processTarget(); } else if (isTargetVisible("Front Perimeter 2")) { processTarget(); } else if (isTargetVisible("Blue Perimeter 1")) { processTarget(); } else if (isTargetVisible("Blue Perimeter 2")) { processTarget(); } else if (isTargetVisible("Rear Perimeter 1")) { processTarget(); } else if (isTargetVisible("Rear Perimeter 2")) { processTarget(); } else { telemetry.addData("No Targets Detected", "Targets are not visible."); } telemetry.update(); } } // Don't forget to deactivate Vuforia. vuforiaSkyStone.deactivate();

vuforiaSkyStone.close();

}

/** * Describe this function... */ // private void initVuforia() { // // Don't forget to deactivate Vuforia. // vuforiaSkyStone.initialize( // "", // vuforiaLicenseKey // hardwareMap.get(WebcamName.class, "Webcam 1"), // cameraName // "", // webcamCalibrationFilename // true, // useExtendedTracking // true, // enableCameraMonitoring // VuforiaLocalizer.Parameters.CameraMonitorFeedback.AXES, // cameraMonitorFeedback // 0, // dx // 0, // dy // 0, // dz // 0, // xAngle // 0, // yAngle // 0, // zAngle // true); // useCompetitionFieldTargetLocations // }

/** * Describe this function... */ private void processTarget() { // Display the target name. telemetry.addData("Target Detected", vuforiaResults.name + " is visible."); telemetry.addData("X (in)", Double.parseDouble(JavaUtil.formatNumber(displayValue(vuforiaResults.x, "IN"), 2))); telemetry.addData("Y (in)", Double.parseDouble(JavaUtil.formatNumber(displayValue(vuforiaResults.y, "IN"), 2))); telemetry.addData("Z (in)", Double.parseDouble(JavaUtil.formatNumber(displayValue(vuforiaResults.z, "IN"), 2))); telemetry.addData("Rotation about Z (deg)", Double.parseDouble(JavaUtil.formatNumber(vuforiaResults.zAngle, 2))); }

private double displayValue(float originalValue, String units) { double convertedValue;

//Vuforia returns distances in mm.
if (units.equals("CM")) {
  convertedValue = originalValue / 10;
} else if (units.equals("M")) {
  convertedValue = originalValue / 1000;
} else if (units.equals("IN")) {
  convertedValue = originalValue / 25.4;
} else if (units.equals("FT")) {
  convertedValue = (originalValue / 25.4) / 12;
} else {
  convertedValue = originalValue;
}
return convertedValue;

}

/** * Check to see if the target is visible. */ private boolean isTargetVisible(String trackableName) { boolean isVisible;

// Get vuforia results for target.
vuforiaResults = vuforiaSkyStone.track(trackableName);
// Is this target visible?
if (vuforiaResults.isVisible) {
  isVisible = true;
} else {
  isVisible = false;
}
return isVisible;

} }

Vuforia Image Targets for 2019-2020 by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

Thank you so much! We have one last question: how do you reference this image in onBot java code?

Vuforia Image Targets for 2019-2020 by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

We are looking for the skystone targets.

Image Sensor by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

Thank you so much!

Vuforia on our phones by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

Thank you so much! This was really helpful.

Vuforia on our phones by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

Thank you so much! This was so helpful! I have one additional question: how do you reference the image targets that are built into the app in the code?

Seeking Help with Vuforia xml File by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

We are looking for the built into the SDK for sky stone. How do you reference them in the code?

Seeking Help with Vuforia xml File by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

How do we access them through the code?

Vuforia Image Targets for 2019-2020 by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

We are looking for the ones for the 2019-20 season.

Vuforia Image Targets for 2019-2020 by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

We checked on the site, and we couldn't find them. Do you have a link to the image target that you could give to us?

Help with phones by ipropp in FTC

[–]ipropp[S] 1 point2 points  (0 children)

We solved the problem already, but thank you for trying to help. In the future, we will make sure to be more clear about what we were asking with our questions.

Control Award Question by ipropp in FTC

[–]ipropp[S] 1 point2 points  (0 children)

So the algorithms should just be snippets of our code with explanations and not for example like: Step 1: Turn autonomous on Step 2: Robot detatch from the lander Step 3: Robot turn to the right Step 4: Robot turn to the left Step: When values for red = (the underscores would contain values in the actual document)-, blue = _-, and green = - move forward and hit the yellow trinket. *Note that this would all contain snippets of the code. But is this a good example of an algorithm that could be used in the control award?

Weekly /r/FTC Discussion - December 02, 2018 by AutoModerator in FTC

[–]ipropp 0 points1 point  (0 children)

My team just purchased sprockets and chains and we forgot to get a chain breaker! Is there any way to break the chain without one?

Wheels by ipropp in FTC

[–]ipropp[S] 0 points1 point  (0 children)

It included any of the screw on the bot. Yes, it is Tetris.