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.
- Loading branch information
1 parent
030330c
commit 71cebb6
Showing
24 changed files
with
1,838 additions
and
1 deletion.
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_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
repositories { | ||
maven { url = 'https://jitpack.io' } | ||
maven { url = 'https://maven.brott.dev/' } | ||
} | ||
|
||
dependencies { | ||
implementation 'com.github.rh-robotics:MeepMeep:v1.0.0' | ||
} |
34 changes: 34 additions & 0 deletions
34
MeepMeepTesting/src/main/java/com/example/meepmeeptesting/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,34 @@ | ||
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 MeepMeepTesting { | ||
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(0, 0, 0)) | ||
.forward(30) | ||
.turn(Math.toRadians(90)) | ||
.forward(30) | ||
.turn(Math.toRadians(90)) | ||
.forward(30) | ||
.turn(Math.toRadians(90)) | ||
.forward(30) | ||
.turn(Math.toRadians(90)) | ||
.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
22 changes: 22 additions & 0 deletions
22
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auton/Drawing.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,22 @@ | ||
package org.firstinspires.ftc.teamcode.auton; | ||
|
||
import com.acmerobotics.dashboard.canvas.Canvas; | ||
import com.acmerobotics.roadrunner.Pose2d; | ||
import com.acmerobotics.roadrunner.Vector2d; | ||
|
||
public final class Drawing { | ||
private Drawing() {} | ||
|
||
|
||
public static void drawRobot(Canvas c, Pose2d t) { | ||
final double ROBOT_RADIUS = 9; | ||
|
||
c.setStrokeWidth(1); | ||
c.strokeCircle(t.position.x, t.position.y, ROBOT_RADIUS); | ||
|
||
Vector2d halfv = t.heading.vec().times(0.5 * ROBOT_RADIUS); | ||
Vector2d p1 = t.position.plus(halfv); | ||
Vector2d p2 = p1.plus(halfv); | ||
c.strokeLine(p1.x, p1.y, p2.x, p2.y); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auton/Localizer.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,8 @@ | ||
package org.firstinspires.ftc.teamcode.auton; | ||
|
||
import com.acmerobotics.roadrunner.Time; | ||
import com.acmerobotics.roadrunner.Twist2dDual; | ||
|
||
public interface Localizer { | ||
Twist2dDual<Time> update(); | ||
} |
Oops, something went wrong.