-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed vision class, tested it with a custom vision opmode that works
- Loading branch information
1 parent
37a2090
commit bf1cdde
Showing
2 changed files
with
61 additions
and
5 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Visionop.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.firstinspires.ftc.teamcode; | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous; | ||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
|
||
import org.firstinspires.ftc.teamcode.subsystems.Vision; | ||
|
||
@Autonomous(name = "Visionop") // The string here is what the OpMode Shows up as on the phone | ||
// and the @Autonomous declares this OpMode as an Autonomous one | ||
|
||
public class Visionop extends LinearOpMode { | ||
|
||
public DcMotor motor; | ||
|
||
@Override | ||
public void runOpMode() throws InterruptedException { | ||
|
||
motor = hardwareMap.get(DcMotor.class, "testMotor"); | ||
|
||
Vision vision = new Vision(this, hardwareMap, telemetry); | ||
vision.init(); | ||
|
||
waitForStart(); | ||
|
||
while (!isStopRequested()){ | ||
if (vision.ducktective()) { | ||
motor.setPower(1); | ||
} else { | ||
motor.setPower(0); | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters