def forwards_until_white_lfcliff_safe(): print "Start drive_until_white_lfcliff_safe" m.base_forwards() while BlackFrontLeft(): if BumpedRight(): m.turn_left(100) msleep(100) m.base_forwards() m.deactivate_motors()
def forwards_until_black_fcliffs(): print "Starting forwards_until_black_fcliffs()" m.base_forwards() while NotBlackFrontLeft() and NotBlackFrontRight(): pass if BlackFrontLeft(): while NotBlackFrontRight(): pass else: while NotBlackFrontLeft(): pass m.deactivate_motors()
def forwards_until_black_cliffs(): # Goes forwards until both sensors have sensed black. print "Starting forwards_until_black_cliffs()" m.base_forwards() while NotBlackLeft() and NotBlackRight(): pass if BlackLeft(): while NotBlackRight(): pass else: while NotBlackLeft(): pass m.deactivate_motors()
def runtest(): create_connect() m.base_forwards() msleep(3000) m.deactivate_motors() create_disconnect()
def forwards_until_white_lcliff(): print "Start forwards_until_white_lcliff" m.base_forwards() while BlackLeft(): pass m.deactivate_motors()
def forwards_until_black_lcliff(): print "Start drive_until_black_lcliff" m.base_forwards() while NotBlackLeft(): pass m.deactivate_motors()
def forwards_until_bump(): print "Starting forwards_until_bump()" m.base_forwards() while NotBumpedLeft() and NotBumpedRight(): pass m.deactivate_motors()
def forwards_until_depth(): m.base_forwards() while NotDepthSensesObject(): pass m.deactivate_motors()
def forwards_until_white_rfcliff(): print "Start forwards_until_white_rfcliff" m.base_forwards() while BlackFrontRight(): pass m.deactivate_motors()
def forwards_until_black_lfcliff(): print "Start forwards_until_black_lfcliff" m.base_forwards() while NotBlackFrontLeft(): pass m.deactivate_motors()
def forwards_until_white_rcliff(): print "Start drive_until_black_rcliff" m.base_forwards() while BlackRight(): pass m.deactivate_motors()