Skip to content

Commit

Permalink
auto paths
Browse files Browse the repository at this point in the history
# Conflicts:
#	TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/opModes/teleOp/MainTeleOp.kt
  • Loading branch information
Ishaan Ghaskadbi authored and SachetK committed Nov 20, 2024
1 parent ce04e7d commit 1be36b4
Show file tree
Hide file tree
Showing 10 changed files with 329 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .idea/misc.xml

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

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()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.example.pathplanning.red.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 RedParkObservation1 {
@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, (90.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,39 @@
package com.example.pathplanning.red.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 RedParkObservation2 {
@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, (90.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,42 @@
package com.example.pathplanning.red.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 RedParkTouchSubmmersible1 {
@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, (90.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()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.example.pathplanning.red.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 RedParkTouchSubmmersible2 {
@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, (90.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
Expand Up @@ -58,6 +58,8 @@ class MainTeleOp : CommandOpMode() {

//operator.getGamepadButton(GamepadKeys.Button.DPAD_UP).whileHeld(spinUpCommand)
// operator.getGamepadButton(GamepadKeys.Button.DPAD_DOWN).whileHeld(spinDownCommand)
operator.getGamepadButton(GamepadKeys.Button.DPAD_UP).whileHeld(spinUpCommand)
operator.getGamepadButton(GamepadKeys.Button.DPAD_DOWN).whileHeld(spinDownCommand)
operator.getGamepadButton(GamepadKeys.Button.RIGHT_BUMPER).whileHeld(armUpCommand)
operator.getGamepadButton(GamepadKeys.Button.LEFT_BUMPER).whileHeld(armDownCommand)

Expand Down

0 comments on commit 1be36b4

Please sign in to comment.