forked from acmerobotics/road-runner-quickstart
-
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 branch 'master' of https://github.com/IF-Robotics/CS-States
- Loading branch information
Showing
9 changed files
with
280 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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,17 @@ | ||
plugins { | ||
id 'java-library' | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
repositories { | ||
maven { url = 'https://jitpack.io' } | ||
maven { url = 'https://maven.brott.dev/' } | ||
} | ||
|
||
dependencies { | ||
implementation 'com.github.NoahBres:MeepMeep:2.0.3' | ||
} |
227 changes: 227 additions & 0 deletions
227
MeepMeep/src/main/java/com/example/meepmeep/MeepMeepTesting.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,227 @@ | ||
package com.example.meepmeep; | ||
|
||
import static java.lang.Thread.sleep; | ||
|
||
import com.acmerobotics.roadrunner.geometry.Pose2d; | ||
import com.acmerobotics.roadrunner.geometry.Vector2d; | ||
import com.acmerobotics.roadrunner.trajectory.Trajectory; | ||
import com.noahbres.meepmeep.MeepMeep; | ||
import com.noahbres.meepmeep.roadrunner.DefaultBotBuilder; | ||
import com.noahbres.meepmeep.roadrunner.SampleMecanumDrive; | ||
import com.noahbres.meepmeep.roadrunner.entity.RoadRunnerBotEntity; | ||
import com.noahbres.meepmeep.roadrunner.trajectorysequence.TrajectorySequence; | ||
|
||
public class MeepMeepTesting { | ||
public static void main(String[] args) { | ||
MeepMeep meepMeep = new MeepMeep(800); | ||
RoadRunnerBotEntity bot = new DefaultBotBuilder(meepMeep).build(); | ||
//SampleMecanumDrive drive = new SampleMecanumDrive(hardwareMap); | ||
Pose2d blueAud = new Pose2d(-40.25, 64.25, Math.toRadians(-90)); | ||
Pose2d blueBack = new Pose2d(7.75, 64.25, Math.toRadians(-90)); | ||
Pose2d redBack = new Pose2d(7.75, -64.25, Math.toRadians(90)); | ||
Pose2d redAud = new Pose2d(-40.25, -64.25, Math.toRadians(90)); | ||
int teamProp = 1; | ||
|
||
|
||
|
||
RoadRunnerBotEntity blueAudL = 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(blueAud) | ||
.lineToSplineHeading(new Pose2d(-40.6, 56, Math.toRadians(-67))) | ||
//purple | ||
.addDisplacementMarker(() ->{}) | ||
.splineToSplineHeading(new Pose2d(-20, 10), Math.toRadians(0)) | ||
.lineToSplineHeading(new Pose2d(50,10, Math.toRadians(0))) | ||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity blueAudC = 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(blueAud) | ||
//purple | ||
.lineToLinearHeading(new Pose2d(-40.25,62, Math.toRadians(-90))) | ||
.addDisplacementMarker(() ->{}) | ||
.lineToLinearHeading(new Pose2d(20,59, Math.toRadians(-90))) | ||
.lineToSplineHeading(new Pose2d(50,59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity blueAudR = 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(blueAud) | ||
//purple | ||
.lineToLinearHeading(new Pose2d(-45,62, Math.toRadians(-90))) | ||
.addDisplacementMarker(() ->{}) | ||
.lineToLinearHeading(new Pose2d(20,59, Math.toRadians(-90))) | ||
.lineToSplineHeading(new Pose2d(50,59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity blueBackL = 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(blueBack) | ||
//purple | ||
.lineToLinearHeading(new Pose2d(20,59, Math.toRadians(-90))) | ||
.addDisplacementMarker(() ->{}) | ||
.lineToSplineHeading(new Pose2d(50,59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity blueBackC = 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(blueBack) | ||
//purple | ||
.addDisplacementMarker(() ->{}) | ||
.lineToLinearHeading(new Pose2d(20,59, Math.toRadians(-90))) | ||
|
||
.lineToSplineHeading(new Pose2d(50,59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity blueBackR = 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(blueBack) | ||
//purple | ||
.lineToLinearHeading(new Pose2d(20,59, Math.toRadians(-120))) | ||
.addDisplacementMarker(() ->{ | ||
|
||
}) | ||
.lineToSplineHeading(new Pose2d(50,59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity redAudL = 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(redAud) | ||
//purple | ||
.lineToLinearHeading(new Pose2d(-50,-59, Math.toRadians(90))) | ||
.addDisplacementMarker(() ->{}) | ||
.lineToLinearHeading(new Pose2d(20,-59, Math.toRadians(90))) | ||
|
||
.lineToSplineHeading(new Pose2d(50,-59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
|
||
RoadRunnerBotEntity redAudC = 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(redAud) | ||
//purple | ||
.addDisplacementMarker(() ->{}) | ||
.lineToLinearHeading(new Pose2d(20,-59, Math.toRadians(90))) | ||
|
||
.lineToSplineHeading(new Pose2d(50,-59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity redAudR = 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(redAud) | ||
//purple | ||
.lineToLinearHeading(new Pose2d(-50,-59, Math.toRadians(60))) | ||
.addDisplacementMarker(() ->{}) | ||
.lineToLinearHeading(new Pose2d(20,-59, Math.toRadians(90))) | ||
|
||
.lineToSplineHeading(new Pose2d(50,-59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity redAudRC = 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(redAud) | ||
//purple | ||
.lineToLinearHeading(new Pose2d(-50,-59, Math.toRadians(60))) | ||
.addDisplacementMarker(() ->{}) | ||
.splineToSplineHeading(new Pose2d(-20, -10), Math.toRadians(0)) | ||
.lineToSplineHeading(new Pose2d(50,-10, Math.toRadians(0))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity redBackL = 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(redBack) | ||
//purple | ||
.lineToLinearHeading(new Pose2d(20,-59, Math.toRadians(120))) | ||
.addDisplacementMarker(() ->{}) | ||
.lineToSplineHeading(new Pose2d(50,-59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity redBackC = 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(redBack) | ||
//purple | ||
.addDisplacementMarker(() ->{}) | ||
.lineToLinearHeading(new Pose2d(20,-59, Math.toRadians(90))) | ||
|
||
.lineToSplineHeading(new Pose2d(50,-59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
RoadRunnerBotEntity redBackR = 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(redBack) | ||
//purple | ||
.lineToLinearHeading(new Pose2d(20,-59, Math.toRadians(90))) | ||
.addDisplacementMarker(() ->{}) | ||
.lineToSplineHeading(new Pose2d(50,-59, Math.toRadians(-180))) | ||
|
||
.build() | ||
); | ||
|
||
meepMeep.setBackground(MeepMeep.Background.FIELD_CENTERSTAGE_JUICE_DARK) | ||
.setDarkMode(true) | ||
.setBackgroundAlpha(0.95f) | ||
.addEntity(blueAudL) | ||
.addEntity(blueAudC) | ||
.addEntity(blueAudR) | ||
.addEntity(blueBackL) | ||
.addEntity(blueBackC) | ||
.addEntity(blueBackR) | ||
.addEntity(redAudL) | ||
.addEntity(redAudC) | ||
.addEntity(redAudR) | ||
.addEntity(redAudRC) | ||
.addEntity(redBackL) | ||
.addEntity(redBackC) | ||
.addEntity(redBackR) | ||
.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.example.meepmeep; | ||
|
||
public class MyClass { | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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,2 +1,3 @@ | ||
include ':FtcRobotController' | ||
include ':TeamCode' | ||
include ':MeepMeep' |