def go_towards_nearest_obstacle():

	# get nearest obstacle
	bearing_to_obstacle, range_to_obstacle = SenseLandmarks.get_nearest_obstacle()

	# Turn towards it
	turn_in_place(bearing_to_obstacle)

	while range_to_obstacle > 2.5 * ROBOT_LENGTH_CM:

		go_forward(ROBOT_LENGTH_CM)

		# get nearest obstacle
		bearing_to_obstacle, range_to_obstacle = SenseLandmarks.get_nearest_obstacle()

		# Turn towards it
		turn_in_place(bearing_to_obstacle)
def go_towards_nearest_obstacle():

    # get nearest obstacle
    bearing_to_obstacle, range_to_obstacle = SenseLandmarks.get_nearest_obstacle(
    )

    # Turn towards it
    turn_in_place(bearing_to_obstacle)

    while range_to_obstacle > 2.5 * ROBOT_LENGTH_CM:

        go_forward(ROBOT_LENGTH_CM)

        # get nearest obstacle
        bearing_to_obstacle, range_to_obstacle = SenseLandmarks.get_nearest_obstacle(
        )

        # Turn towards it
        turn_in_place(bearing_to_obstacle)
def calibrate_sense():

    count = 0

    while (True):

        count += 1
        if count > NUMBER_OF_ITERATIONS:
            break

        obstacle_range = SenseLandmarks.make_sweep()
        print("Obstacle range ", obstacle_range)
        raw_input("Press Enter to continue")
def calibrate_sense():

	
	count = 0

	while (True):

		count += 1
		if count > NUMBER_OF_ITERATIONS:
			break

		obstacle_range = SenseLandmarks.make_sweep()
		print("Obstacle range ", obstacle_range)
		raw_input("Press Enter to continue")