15
15
16
16
# Simulation parameter
17
17
Qsim = np .diag ([0.1 , math .radians (1.0 )])** 2
18
- Rsim = np .diag ([0.1 , math .radians (5 .0 )])** 2
18
+ Rsim = np .diag ([0.1 , math .radians (10 .0 )])** 2
19
19
20
20
DT = 1.0 # time tick [s]
21
21
SIM_TIME = 40.0 # simulation time [s]
22
22
MAX_RANGE = 20.0 # maximum observation range
23
23
STATE_SIZE = 3 # State size [x,y,yaw]
24
24
25
25
# Covariance parameter of Graph Based SLAM
26
- C_SIGMA1 = 1.0
27
- C_SIGMA2 = 1.0
28
- C_SIGMA3 = math .radians (35 .0 )
26
+ C_SIGMA1 = 0.01
27
+ C_SIGMA2 = 0.01
28
+ C_SIGMA3 = math .radians (5 .0 )
29
29
30
30
MAX_ITR = 20 # Maximuma iteration
31
31
@@ -59,8 +59,8 @@ def cal_observation_sigma(d):
59
59
60
60
def calc_rotational_matrix (angle ):
61
61
62
- Rt = np .matrix ([[math .cos (angle ), - math .sin (angle ), 0 ],
63
- [math .sin (angle ), math .cos (angle ), 0 ],
62
+ Rt = np .matrix ([[math .cos (angle ), math .sin (angle ), 0 ],
63
+ [- math .sin (angle ), math .cos (angle ), 0 ],
64
64
[0 , 0 , 1.0 ]])
65
65
return Rt
66
66
@@ -78,7 +78,8 @@ def calc_edge(x1, y1, yaw1, x2, y2, yaw2, d1,
78
78
79
79
edge .e [0 , 0 ] = x2 - x1 - tmp1 + tmp2
80
80
edge .e [1 , 0 ] = y2 - y1 - tmp3 + tmp4
81
- edge .e [2 , 0 ] = pi_2_pi (yaw2 - yaw1 - phi1 + phi2 )
81
+ hyaw = phi1 - phi2 + angle1 - angle2
82
+ edge .e [2 , 0 ] = pi_2_pi (yaw2 - yaw1 - hyaw )
82
83
83
84
Rt1 = calc_rotational_matrix (tangle1 )
84
85
Rt2 = calc_rotational_matrix (tangle2 )
@@ -87,8 +88,6 @@ def calc_edge(x1, y1, yaw1, x2, y2, yaw2, d1,
87
88
sig2 = cal_observation_sigma (d2 )
88
89
89
90
edge .omega = np .linalg .inv (Rt1 * sig1 * Rt1 .T + Rt2 * sig2 * Rt2 .T )
90
- # print(edge.omega)
91
- # edge.omega = np.eye(3)
92
91
93
92
edge .d1 , edge .d2 = d1 , d2
94
93
edge .yaw1 , edge .yaw2 = yaw1 , yaw2
@@ -273,7 +272,8 @@ def main():
273
272
# history
274
273
hxTrue = xTrue
275
274
hxDR = xTrue
276
- hz = [np .matrix (np .zeros ((1 , 4 )))]
275
+ # hz = [np.matrix(np.zeros((1, 4)))]
276
+ # hz[0][0, 3] = -1
277
277
hz = []
278
278
279
279
while SIM_TIME >= time :
0 commit comments