Esempio n. 1
0
def do_lift_basket():

    robot.straight(180)
    robot.straight(-10)
    robot.turn(16)
    robot.straight(15)

    #common.arm.run_until_stalled(100)
    robot.straight(-13)

    # The arm keeps stalling here..........??
    # want to check 3 things 
    #  - is it stalled
    #  - is it too high
    # maybe loop
    #  - goal is high enough
    #  - lift up until goal.. or stalled
    #  - if not at goal then move down and try again

    # common.arm.run_until_stalled(-100)
    #common.arm.run_angle(100, 104, Stop.BRAKE)
    common.arm.run_angle(130, 104, Stop.BRAKE)


    common.arm.run_until_stalled(-400)

    robot.straight(-60)
Esempio n. 2
0
def do_pullup():

    # lift arm up to get ready
    common.arm.run_angle(500, 250, Stop.BRAKE)

    # drive up close to pullup bar
    robot.straight(320)

    # do the pull up
    common.arm.run_angle(-500, 250, Stop.BRAKE)
Esempio n. 3
0
def do_boccia():

    # todo: drive here and line up

    robot.straight(-30)
    robot.turn(22)
    common.arm.run_until_stalled(200)

    robot.straight(-50)
    common.arm.run_until_stalled(-600)
    robot.turn(-90)
Esempio n. 4
0
def turn_from_white_bar_to_arch():

    robot.turn(-20)
    robot.straight(110)
    robot.turn(-20)
    #robot.straight(50)
    robot.straight(120)

    #robot.drive(140, -65)
    robot.reset()
    #robot.drive(100, -60)

    robot.drive(40, 0)
    mover.wait_for_color_on_right_line_sensor(Color.BLACK)

    # park it on the line pointing in the right direction
    robot.straight(50)
    robot.turn(10)
    robot.straight(30)
    robot.turn(10)
    robot.straight(30)
    robot.turn(15)

    robot.stop()
Esempio n. 5
0
def do_smash_bench():

    robot.turn(125)

    #mover.drive_to_white(-100)

    robot.straight(-300)
    # tried sensor, but sometimes it did not hit.
    #mover.drive_to_white_black_white(-100)

    robot.straight(100)
    robot.turn(40)
    robot.straight(-700)
Esempio n. 6
0
def drive_to_north_line_after_treadmill():

    robot.straight(-100)
    #mover.drive_to_white_black_white_left_color_sensor(-100)

    robot.turn(-45)
    robot.straight(100)
 
    # smash againt back wall?
    robot.turn(-45)
    robot.straight(100)
    robot.turn(-15)
    robot.drive(-200, 0)
    wait(1500)
    robot.stop()

    # forward some 
    robot.straight(140)

    mover.drive_to_white_black_white_left_color_sensor(130)
Esempio n. 7
0
def drive_home_from_weights():

    robot.turn(-45)
    mover.turn_ccw_until_right_sensor_white()
    ev3.speaker.beep()
    robot.turn(-30)
    ev3.speaker.beep()

    mover.follow_distance_left_sensor(400)
    ev3.speaker.beep()

    robot.straight(500)
    robot.turn(-45)
    robot.straight(400)
    robot.turn(45)
    robot.straight(700)
Esempio n. 8
0
def do_weights_from_north_line():

    robot.turn(-45)
    robot.straight(110)
    robot.turn(45)
    # now facing north

    # now angle to weights and run into it
    common.arm.run_until_stalled(400)

    # This turn and drive does not always work
    robot.turn(34)
    robot.straight(200)

    # smash and back up
    common.arm.run_until_stalled(-200)
    robot.straight(-120)
Esempio n. 9
0
def wiggle_step():

    
    for x in range (9):
        robot.straight(-16)
        robot.turn(-0.68)

        # slow wiggle works better
        robot.stop()
        robot.settings(straight_speed=95)
        robot.straight(29)
    
        # faster again
        robot.stop()
        robot.settings(straight_speed = mover.ROBOT_STRAIGHT_SPEED)


    # back up until we get to white bar
    mover.drive_to_white_on_right_line_sensor(-100)
    robot.straight(-80) # a little more to clear the step machine
Esempio n. 10
0
def drive_under_pullup_bar():

    # drive forward until the robot finds a line
    mover.drive_to_line()
    ev3.speaker.beep()

    mover.follow_on_right_until_white_black_white_on_left()
    ev3.speaker.beep()

    # back up and make final left turn to find new line
    robot.straight(-20)
    robot.turn(-80)
    ev3.speaker.beep()

    mover.drive_to_line()
    ev3.speaker.beep()

    # Drive under pullup bar and back again
    mover.follow_distance(200, 120)
    robot.straight(320)
    robot.straight(-450)
Esempio n. 11
0
def do_rowing_after_treadmill():
    robot.turn(-45)
    robot.straight(100)