generated from rh-robotics/Basecode
-
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.
Merge pull request #5 from rh-robotics/InitMeepMeep
Meep Meep Auton Maps
- Loading branch information
Showing
8 changed files
with
148 additions
and
14 deletions.
There are no files selected for viewing
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
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
47 changes: 47 additions & 0 deletions
47
MeepMeepTesting/src/main/java/com/example/meepmeeptesting/MeepMeepRedSide.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,47 @@ | ||
package com.example.meepmeeptesting; | ||
|
||
import com.acmerobotics.roadrunner.geometry.Pose2d; | ||
|
||
import org.rowlandhall.meepmeep.MeepMeep; | ||
import org.rowlandhall.meepmeep.roadrunner.DefaultBotBuilder; | ||
import org.rowlandhall.meepmeep.roadrunner.entity.RoadRunnerBotEntity; | ||
|
||
public class MeepMeepRedSide { | ||
public static void main(String[] args) { | ||
MeepMeep meepMeep = new MeepMeep(800); | ||
|
||
RoadRunnerBotEntity myBot = new DefaultBotBuilder(meepMeep) | ||
// Set bot constraints: maxVel, maxAccel, maxAngVel, maxAngAccel, track width | ||
.setConstraints(60, 60, Math.toRadians(180), Math.toRadians(180), 15) | ||
.followTrajectorySequence(drive -> drive.trajectorySequenceBuilder(new Pose2d(-35, -62.5, Math.toRadians(180))) | ||
.forward(20) | ||
.back(8) | ||
.turn(Math.toRadians(-90)) | ||
.forward(30) | ||
.back(30) | ||
.turn(Math.toRadians(90)) | ||
.forward(8) | ||
.back(8) | ||
.strafeRight(37) | ||
.forward(5) | ||
.back(5) | ||
.strafeLeft(37) | ||
.forward(8) | ||
.back(8) | ||
.strafeRight(37) | ||
.forward(12) | ||
.back(12) | ||
.strafeLeft(37) | ||
.forward(6) | ||
.back(110) | ||
|
||
.build()); | ||
|
||
|
||
meepMeep.setBackground(MeepMeep.Background.FIELD_INTOTHEDEEP_JUICE_DARK) | ||
.setDarkMode(true) | ||
.setBackgroundAlpha(0.95f) | ||
.addEntity(myBot) | ||
.start(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-18/"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21/"/> | ||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/> | ||
<classpathentry kind="output" path="bin/default"/> | ||
</classpath> |
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
13 changes: 13 additions & 0 deletions
13
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/TestPipeline.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,13 @@ | ||
package org.firstinspires.ftc.teamcode.subsystems; | ||
|
||
import org.opencv.core.Mat; | ||
import org.openftc.easyopencv.OpenCvPipeline; | ||
|
||
class TestPipeline extends OpenCvPipeline | ||
{ | ||
@Override | ||
public Mat processFrame(Mat input) | ||
{ | ||
return input; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/VisionTesting.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,48 @@ | ||
package org.firstinspires.ftc.teamcode.subsystems; | ||
|
||
import org.firstinspires.ftc.robotcore.external.hardware.camera.WebcamName; | ||
import androidx.annotation.NonNull; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
import com.qualcomm.robotcore.hardware.DcMotorEx; | ||
import com.qualcomm.robotcore.hardware.DcMotorSimple; | ||
import com.qualcomm.robotcore.hardware.HardwareMap; | ||
import com.qualcomm.robotcore.util.ElapsedTime; | ||
|
||
import org.firstinspires.ftc.robotcore.external.Telemetry; | ||
import org.openftc.easyopencv.OpenCvCamera; | ||
import org.openftc.easyopencv.OpenCvCameraFactory; | ||
import org.openftc.easyopencv.OpenCvCameraRotation; | ||
|
||
public class VisionTesting | ||
{ | ||
|
||
public VisionTesting(HardwareMap hardwareMap) { | ||
//TODO: Find a value for this??? | ||
int cameraId = 0; | ||
//initializes open cv camera | ||
WebcamName cam = hardwareMap.get(WebcamName.class, "NAME_OF_CAMERA_IN_CONFIG_FILE"); | ||
OpenCvCamera camera = OpenCvCameraFactory.getInstance().createWebcam(cam, cameraId); | ||
|
||
camera.openCameraDeviceAsync(new OpenCvCamera.AsyncCameraOpenListener() | ||
{ | ||
@Override | ||
public void onOpened() | ||
{ | ||
|
||
// camera.setPipeline(yourPipeline); | ||
camera.startStreaming(320, 240, OpenCvCameraRotation.UPRIGHT); | ||
} | ||
@Override | ||
public void onError(int errorCode) | ||
{ | ||
/* | ||
* This will be called if the camera could not be opened | ||
*/ | ||
} | ||
}); | ||
|
||
|
||
} | ||
|
||
|
||
} |
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