From c253e9febe08ef46735cdcaaa66e26877aed5156 Mon Sep 17 00:00:00 2001 From: Sachet Korada Date: Thu, 12 Dec 2024 17:04:27 -0500 Subject: [PATCH] refactor --- .idea/misc.xml | 3 +- PathPlanning/build.gradle | 4 +- .../blue/basket/BlueHighBasket1.kt | 41 -- .../blue/basket/BlueHighBasket2.kt | 28 - .../blue/chamber/BlueHighChamberLeft.kt | 41 -- .../blue/chamber/BlueHighChamberRight.kt | 41 -- .../pathplanning/blue/main/BlueAuto.kt | 117 ---- .../pathplanning/blue/main/BlueAutoLeft.kt | 55 -- .../blue/park/BlueParkObservationLeft.kt | 39 -- .../blue/park/BlueParkObservationRight.kt | 39 -- .../park/BlueParkTouchSubmmersibleLeft.kt | 44 -- .../park/BlueParkTouchSubmmersibleRight.kt | 42 -- .../legacy/blue/basket/BlueHighBasket1.kt | 32 ++ .../legacy/blue/basket/BlueHighBasket2.kt | 23 + .../blue/chamber/BlueHighChamberLeft.kt | 32 ++ .../blue/chamber/BlueHighChamberRight.kt | 32 ++ .../pathplanning/legacy/blue/main/BlueAuto.kt | 108 ++++ .../legacy/blue/main/BlueAutoLeft.kt | 46 ++ .../blue/park/BlueParkObservationLeft.kt | 30 + .../blue/park/BlueParkObservationRight.kt | 30 + .../park/BlueParkTouchSubmmersibleLeft.kt | 35 ++ .../park/BlueParkTouchSubmmersibleRight.kt | 33 ++ .../legacy/red/basket/RedHighBasket1.kt | 32 ++ .../legacy/red/basket/RedHighBasket2.kt | 32 ++ .../legacy/red/chamber/RedHighChamber1.kt | 32 ++ .../legacy/red/chamber/RedHighChamber2.kt | 32 ++ .../legacy/red/park/RedParkObservation1.kt | 30 + .../legacy/red/park/RedParkObservation2.kt | 30 + .../legacy/red/park/RedParkObservationLeft.kt | 30 + .../red/park/RedParkObservationRight.kt | 30 + .../red/park/RedParkTouchSubmmersible1.kt | 33 ++ .../red/park/RedParkTouchSubmmersible2.kt | 33 ++ .../red/park/RedParkTouchSubmmersibleLeft.kt | 33 ++ .../red/park/RedParkTouchSubmmersibleRight.kt | 33 ++ .../pathplanning/red/basket/RedHighBasket1.kt | 41 -- .../pathplanning/red/basket/RedHighBasket2.kt | 41 -- .../red/chamber/RedHighChamber1.kt | 41 -- .../red/chamber/RedHighChamber2.kt | 41 -- .../red/park/RedParkObservation1.kt | 39 -- .../red/park/RedParkObservation2.kt | 39 -- .../red/park/RedParkObservationLeft.kt | 39 -- .../red/park/RedParkObservationRight.kt | 39 -- .../red/park/RedParkTouchSubmmersible1.kt | 42 -- .../red/park/RedParkTouchSubmmersible2.kt | 42 -- .../red/park/RedParkTouchSubmmersibleLeft.kt | 42 -- .../red/park/RedParkTouchSubmmersibleRight.kt | 42 -- TeamCode/build.gradle | 5 +- .../org/firstinspires/ftc/teamcode/Drawing.kt | 18 + .../firstinspires/ftc/teamcode/Localizer.kt | 8 + .../ftc/teamcode/MecanumDrive.kt | 516 ++++++++++++++++++ .../firstinspires/ftc/teamcode/TankDrive.kt | 509 +++++++++++++++++ .../ftc/teamcode/ThreeDeadWheelLocalizer.kt | 107 ++++ .../ftc/teamcode/TwoDeadWheelLocalizer.kt | 138 +++++ .../teamcode/messages/DriveCommandMessage.kt | 14 + .../messages/MecanumCommandMessage.kt | 11 + .../messages/MecanumLocalizerInputsMessage.kt | 26 + .../ftc/teamcode/messages/PoseMessage.kt | 11 + .../teamcode/messages/TankCommandMessage.kt | 5 + .../messages/TankLocalizerInputsMessage.kt | 12 + .../messages/ThreeDeadWheelInputsMessage.kt | 11 + .../messages/TwoDeadWheelInputsMessage.kt | 34 ++ .../ftc/teamcode/tuning/LocalizationTest.kt | 79 +++ .../teamcode/tuning/ManualFeedbackTuner.kt | 66 +++ .../ftc/teamcode/tuning/SplineTest.kt | 44 ++ .../ftc/teamcode/tuning/TuningOpModes.kt | 212 +++++++ build.common.gradle | 2 +- build.dependencies.gradle | 18 +- build.gradle | 2 +- 68 files changed, 2620 insertions(+), 991 deletions(-) delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/basket/BlueHighBasket1.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/basket/BlueHighBasket2.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/chamber/BlueHighChamberLeft.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/chamber/BlueHighChamberRight.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/main/BlueAuto.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/main/BlueAutoLeft.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkObservationLeft.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkObservationRight.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkTouchSubmmersibleLeft.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkTouchSubmmersibleRight.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/basket/BlueHighBasket1.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/basket/BlueHighBasket2.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/chamber/BlueHighChamberLeft.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/chamber/BlueHighChamberRight.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/main/BlueAuto.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/main/BlueAutoLeft.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkObservationLeft.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkObservationRight.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkTouchSubmmersibleLeft.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkTouchSubmmersibleRight.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/basket/RedHighBasket1.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/basket/RedHighBasket2.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/chamber/RedHighChamber1.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/chamber/RedHighChamber2.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservation1.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservation2.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservationLeft.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservationRight.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersible1.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersible2.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersibleLeft.kt create mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersibleRight.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/basket/RedHighBasket1.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/basket/RedHighBasket2.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/chamber/RedHighChamber1.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/chamber/RedHighChamber2.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservation1.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservation2.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservationLeft.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservationRight.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersible1.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersible2.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersibleLeft.kt delete mode 100644 PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersibleRight.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Drawing.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Localizer.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MecanumDrive.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TankDrive.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ThreeDeadWheelLocalizer.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TwoDeadWheelLocalizer.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/messages/DriveCommandMessage.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/messages/MecanumCommandMessage.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/messages/MecanumLocalizerInputsMessage.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/messages/PoseMessage.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/messages/TankCommandMessage.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/messages/TankLocalizerInputsMessage.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/messages/ThreeDeadWheelInputsMessage.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/messages/TwoDeadWheelInputsMessage.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/tuning/LocalizationTest.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/tuning/ManualFeedbackTuner.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/tuning/SplineTest.kt create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/tuning/TuningOpModes.kt diff --git a/.idea/misc.xml b/.idea/misc.xml index 4d5607a..3c82750 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,3 +1,4 @@ + @@ -6,7 +7,7 @@ - + diff --git a/PathPlanning/build.gradle b/PathPlanning/build.gradle index 2ad6b8d..1b659eb 100644 --- a/PathPlanning/build.gradle +++ b/PathPlanning/build.gradle @@ -15,6 +15,6 @@ repositories { } dependencies { - implementation 'com.github.NoahBres:MeepMeep:2.0.3' - implementation 'com.acmerobotics.roadrunner:core:0.5.6' + implementation 'com.acmerobotics.roadrunner:MeepMeep:0.1.6' + implementation 'com.acmerobotics.roadrunner:core:1.0.0' } \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/basket/BlueHighBasket1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/basket/BlueHighBasket1.kt deleted file mode 100644 index ec37eec..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/basket/BlueHighBasket1.kt +++ /dev/null @@ -1,41 +0,0 @@ -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) { - 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())) - .turn((90.0).toRadians()) - .forward(60.0) - .waitSeconds(2.0) - .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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/basket/BlueHighBasket2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/basket/BlueHighBasket2.kt deleted file mode 100644 index 869bf51..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/basket/BlueHighBasket2.kt +++ /dev/null @@ -1,28 +0,0 @@ -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 - -object BlueHighBasket2 { - @JvmStatic - fun main(args: Array) { - 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())) - .turn((90.0).toRadians()) - .forward(35.0) - .waitSeconds(2.0) - .build() - } - meepMeep.setBackground(MeepMeep.Background.FIELD_CENTERSTAGE_JUICE_DARK) - .setDarkMode(true) - .setBackgroundAlpha(0.95f) - .addEntity(myBot) - .start() - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/chamber/BlueHighChamberLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/chamber/BlueHighChamberLeft.kt deleted file mode 100644 index 61c97bf..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/chamber/BlueHighChamberLeft.kt +++ /dev/null @@ -1,41 +0,0 @@ -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 BlueHighChamberLeft { - @JvmStatic - fun main(args: Array) { - 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())) - .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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/chamber/BlueHighChamberRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/chamber/BlueHighChamberRight.kt deleted file mode 100644 index 0228f5e..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/chamber/BlueHighChamberRight.kt +++ /dev/null @@ -1,41 +0,0 @@ -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 BlueHighChamberRight { - @JvmStatic - fun main(args: Array) { - 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())) - .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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/main/BlueAuto.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/main/BlueAuto.kt deleted file mode 100644 index 87f70a3..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/main/BlueAuto.kt +++ /dev/null @@ -1,117 +0,0 @@ -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) { - 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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/main/BlueAutoLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/main/BlueAutoLeft.kt deleted file mode 100644 index 3071ac1..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/main/BlueAutoLeft.kt +++ /dev/null @@ -1,55 +0,0 @@ -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 BlueAutoLeft { - @JvmStatic - - fun main(args: Array) { - 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())) - .turn((90.0).toRadians()) - .forward(60.0) - .waitSeconds(4.0) - .turn((-90.0).toRadians()) - .waitSeconds(6.0) - .turn((90.0).toRadians()) - .waitSeconds(4.0) - .turn((-90.0).toRadians()) - .waitSeconds(6.0) - .turn((90.0).toRadians()) - .waitSeconds(4.0) - .turn((-90.0).toRadians()) - .waitSeconds(6.0) - .turn((90.0).toRadians()) - .waitSeconds(4.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() - } - } -} diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkObservationLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkObservationLeft.kt deleted file mode 100644 index c961fd0..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkObservationLeft.kt +++ /dev/null @@ -1,39 +0,0 @@ -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 BlueParkObservationLeft { - @JvmStatic - fun main(args: Array) { - 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())) - .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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkObservationRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkObservationRight.kt deleted file mode 100644 index 1ed2d8d..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkObservationRight.kt +++ /dev/null @@ -1,39 +0,0 @@ -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 BlueParkObservationRight { - @JvmStatic - fun main(args: Array) { - 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())) - .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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkTouchSubmmersibleLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkTouchSubmmersibleLeft.kt deleted file mode 100644 index 6d4e19e..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkTouchSubmmersibleLeft.kt +++ /dev/null @@ -1,44 +0,0 @@ -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 BlueParkTouchSubmmersibleLeft { - - @JvmStatic - fun main(args: Array) { - 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())) - .forward(25.0) - .strafeLeft(48.0) - .forward(25.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() - } - } -} - diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkTouchSubmmersibleRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkTouchSubmmersibleRight.kt deleted file mode 100644 index 5b0a94d..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/blue/park/BlueParkTouchSubmmersibleRight.kt +++ /dev/null @@ -1,42 +0,0 @@ -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 BlueParkTouchSubmmersibleRight { - @JvmStatic - fun main(args: Array) { - 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())) - .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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/basket/BlueHighBasket1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/basket/BlueHighBasket1.kt new file mode 100644 index 0000000..cede8a9 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/basket/BlueHighBasket1.kt @@ -0,0 +1,32 @@ +package com.example.pathplanning.legacy.blue.basket + +//object BlueHighBasket1 { +// @JvmStatic +// fun main(args: Array) { +// 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())) +// .turn((90.0).toRadians()) +// .forward(60.0) +// .waitSeconds(2.0) +// .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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/basket/BlueHighBasket2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/basket/BlueHighBasket2.kt new file mode 100644 index 0000000..089bd61 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/basket/BlueHighBasket2.kt @@ -0,0 +1,23 @@ +package com.example.pathplanning.legacy.blue.basket + +//object BlueHighBasket2 { +// @JvmStatic +// fun main(args: Array) { +// 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())) +// .turn((90.0).toRadians()) +// .forward(35.0) +// .waitSeconds(2.0) +// .build() +// } +// meepMeep.setBackground(MeepMeep.Background.FIELD_CENTERSTAGE_JUICE_DARK) +// .setDarkMode(true) +// .setBackgroundAlpha(0.95f) +// .addEntity(myBot) +// .start() +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/chamber/BlueHighChamberLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/chamber/BlueHighChamberLeft.kt new file mode 100644 index 0000000..19c0e24 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/chamber/BlueHighChamberLeft.kt @@ -0,0 +1,32 @@ +package com.example.pathplanning.legacy.blue.chamber + +//object BlueHighChamberLeft { +// @JvmStatic +// fun main(args: Array) { +// 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())) +// .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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/chamber/BlueHighChamberRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/chamber/BlueHighChamberRight.kt new file mode 100644 index 0000000..56398a9 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/chamber/BlueHighChamberRight.kt @@ -0,0 +1,32 @@ +package com.example.pathplanning.legacy.blue.chamber + +//object BlueHighChamberRight { +// @JvmStatic +// fun main(args: Array) { +// 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())) +// .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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/main/BlueAuto.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/main/BlueAuto.kt new file mode 100644 index 0000000..31599d2 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/main/BlueAuto.kt @@ -0,0 +1,108 @@ +package com.example.pathplanning.legacy.blue.main + +//object BlueAuto { +// @JvmStatic +// +// fun main(args: Array) { +// 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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/main/BlueAutoLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/main/BlueAutoLeft.kt new file mode 100644 index 0000000..66d6d9a --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/main/BlueAutoLeft.kt @@ -0,0 +1,46 @@ +package com.example.pathplanning.legacy.blue.main + +//object BlueAutoLeft { +// @JvmStatic +// +// fun main(args: Array) { +// 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())) +// .turn((90.0).toRadians()) +// .forward(60.0) +// .waitSeconds(4.0) +// .turn((-90.0).toRadians()) +// .waitSeconds(6.0) +// .turn((90.0).toRadians()) +// .waitSeconds(4.0) +// .turn((-90.0).toRadians()) +// .waitSeconds(6.0) +// .turn((90.0).toRadians()) +// .waitSeconds(4.0) +// .turn((-90.0).toRadians()) +// .waitSeconds(6.0) +// .turn((90.0).toRadians()) +// .waitSeconds(4.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() +// } +// } +//} diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkObservationLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkObservationLeft.kt new file mode 100644 index 0000000..5241d2f --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkObservationLeft.kt @@ -0,0 +1,30 @@ +package com.example.pathplanning.legacy.blue.park + +//object BlueParkObservationLeft { +// @JvmStatic +// fun main(args: Array) { +// 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())) +// .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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkObservationRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkObservationRight.kt new file mode 100644 index 0000000..d417d6e --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkObservationRight.kt @@ -0,0 +1,30 @@ +package com.example.pathplanning.legacy.blue.park + +//object BlueParkObservationRight { +// @JvmStatic +// fun main(args: Array) { +// 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())) +// .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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkTouchSubmmersibleLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkTouchSubmmersibleLeft.kt new file mode 100644 index 0000000..1c1d2e8 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkTouchSubmmersibleLeft.kt @@ -0,0 +1,35 @@ +package com.example.pathplanning.legacy.blue.park + +//object BlueParkTouchSubmmersibleLeft { +// +// @JvmStatic +// fun main(args: Array) { +// 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())) +// .forward(25.0) +// .strafeLeft(48.0) +// .forward(25.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() +// } +// } +//} + diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkTouchSubmmersibleRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkTouchSubmmersibleRight.kt new file mode 100644 index 0000000..7e4e582 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/blue/park/BlueParkTouchSubmmersibleRight.kt @@ -0,0 +1,33 @@ +package com.example.pathplanning.legacy.blue.park + +//object BlueParkTouchSubmmersibleRight { +// @JvmStatic +// fun main(args: Array) { +// 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())) +// .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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/basket/RedHighBasket1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/basket/RedHighBasket1.kt new file mode 100644 index 0000000..8d9c418 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/basket/RedHighBasket1.kt @@ -0,0 +1,32 @@ +package com.example.pathplanning.legacy.red.basket + +//object RedHighBasket1 { +// @JvmStatic +// fun main(args: Array) { +// 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, (90.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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/basket/RedHighBasket2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/basket/RedHighBasket2.kt new file mode 100644 index 0000000..75c070a --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/basket/RedHighBasket2.kt @@ -0,0 +1,32 @@ +package com.example.pathplanning.legacy.red.basket + +//object RedHighBasket2 { +// @JvmStatic +// fun main(args: Array) { +// 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, (90.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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/chamber/RedHighChamber1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/chamber/RedHighChamber1.kt new file mode 100644 index 0000000..732f65f --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/chamber/RedHighChamber1.kt @@ -0,0 +1,32 @@ +package com.example.pathplanning.legacy.red.chamber + +//object RedHighChamber1 { +// @JvmStatic +// fun main(args: Array) { +// 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, (90.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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/chamber/RedHighChamber2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/chamber/RedHighChamber2.kt new file mode 100644 index 0000000..1d24767 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/chamber/RedHighChamber2.kt @@ -0,0 +1,32 @@ +package com.example.pathplanning.legacy.red.chamber + +//object RedHighChamber2 { +// @JvmStatic +// fun main(args: Array) { +// 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, (90.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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservation1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservation1.kt new file mode 100644 index 0000000..2320483 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservation1.kt @@ -0,0 +1,30 @@ +package com.example.pathplanning.legacy.red.park + +//object RedParkObservation1 { +// @JvmStatic +// fun main(args: Array) { +// 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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservation2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservation2.kt new file mode 100644 index 0000000..236f8ed --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservation2.kt @@ -0,0 +1,30 @@ +package com.example.pathplanning.legacy.red.park + +//object RedParkObservation2 { +// @JvmStatic +// fun main(args: Array) { +// 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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservationLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservationLeft.kt new file mode 100644 index 0000000..7463d76 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservationLeft.kt @@ -0,0 +1,30 @@ +package com.example.pathplanning.legacy.red.park + +//object RedParkObservationLeft { +// @JvmStatic +// fun main(args: Array) { +// 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, (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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservationRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservationRight.kt new file mode 100644 index 0000000..33b6e1e --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkObservationRight.kt @@ -0,0 +1,30 @@ +package com.example.pathplanning.legacy.red.park + +//object RedParkObservationRight { +// @JvmStatic +// fun main(args: Array) { +// 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, (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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersible1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersible1.kt new file mode 100644 index 0000000..5f5efdf --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersible1.kt @@ -0,0 +1,33 @@ +package com.example.pathplanning.legacy.red.park + +//object RedParkTouchSubmmersible1 { +// @JvmStatic +// fun main(args: Array) { +// 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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersible2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersible2.kt new file mode 100644 index 0000000..07f4656 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersible2.kt @@ -0,0 +1,33 @@ +package com.example.pathplanning.legacy.red.park + +//object RedParkTouchSubmmersible2 { +// @JvmStatic +// fun main(args: Array) { +// 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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersibleLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersibleLeft.kt new file mode 100644 index 0000000..0a6d671 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersibleLeft.kt @@ -0,0 +1,33 @@ +package com.example.pathplanning.legacy.red.park + +//object RedParkTouchSubmmersibleLeft { +// @JvmStatic +// fun main(args: Array) { +// 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, (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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersibleRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersibleRight.kt new file mode 100644 index 0000000..3070c03 --- /dev/null +++ b/PathPlanning/src/main/kotlin/com/example/pathplanning/legacy/red/park/RedParkTouchSubmmersibleRight.kt @@ -0,0 +1,33 @@ +package com.example.pathplanning.legacy.red.park + +//object RedParkTouchSubmmersibleRight { +// @JvmStatic +// fun main(args: Array) { +// 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, (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() +// } +// } +//} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/basket/RedHighBasket1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/basket/RedHighBasket1.kt deleted file mode 100644 index b8fda6a..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/basket/RedHighBasket1.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.example.pathplanning.red.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 RedHighBasket1 { - @JvmStatic - fun main(args: Array) { - 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, (90.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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/basket/RedHighBasket2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/basket/RedHighBasket2.kt deleted file mode 100644 index 9fb198d..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/basket/RedHighBasket2.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.example.pathplanning.red.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 RedHighBasket2 { - @JvmStatic - fun main(args: Array) { - 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, (90.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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/chamber/RedHighChamber1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/chamber/RedHighChamber1.kt deleted file mode 100644 index f7fa453..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/chamber/RedHighChamber1.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.example.pathplanning.red.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 RedHighChamber1 { - @JvmStatic - fun main(args: Array) { - 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, (90.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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/chamber/RedHighChamber2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/chamber/RedHighChamber2.kt deleted file mode 100644 index 01b6338..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/chamber/RedHighChamber2.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.example.pathplanning.red.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 RedHighChamber2 { - @JvmStatic - fun main(args: Array) { - 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, (90.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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservation1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservation1.kt deleted file mode 100644 index 4b7c00f..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservation1.kt +++ /dev/null @@ -1,39 +0,0 @@ -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) { - 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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservation2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservation2.kt deleted file mode 100644 index 1eb1541..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservation2.kt +++ /dev/null @@ -1,39 +0,0 @@ -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) { - 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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservationLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservationLeft.kt deleted file mode 100644 index 0699e99..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservationLeft.kt +++ /dev/null @@ -1,39 +0,0 @@ -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 RedParkObservationLeft { - @JvmStatic - fun main(args: Array) { - 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, (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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservationRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservationRight.kt deleted file mode 100644 index a581f21..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkObservationRight.kt +++ /dev/null @@ -1,39 +0,0 @@ -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 RedParkObservationRight { - @JvmStatic - fun main(args: Array) { - 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, (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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersible1.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersible1.kt deleted file mode 100644 index 3cfa9de..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersible1.kt +++ /dev/null @@ -1,42 +0,0 @@ -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) { - 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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersible2.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersible2.kt deleted file mode 100644 index aab5b61..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersible2.kt +++ /dev/null @@ -1,42 +0,0 @@ -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) { - 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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersibleLeft.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersibleLeft.kt deleted file mode 100644 index 095b1b7..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersibleLeft.kt +++ /dev/null @@ -1,42 +0,0 @@ -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 RedParkTouchSubmmersibleLeft { - @JvmStatic - fun main(args: Array) { - 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, (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() - } - } -} \ No newline at end of file diff --git a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersibleRight.kt b/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersibleRight.kt deleted file mode 100644 index 6153cae..0000000 --- a/PathPlanning/src/main/kotlin/com/example/pathplanning/red/park/RedParkTouchSubmmersibleRight.kt +++ /dev/null @@ -1,42 +0,0 @@ -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 RedParkTouchSubmmersibleRight { - @JvmStatic - fun main(args: Array) { - 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, (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() - } - } -} \ No newline at end of file diff --git a/TeamCode/build.gradle b/TeamCode/build.gradle index b7b3b13..9e39ac3 100644 --- a/TeamCode/build.gradle +++ b/TeamCode/build.gradle @@ -35,10 +35,11 @@ android { dependencies { implementation project(':FtcRobotController') - implementation 'androidx.core:core-ktx:1.13.1' annotationProcessor files('lib/OpModeAnnotationProcessor.jar') implementation 'org.apache.commons:commons-math3:3.6.1' - implementation 'com.acmerobotics.roadrunner:core:0.5.6' + implementation 'com.acmerobotics.roadrunner:core:1.0.0' + implementation 'com.acmerobotics.roadrunner:actions:1.0.0' implementation 'org.ftclib.ftclib:core:2.1.1' // core + implementation 'androidx.core:core-ktx:1.15.0' } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Drawing.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Drawing.kt new file mode 100644 index 0000000..45466e1 --- /dev/null +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Drawing.kt @@ -0,0 +1,18 @@ +package org.firstinspires.ftc.teamcode + +import com.acmerobotics.dashboard.canvas.Canvas +import com.acmerobotics.roadrunner.Pose2d + +object Drawing { + fun drawRobot(c: Canvas, t: Pose2d) { + val ROBOT_RADIUS = 9.0 + + c.setStrokeWidth(1) + c.strokeCircle(t.position.x, t.position.y, ROBOT_RADIUS) + + val halfv = t.heading.vec().times(0.5 * ROBOT_RADIUS) + val p1 = t.position.plus(halfv) + val p2 = p1.plus(halfv) + c.strokeLine(p1.x, p1.y, p2.x, p2.y) + } +} diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Localizer.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Localizer.kt new file mode 100644 index 0000000..fa5428e --- /dev/null +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Localizer.kt @@ -0,0 +1,8 @@ +package org.firstinspires.ftc.teamcode + +import com.acmerobotics.roadrunner.Time +import com.acmerobotics.roadrunner.Twist2dDual + +interface Localizer { + fun update(): Twist2dDual