/
CalibrateRobot.py
55 lines (37 loc) · 1.04 KB
/
CalibrateRobot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import MoveRobot
import SenseLandmarks
# Commands that are used to measure robot movement and sensing uncertainty.
# The outputs wil be used to compte the move and sense uncertainty covariance matrices.
# Constants
NUMBER_OF_ITERATIONS = 15
# Get data for movement forward uncertainty
def calibrate_move():
count = 0
while (True):
count += 1
if count > NUMBER_OF_ITERATIONS:
break
MoveRobot.go_forward(MoveRobot.ROBOT_LENGTH_CM)
raw_input("Press Enter to continue")
# Get data for rotation uncertainty
def calibrate_turn():
angle = 5
count = 0
while (True):
count += 1
if count > NUMBER_OF_ITERATIONS:
break
print("Going to turn ", angle, " degrees.")
MoveRobot.turn_in_place(angle)
angle += 5
raw_input("Press Enter to continue")
# Get data for landmark sensing uncertainty
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")