Compare commits
2 Commits
d4e44bb53f
...
atharv-dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 489ff94601 | |||
| 05be290f90 |
@@ -31,9 +31,6 @@ async def drive_backward():
|
|||||||
"""Drive forward continuously using DriveBase."""
|
"""Drive forward continuously using DriveBase."""
|
||||||
drive_base.drive(400, 0)
|
drive_base.drive(400, 0)
|
||||||
|
|
||||||
async def async_drive(speed, direction):
|
|
||||||
drive_base.d
|
|
||||||
|
|
||||||
|
|
||||||
async def monitor_distance():
|
async def monitor_distance():
|
||||||
"""Monitor ultrasonic sensor and stop when wall is detected."""
|
"""Monitor ultrasonic sensor and stop when wall is detected."""
|
||||||
@@ -46,11 +43,14 @@ async def monitor_distance():
|
|||||||
drive_base.stop()
|
drive_base.stop()
|
||||||
print(f"Wall detected at {distance}mm!")
|
print(f"Wall detected at {distance}mm!")
|
||||||
break
|
break
|
||||||
|
if distance is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
# Small delay to prevent overwhelming the sensor
|
# Small delay to prevent overwhelming the sensor
|
||||||
await wait(50)
|
await wait(50)
|
||||||
|
|
||||||
# Experimental - Removed forge and who live here part
|
# Experimental - Removed forge and who lived here part
|
||||||
async def Run1(): # From M8_5.py
|
async def Run1(): # From M8_5.py
|
||||||
right_arm.run_angle(500,30)
|
right_arm.run_angle(500,30)
|
||||||
left_arm.run_angle(500,90)
|
left_arm.run_angle(500,90)
|
||||||
@@ -131,7 +131,7 @@ async def Run2_1():
|
|||||||
await drive_base.straight(-50)
|
await drive_base.straight(-50)
|
||||||
await drive_base.turn(-100)
|
await drive_base.turn(-100)
|
||||||
await drive_base.arc(-500,None,600)
|
await drive_base.arc(-500,None,600)
|
||||||
drive_base.brake()
|
drive_base.stop()
|
||||||
|
|
||||||
|
|
||||||
async def Run3(): # tip the scale.py
|
async def Run3(): # tip the scale.py
|
||||||
@@ -145,7 +145,7 @@ async def Run3(): # tip the scale.py
|
|||||||
await drive_base.straight(-100)
|
await drive_base.straight(-100)
|
||||||
await drive_base.turn(90)
|
await drive_base.turn(90)
|
||||||
await drive_base.straight(800)
|
await drive_base.straight(800)
|
||||||
drive_base.brake()
|
drive_base.stop()
|
||||||
|
|
||||||
|
|
||||||
async def Run4(): # From Send_Over_Final.py
|
async def Run4(): # From Send_Over_Final.py
|
||||||
|
|||||||
Reference in New Issue
Block a user