From 4233cc5f742193b52aebac3f8e55b402b5fdd0f9 Mon Sep 17 00:00:00 2001 From: Johannes <31liwaj@elmbrookstudents.org> Date: Sun, 4 Jan 2026 18:09:47 +0000 Subject: [PATCH] Update competition_codes/state/sunprarie_state_main.py Various updates to a few of the codes. --- competition_codes/state/sunprarie_state_main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/competition_codes/state/sunprarie_state_main.py b/competition_codes/state/sunprarie_state_main.py index 95646be..16e2bc3 100644 --- a/competition_codes/state/sunprarie_state_main.py +++ b/competition_codes/state/sunprarie_state_main.py @@ -1,3 +1,5 @@ +#Important Notice: All codes should be tested while the robot's battery is at 100%, and all updates must be made when the robot is at full charge. + from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor from pybricks.parameters import Button, Color, Direction, Port, Side, Stop from pybricks.tools import run_task, multitask @@ -104,7 +106,7 @@ async def solve_whats_on_sale(): async def solve_silo(): await drive_base.straight(-80) await drive_base.turn(42) - await drive_base.straight(90) + await drive_base.straight(95) SPEED = 10000 # speed in degree per second SWING_ANGLE = 80 # the angle! @@ -199,7 +201,7 @@ async def Run3(): ) async def solve_angler_artifacts(): - await drive_base.straight(890) + await drive_base.straight(870) await drive_base.turn(-90,Stop.HOLD) await drive_base.straight(45) #Solve @@ -386,14 +388,14 @@ async def Run12(): # experimental careful recovery attachment await right_arm.run_target(2000,-120) right_arm.reset_angle(0) - await drive_base.straight(190) # Slowly move straight to mineshaft 190 mm + await drive_base.straight(180) # Slowly move straight to mineshaft 180 mm await right_arm.run_angle(100,95,Stop.HOLD) # Raise mineshaft await wait(50) await left_arm.run_angle(100,60) # recover artifact by lifting arm 60 degrees # Moving back - await drive_base.straight(-200) + await drive_base.straight(-190) # Return home set_default_speed() # change movement robot movement to fast