def backwards_until_white(self, should_stop=True, *, time=c.SAFETY_TIME):
     m.base_backwards()
     sec = seconds() + time / 1000
     while seconds() < sec and self.senses_black():
         msleep(1)
     if should_stop:
         m.deactivate_motors()
示例#2
0
def backwards_until_black_cliffs():
    #  Goes backwards until both sensors have sensed black.
    print "Starting backwards_until_black_cliffs()"
    m.base_backwards()
    while NotBlackLeft() and NotBlackRight():
        pass
    m.deactivate_motors()
def backwards_until(boolean_function, should_stop=True, *, time=c.SAFETY_TIME):
    m.base_backwards()
    sec = seconds() + time / 1000
    while seconds() < sec and not(boolean_function()):
        msleep(1)
    if should_stop:
        m.deactivate_motors()
示例#4
0
def backwards_until(boolean_function, time=c.SAFETY_TIME, should_stop=True):
    m.base_backwards()
    if time == 0:
        should_stop = False
        time = c.SAFETY_TIME
    wait_until(boolean_function, time)
    if should_stop:
        m.deactivate_motors()
def backwards_until_black_cliffs(should_stop=True, *, time=c.SAFETY_TIME):
#  Goes backwards until both sensors have sensed black.
    m.base_backwards()
    sec = seconds() + time / 1000
    while seconds() < sec and isLeftOnWhite() and isRightOnWhite():
        msleep(1)
    if should_stop:
        m.deactivate_motors()
示例#6
0
def backwards_until_black_fcliffs():
    print "Starting backwards_until_black_fcliffs()"
    m.base_backwards()
    while NotBlackFrontLeft() and NotBlackFrontRight():
        pass
    if BlackFrontLeft():
        while NotBlackFrontRight():
            pass
    else:
        while NotBlackFrontLeft():
            pass
    m.deactivate_motors()
def backwards_until_black_fcliffs(should_stop=True, *, time=c.SAFETY_TIME):
    m.base_backwards()
    sec = seconds() + time / 1000
    while seconds() < sec and isLeftFrontOnWhite() and isRightFrontOnWhite():
        msleep(1)
    if isLeftFrontOnBlack():
        while isRightFrontOnWhite():
            msleep(1)
    else:
        while isLeftFrontOnWhite():
            msleep(1)
    if should_stop:
        m.deactivate_motors()
示例#8
0
def backwards_until_not_depth():
    m.base_backwards()
    while DepthSensesObject():
        pass
    m.deactivate_motors()
示例#9
0
def backwards_until_white_rfcliff():
    print "Start backwards_until_white_rfcliff"
    m.base_backwards()
    while BlackFrontRight():
        pass
    m.deactivate_motors()
示例#10
0
def backwards_until_black_lfcliff():
    print "Start drive_until_black_lfcliff"
    m.base_backwards()
    while NotBlackFrontLeft():
        pass
    m.deactivate_motors()
示例#11
0
def backwards_until_white_rcliff():
    print "Start drive_until_black_rcliff"
    m.base_backwards()
    while BlackRight():
        pass
    m.deactivate_motors()
示例#12
0
def pick_up_coupler():
    m.base_backwards(0.1)
    m.lift_arm(4,1)
    m.deactivate_motors()