Update hazmat_scrimmage/bioglow_helpers.py
This commit is contained in:
@@ -162,52 +162,17 @@ async def monitor_distance(stop_mm: int = WALL_DISTANCE):
|
||||
|
||||
# Use this to set default
|
||||
def set_default_speed():
|
||||
drive_base.settings(600, 500, 300, 200)
|
||||
drive_base.settings(800, 600, 300, 200)
|
||||
|
||||
# Use this to change drive base movement
|
||||
def set_speed(straight_speed, st_acc, turn_speed, turn_acc):
|
||||
drive_base.settings(straight_speed, st_acc, turn_speed, turn_acc)
|
||||
|
||||
async def multilift_up(rotation_angle):
|
||||
async def multilift(rotation_angle):
|
||||
await multitask(
|
||||
right_arm.run_angle(400,rotation_angle),
|
||||
left_arm.run_angle(400,-1*rotation_angle)
|
||||
)
|
||||
|
||||
async def multilift_down(rotation_angle):
|
||||
await multitask(
|
||||
right_arm.run_angle(1000,-1*rotation_angle),
|
||||
left_arm.run_angle(1000,rotation_angle)
|
||||
)
|
||||
|
||||
async def drive_until_stalled(max_distance):
|
||||
stalled_flag = False
|
||||
|
||||
async def drive_task():
|
||||
await drive_base.straight(max_distance)
|
||||
|
||||
async def stall_watch():
|
||||
nonlocal stalled_flag
|
||||
while not (left_motor.control.stalled() and right_motor.control.stalled()):
|
||||
await wait(10)
|
||||
stalled_flag = True
|
||||
drive_base.stop()
|
||||
print("Both wheels stalled — robot is stuck!")
|
||||
|
||||
await multitask(drive_task(), stall_watch(), race=True)
|
||||
return stalled_flag
|
||||
|
||||
def reset_arms():
|
||||
left_arm.reset_angle(0)
|
||||
right_arm.reset_angle(0)
|
||||
print('limits before:')
|
||||
print(left_arm.control.limits())
|
||||
print(left_arm.control.limits())
|
||||
|
||||
left_arm.control.limits(speed=1100, acceleration=2000)
|
||||
right_arm.control.limits(speed=1100, acceleration=2000)
|
||||
|
||||
print('limits after:')
|
||||
print(left_arm.control.limits())
|
||||
print(left_arm.control.limits())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user