From 13a84719ce5d672245997cb7128302a262aa38bb Mon Sep 17 00:00:00 2001 From: GZod01 Date: Fri, 8 Mar 2024 15:57:46 +0100 Subject: [PATCH] add some stuff --- README.md | 5 +- ...nome_api.java => ftc2024_autonome_api.java | 54 ++++++++++++++++--- hello | 1 - 3 files changed, 52 insertions(+), 8 deletions(-) rename autonome_api.java => ftc2024_autonome_api.java (62%) delete mode 100644 hello diff --git a/README.md b/README.md index 54e68ad..9d5f74a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# ftc2024-robotcode +# The 2024 [FIRSTĀ®](https://firstinspires.org) Tech Challenge robot competition WeRobot code + +## Requirements +Work only with Rev Robotics Control Hub designed for [FIRSTĀ®](https://firstinspires.org) Tech Challenge competitions diff --git a/autonome_api.java b/ftc2024_autonome_api.java similarity index 62% rename from autonome_api.java rename to ftc2024_autonome_api.java index 273df72..207eb84 100644 --- a/autonome_api.java +++ b/ftc2024_autonome_api.java @@ -22,6 +22,7 @@ import com.qualcomm.robotcore.util.ElapsedTime; @Autonomous public class ftc2024_autonome_api extends LinearOpMode { + public String autonomous_mode; public DcMotor lm; public DcMotor rm; public DcMotor harvestmotor; @@ -51,12 +52,53 @@ public class ftc2024_autonome_api extends LinearOpMode { robotOrientation = imu.getYawPitchRollAngles(); if(opModeIsRunning()){ - robot.forward(0.5); - robot.rotate(-90.0); - robot.forward(1.5); - robot.harvest(-1); - robot.backward(1); - robot.harvest(0); + /* + * autonomous_mode differents possibles values respect the next scheme: + * team_color_shortcode + start_line_index + direct_or_no + * + * team_color_shortcode = "b" for blue & "r" for red + * start_line_index = 4 or 2 see competition manual appendix B Tile location plan + * direct_or_no = "d" to direct go to pixel deliver zone or "n" to harvest pixels before to go in deliver zone + * + * default is "b4d" + */ + switch (autonomous_mode){ + default: + robot.forward(0.5); + robot.rotate(-90.0); + robot.forward(1.5); + robot.harvest(-1); + robot.backward(1); + robot.harvest(0); + break; + case ("b2d"): + robot.forward(0.5); + robot.rotate(-90.0); + robot.forward(2.5); + robot.harvest(-1); + robot.backward(1); + robot.harvest(0); + break; + case ("r4d"): + + break; + case ("r2d"): + + break; + + case ("b4n"): + + break; + case ("b2n"): + + break; + case ("r4n"): + + break; + case ("r2n"): + + break; + } } } } diff --git a/hello b/hello deleted file mode 100644 index 31e0fce..0000000 --- a/hello +++ /dev/null @@ -1 +0,0 @@ -helloworld