-
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
99de4f0
commit d8ab9a7
Showing
1 changed file
with
36 additions
and
107 deletions.
There are no files selected for viewing
143 changes: 36 additions & 107 deletions
143
PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/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 |
---|---|---|
@@ -1,108 +1,37 @@ | ||
package com.example.pathplanning.legacy.blue.main | ||
package com.example.meepmeeptesting | ||
|
||
//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() | ||
// } | ||
// } | ||
//} | ||
import com.acmerobotics.roadrunner.Pose2d | ||
import com.noahbres.meepmeep.MeepMeep | ||
import com.noahbres.meepmeep.MeepMeep.Background | ||
import com.noahbres.meepmeep.core.toDegrees | ||
import com.noahbres.meepmeep.core.toRadians | ||
import com.noahbres.meepmeep.roadrunner.DefaultBotBuilder | ||
|
||
object MeepMeepTesting { | ||
@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(180.0), Math.toRadians(180.0), 15.0) | ||
.build() | ||
|
||
myBot.runAction( | ||
myBot.drive.actionBuilder(Pose2d(14.0, -62.0, 90.0.toRadians())) | ||
|
||
.splineToLinearHeading(Pose2d(0.0,-34.0,90.0.toRadians()),90.0.toRadians()) | ||
.waitSeconds(0.1) | ||
.splineToLinearHeading(Pose2d(16.0,-60.0,0.0.toRadians()),0.0.toRadians()) | ||
.splineToLinearHeading(Pose2d(34.0,0.0,0.0.toRadians()),90.0.toRadians()) | ||
.splineToLinearHeading(Pose2d(24.0,0.0,0.0.toRadians()),90.0.toRadians()) | ||
.build() | ||
) | ||
|
||
meepMeep.setBackground(Background.FIELD_INTO_THE_DEEP_JUICE_DARK) | ||
.setDarkMode(true) | ||
.setBackgroundAlpha(0.95f) | ||
.addEntity(myBot) | ||
.start() | ||
} | ||
} |