Skip to content

Commit

Permalink
auto paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishaan Ghaskadbi authored and Ishaan Ghaskadbi committed Nov 16, 2024
1 parent 180f942 commit 64574d1
Show file tree
Hide file tree
Showing 20 changed files with 688 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion PathPlanning/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(17)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.example.pathplanning.blue.basket

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 BlueHighBasket1 {
@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(170.0), 14.0)
.followTrajectorySequence { drive ->
drive.trajectorySequenceBuilder(Pose2d(-12.0, 62.0, (270.0).toRadians()))
.turn((90.0).toRadians())
.forward(60.0)
.waitSeconds(2.0)
.build()
}
var img: Image? = null
try {
img = ImageIO.read(File("/Users/ishaanghaskadbi/Downloads/field.png"))
} catch (_ : IOException) {

}

if (img != null) {
meepMeep.setBackground(img)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.example.pathplanning.blue.basket

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 BlueHighBasket2 {
@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(170.0), 14.0)
.followTrajectorySequence { drive ->
drive.trajectorySequenceBuilder(Pose2d(12.0, 62.0, (270.0).toRadians()))
.turn((90.0).toRadians())
.forward(35.0)
.waitSeconds(2.0)
.build()
}
var img: Image? = null
try {
img = ImageIO.read(File("/Users/ishaanghaskadbi/Downloads/field.png"))
} catch (_ : IOException) {

}

if (img != null) {
meepMeep.setBackground(img)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.example.pathplanning.blue.chamber

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 BlueHighChamber1 {
@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(170.0), 14.0)
.followTrajectorySequence { drive ->
drive.trajectorySequenceBuilder(Pose2d(-12.0, 62.0, (270.0).toRadians()))
.forward(28.0)
.strafeLeft(11.0)
.waitSeconds(2.0)
.build()
}
var img: Image? = null
try {
img = ImageIO.read(File("/Users/ishaanghaskadbi/Downloads/field.png"))
} catch (_ : IOException) {

}

if (img != null) {
meepMeep.setBackground(img)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.example.pathplanning.blue.chamber

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 BlueHighChamber2 {
@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(170.0), 14.0)
.followTrajectorySequence { drive ->
drive.trajectorySequenceBuilder(Pose2d(12.0, 62.0, (270.0).toRadians()))
.forward(28.0)
.strafeRight(11.0)
.waitSeconds(2.0)
.build()
}
var img: Image? = null
try {
img = ImageIO.read(File("/Users/ishaanghaskadbi/Downloads/field.png"))
} catch (_ : IOException) {

}

if (img != null) {
meepMeep.setBackground(img)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.example.pathplanning.blue.park

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 BlueParkObservation1 {
@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(170.0), 14.0)
.followTrajectorySequence { drive ->
drive.trajectorySequenceBuilder(Pose2d(-12.0, 62.0, (270.0).toRadians()))
.strafeRight(48.0)
.build()
}
var img: Image? = null
try {
img = ImageIO.read(File("/Users/ishaanghaskadbi/Downloads/field.png"))
} catch (_ : IOException) {

}

if (img != null) {
meepMeep.setBackground(img)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.example.pathplanning.blue.park

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 BlueParkObservation2 {
@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(170.0), 14.0)
.followTrajectorySequence { drive ->
drive.trajectorySequenceBuilder(Pose2d(12.0, 62.0, (270.0).toRadians()))
.strafeRight(72.0)
.build()
}
var img: Image? = null
try {
img = ImageIO.read(File("/Users/ishaanghaskadbi/Downloads/field.png"))
} catch (_ : IOException) {

}

if (img != null) {
meepMeep.setBackground(img)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.example.pathplanning.blue.park

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 BlueParkTouchSubmmersible1 {

@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(170.0), 14.0)
.followTrajectorySequence { drive ->
drive.trajectorySequenceBuilder(Pose2d(-12.0, 62.0, (270.0).toRadians()))
.forward(27.0)
.strafeLeft(48.0)
.forward(24.0)
.strafeRight(12.0)
.build()
}
var img: Image? = null
try {
img = ImageIO.read(File("/Users/ishaanghaskadbi/Downloads/field.png"))
} catch (_ : IOException) {

}

if (img != null) {
meepMeep.setBackground(img)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start()
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.example.pathplanning.blue.park

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 BlueParkTouchSubmmersible2 {
@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(170.0), 14.0)
.followTrajectorySequence { drive ->
drive.trajectorySequenceBuilder(Pose2d(12.0, 62.0, (270.0).toRadians()))
.forward(27.0)
.strafeLeft(24.0)
.forward(24.0)
.strafeRight(12.0)
.build()
}
var img: Image? = null
try {
img = ImageIO.read(File("/Users/ishaanghaskadbi/Downloads/field.png"))
} catch (_ : IOException) {

}

if (img != null) {
meepMeep.setBackground(img)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start()
}
}
}
Loading

0 comments on commit 64574d1

Please sign in to comment.