From fa28fbb0864a841e40c7d2939ef1ce5a5f8e4e87 Mon Sep 17 00:00:00 2001 From: Johannes <31liwaj@elmbrookstudents.org> Date: Thu, 8 Jan 2026 23:21:51 +0000 Subject: [PATCH] Update competition_codes/state/sunprarie_state_main.py --- .../state/sunprarie_state_main.py | 51 +++++-------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/competition_codes/state/sunprarie_state_main.py b/competition_codes/state/sunprarie_state_main.py index 4f79446..4b0cebb 100644 --- a/competition_codes/state/sunprarie_state_main.py +++ b/competition_codes/state/sunprarie_state_main.py @@ -406,9 +406,9 @@ async def Run11(): # experimental surface brushing attachment #left_arm.run_angle(300,218) set_default_speed() - await drive_base.straight(-80) + await drive_base.straight(-100) await drive_base.turn(30) - await drive_base.straight(-180) + await drive_base.straight(-190) #await drive_base.straight(400) #await left_arm.run_angle(50,120) #await drive_base.straight(-200) @@ -416,44 +416,21 @@ async def Run11(): # experimental surface brushing attachment await drive_base.straight(-600) drive_base.stop() -async def Run12(): # experimental careful recovery attachment - - right_arm.reset_angle(0) - # This raises the left arm to avoid entanglement when turning - await left_arm.run_angle(2000, 180) # Fast movement upward - # Gentle stall detection (shorter distance = faster) - await left_arm.run_until_stalled(1500, duty_limit=15) - left_arm.reset_angle(0) - - # Drive the robot to the wall +async def Run12(): await drive_base.straight(900) - await drive_base.turn(83) # Align robot to Mineshaft entrance - - # This change robot movement to slow - drive_base.settings(100, 100, 50, 500) - - # Bring down left arm to position - await left_arm.run_angle(2000, -180) - await left_arm.run_until_stalled(-1500,duty_limit=15) + await drive_base.turn(83) + await left_arm.run_angle(3000, -300) + await right_arm.run_angle(1100, -180) + drive_base.settings(150, 50, 50, 50) + await drive_base.straight(120) left_arm.reset_angle(0) + await left_arm.run_angle(50, 50) + await right_arm.run_angle(50, 90) + await drive_base.straight(-100) + drive_base.settings(950, 750, 750, 750) + await drive_base.turn(110) + await drive_base.straight(1000) - # Bring down right arm to position - await right_arm.run_target(2000,-120) - right_arm.reset_angle(0) - - await drive_base.straight(180) # Slowly move straight to mineshaft 180 mm - - await right_arm.run_angle(100,95,Stop.HOLD) # Raise mineshaft - await left_arm.run_angle(100,60) # recover artifact by lifting arm 60 degrees - - # Moving back - await drive_base.straight(-190) - - # Return home - set_default_speed() # change movement robot movement to fast - await drive_base.turn(100) - await drive_base.straight(700) - drive_base.stop() # Function to classify color based on HSV def detect_color(h, s, v, reflected):