State merge #57

Merged
Arcmyx merged 43 commits from dev into main 2026-01-14 17:33:15 +00:00
Showing only changes of commit fa28fbb086 - Show all commits

View File

@@ -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):