-
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
d1419e1
commit 72fc791
Showing
8 changed files
with
204 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
117 changes: 117 additions & 0 deletions
117
PathPlanning/src/main/kotlin/com/example/pathplanning/blue/main/BlueAuto.kt
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,117 @@ | ||
package com.example.pathplanning.blue.main | ||
|
||
import com.acmerobotics.roadrunner.geometry.Pose2d | ||
import com.noahbres.meepmeep.MeepMeep | ||
import com.noahbres.meepmeep.core.toRadians | ||
import com.noahbres.meepmeep.roadrunner.DefaultBotBuilder | ||
import java.awt.Image | ||
import java.io.File | ||
import java.io.IOException | ||
import javax.imageio.ImageIO | ||
|
||
object BlueAuto { | ||
@JvmStatic | ||
|
||
fun main(args: Array<String>) { | ||
val meepMeep = MeepMeep(800) | ||
|
||
val myBot = | ||
DefaultBotBuilder(meepMeep) // Set bot constraints: maxVel, maxAccel, maxAngVel, maxAngAccel, track width | ||
.setConstraints(30.0, 30.0, Math.toRadians(170.0), Math.toRadians(170.0), 13.94) | ||
.followTrajectorySequence { drive -> | ||
drive.trajectorySequenceBuilder(Pose2d(-12.0, 62.0, (270.0).toRadians())) | ||
.addTemporalMarker(0.1,) { | ||
//add the command for the arm to go up | ||
//add command for belt servo to go backwards | ||
//add the command to add the slides go up | ||
} | ||
.splineToLinearHeading(Pose2d(55.0, 55.0, Math.toRadians(225.0)), Math.toRadians(0.0)) | ||
.addDisplacementMarker { | ||
//add command for rollers servo to outtake | ||
} | ||
.turn(Math.toRadians(30.0)) // | ||
.addTemporalMarker(6.0) { | ||
//add command for arm to go down | ||
//add command for slides to go out | ||
//add command to belt servo to go at [x] angle | ||
} | ||
.addDisplacementMarker { | ||
//add command to intake | ||
} | ||
.turn(Math.toRadians(-30.0)) // | ||
.addTemporalMarker() { | ||
//add command to bring slides in | ||
//add command to bring arm up | ||
//add command to put slides out | ||
//add command to turn belt servo | ||
} | ||
.addDisplacementMarker { | ||
//add command to outtake | ||
} | ||
.turn(Math.toRadians(55.0)) // | ||
.addTemporalMarker() { | ||
//add command to bring slides in | ||
//add command to bring arm down | ||
//add command to put slides out | ||
//add command to turn belt servo | ||
} | ||
.addDisplacementMarker { | ||
//add command to intake | ||
} | ||
.turn(Math.toRadians(-55.0)) // | ||
.addTemporalMarker() { | ||
//add command to bring slides in | ||
//add command to bring arm up | ||
//add command to put slides out | ||
//add command to turn belt servo | ||
} | ||
.addDisplacementMarker { | ||
//add command to outtake | ||
} | ||
.turn(Math.toRadians(80.0)) // | ||
.addTemporalMarker() { | ||
//add command to bring slides in | ||
//add command to bring arm down | ||
//add command to put slides out | ||
//add command to turn belt servo | ||
} | ||
.addDisplacementMarker { | ||
//add command to intake | ||
} | ||
.turn(Math.toRadians(-80.0)) // | ||
.addTemporalMarker() { | ||
//add command to bring slides in | ||
//add command to bring arm up | ||
//add command to put slides out | ||
//add command to turn belt servo | ||
} | ||
.addDisplacementMarker { | ||
//add command to outtake | ||
} | ||
.splineToSplineHeading(Pose2d(36.0, 12.0, Math.toRadians(-180.0)), Math.toRadians(-90.0)) | ||
.addDisplacementMarker { | ||
//add command to bring arm up | ||
//add command to bring slides out | ||
} | ||
|
||
|
||
|
||
|
||
.build() | ||
} | ||
var img: Image? = null | ||
try { | ||
img = ImageIO.read(File("C://Users//arava//Downloads//field.png/")) | ||
} catch (_ : IOException) { | ||
|
||
} | ||
|
||
if (img != null) { | ||
meepMeep.setBackground(img) | ||
.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
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 |
---|---|---|
|
@@ -35,6 +35,7 @@ class StraightTest : LinearOpMode() { | |
} | ||
|
||
companion object { | ||
@JvmField | ||
var DISTANCE = 60.0 // in | ||
} | ||
} |
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