Delete regionals/bioglow_missions_15_14_ant.py
El Cleanup.
This commit is contained in:
@@ -1,69 +0,0 @@
|
|||||||
#####################################
|
|
||||||
# Solution for BioGlow Mission 14,15
|
|
||||||
#####################################
|
|
||||||
|
|
||||||
import robot # drive base, arms, sensors and moves all come from robot.py
|
|
||||||
|
|
||||||
# UNITS used in this file -----------------------------------------------------
|
|
||||||
# robot.move(cm) distance in cm (+ forward, - backward)
|
|
||||||
# robot.turn(degrees) degrees (+ right / clockwise, - left)
|
|
||||||
# robot.arc(radius_cm, ...) radius in cm (+ circle on the right, - on the left),
|
|
||||||
# then degrees= around the circle or cm= along it (+ forward, - backward)
|
|
||||||
# speed= % of top speed, 1-100 (normal: 80% drive, 72% turn)
|
|
||||||
# acceleration= how fast it speeds up and slows down:
|
|
||||||
# mm/s² for move/arc (normal 500), °/s² for turn (normal 200)
|
|
||||||
# (² means "per second": 200 mm/s² = 200 mm/s faster every second)
|
|
||||||
# arm.move_by(degrees, speed=) arm turn in degrees, speed in % of the arm's top speed
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
async def solve_missions(): # Seed of Renewal and Keystone Species - Parthiv
|
|
||||||
|
|
||||||
# --- ARM HOMING (optional) -------------------------------------------
|
|
||||||
# Uncomment the next line to push both arms gently against their hard stops
|
|
||||||
# and call that spot 0, so every arm move starts from the same place each run.
|
|
||||||
# Before using it: set home_backward for each arm in robot.py (run arm_calibrate.py).
|
|
||||||
# await robot.home_arms()
|
|
||||||
|
|
||||||
# --- LET THE GYRO SETTLE ----------------------------------------------
|
|
||||||
# Wait half a second (and until the hub is perfectly still) before moving,
|
|
||||||
# so turns are measured from a steady heading.
|
|
||||||
await robot.settle_gyro()
|
|
||||||
# BLUE COLOR CODE
|
|
||||||
robot.stop()
|
|
||||||
robot.reset()
|
|
||||||
|
|
||||||
|
|
||||||
await robot.left_arm.move_by(-40, speed=100) # left arm -25°, 100% arm speed
|
|
||||||
await robot.arc(-31.5, degrees=90, speed=74, turn_speed=68, acceleration=200, turn_acceleration=100, then=robot.Stop.HOLD) # arc: circle on the robot's LEFT (31.5 cm radius), FORWARD 90° (nose turns left) | 74% speed, 48% turn speed, 200 mm/s² accel, 100 °/s² turn accel
|
|
||||||
await robot.move(15, speed=100, acceleration=400, then=robot.Stop.HOLD) # 15 cm forward, 74% speed, 200 mm/s² accel
|
|
||||||
await robot.turn(90, speed=100, acceleration=200, then=robot.Stop.HOLD) # 90° right, 48% turn speed, 100 °/s² turn accel
|
|
||||||
await robot.move(23.5, speed=100, acceleration=270, then=robot.Stop.NONE) # 23.5 cm forward, 74% speed, 200 mm/s² accel
|
|
||||||
await robot.turn(-85, then=robot.Stop.HOLD) # 85° left
|
|
||||||
await robot.move(9, speed=18, acceleration=200, then=robot.Stop.COAST) # 9 cm forward, 18% speed, 200 mm/s² accel
|
|
||||||
await robot.move(-9.5, speed=18, acceleration=200) # 9.5 cm backward, 18% speed, 200 mm/s² accel
|
|
||||||
await robot.turn(-85) # 85° left
|
|
||||||
await robot.move(-25, speed=100, acceleration=300) # 25 cm backward, 18% speed, 200 mm/s² accel
|
|
||||||
await robot.turn(60) # 60° right
|
|
||||||
await robot.move(-19, speed=9, acceleration=200) # 17.5 cm backward, 9% speed, 200 mm/s² accel
|
|
||||||
await robot.move(12, speed=9, acceleration=200) # 10 cm forward, 9% speed, 200 mm/s² accel
|
|
||||||
await robot.turn(-130, speed=25) # 125° left, 40% turn speed
|
|
||||||
await robot.left_arm.move_by(40, speed=47) # left arm 21°, 47% arm speed
|
|
||||||
await robot.turn(-21, speed=40) # 21° left, 40% turn speed
|
|
||||||
#moving toward miselium
|
|
||||||
await robot.move(5, speed=9, acceleration=100) # 2.5 cm forward, 9% speed, 200 mm/s² accel
|
|
||||||
await robot.left_arm.move_by(-40, speed=100) # left arm -25°, 100% arm speed
|
|
||||||
await robot.move(25, speed=92, acceleration=200) # 25 cm forward, 92% speed, 200 mm/s² accel
|
|
||||||
await robot.turn(-42, speed=48, acceleration=100) # 42° left, 48% turn speed, 100 °/s² turn accel
|
|
||||||
await robot.move(12, speed=92, acceleration=200) # 12 cm forward, 92% speed, 200 mm/s² accel
|
|
||||||
await robot.right_arm.move_by(-70, speed=70) # right arm -40°, 70% arm speed
|
|
||||||
await robot.move(-15, speed=92, acceleration=200, then=robot.Stop.NONE) # 15 cm backward, 92% speed, 200 mm/s² accel
|
|
||||||
await robot.turn(93, speed=48, acceleration=100, then=robot.Stop.HOLD) # 93° right, 48% turn speed, 100 °/s² turn accel
|
|
||||||
await robot.move(55, speed=92, acceleration=200, then=robot.Stop.NONE) # 55 cm forward, 92% speed, 200 mm/s² accel
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__": # This run this mission stand-alone when not called from bioglow_main.py
|
|
||||||
robot.run_task(solve_missions())
|
|
||||||
Reference in New Issue
Block a user