def run_fill_pattern(robot, long_side, speed, conf): STEP = conf['step'] RAD1 = 2.0 RAD2 = RAD1 + STEP / 2.0 SAFETY = 2.0 for i in range(10): Y = i * STEP follow_line(robot, Line((RAD1 + SAFETY, Y), (long_side - RAD2 - SAFETY, Y)), speed=speed, timeout=60) turn(robot, math.radians(180), radius=RAD2, speed=speed, with_stop=True, timeout=60.0) follow_line(robot, Line((long_side - RAD2 - SAFETY, Y + 2 * RAD2), (RAD1 + SAFETY, Y + 2 * RAD2)), speed=speed, timeout=60) turn(robot, math.radians(180), radius=RAD1, speed=speed, with_stop=True, timeout=60.0)
def run_oval(robot, speed): robot.set_desired_speed(speed) follow_line(robot, Line((0, 0), (4.0, 0))) turn(robot, math.radians(180), radius=2.0, speed=speed, with_stop=False, timeout=20.0) # TODO change second radius once the localization & navigation are repeatable follow_line(robot, Line((4.0, 4.0), (0, 4.0))) turn(robot, math.radians(180), radius=2.0, speed=speed, with_stop=False, timeout=20.0)
def run_mapping(robot, speed, laser_detector): for i in range(4): nav2cone(robot, speed, laser_detector) turn(robot, math.radians(75), radius=2.0 + 1.5, speed=speed, with_stop=False, timeout=60.0)
def run_oval(robot, speed): robot.set_desired_speed(speed) follow_line(robot, Line((5, 0), (10, 0)), speed=speed, timeout=60) robot.canproxy.stop() turn(robot, math.radians(180), radius=2.5, speed=speed, with_stop=True, timeout=60.0) # TODO change second radius once the localization & navigation are repeatable follow_line(robot, Line((10, 5), (5, 5)), speed=speed, timeout=60) robot.canproxy.stop() turn(robot, math.radians(180), radius=2.5, speed=speed, with_stop=True, timeout=60.0)
def run_fill_pattern(robot, long_side, speed, conf): STEP = conf['step'] RAD1 = 2.0 RAD2 = RAD1 + STEP/2.0 SAFETY = 2.0 for i in range(10): Y = i * STEP follow_line(robot, Line((RAD1+SAFETY, Y), (long_side-RAD2-SAFETY, Y)), speed=speed, timeout=60) turn(robot, math.radians(180), radius=RAD2, speed=speed, with_stop=True, timeout=60.0) follow_line(robot, Line((long_side-RAD2-SAFETY, Y+2*RAD2), (RAD1+SAFETY, Y+2*RAD2)), speed=speed, timeout=60) turn(robot, math.radians(180), radius=RAD1, speed=speed, with_stop=True, timeout=60.0)
def turn_back(robot, speed): turn(robot, math.radians(-60), radius=2.0, speed=speed, with_stop=True, timeout=30.0) # right turn(robot, math.radians(-60), radius=2.0, speed=-speed, with_stop=True, timeout=30.0) # backup turn(robot, math.radians(-60), radius=2.0, speed=speed, with_stop=True, timeout=30.0) # right again
def run_mapping(robot, speed, laser_detector): for i in range(4): nav2cone(robot, speed, laser_detector) turn(robot, math.radians(75), radius=2.0+1.5, speed=speed, with_stop=False, timeout=60.0)