1515
1616# Simulation parameter
1717Qsim = 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
1919
2020DT = 1.0 # time tick [s]
2121SIM_TIME = 40.0 # simulation time [s]
2222MAX_RANGE = 20.0 # maximum observation range
2323STATE_SIZE = 3 # State size [x,y,yaw]
2424
2525# 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 )
2929
3030MAX_ITR = 20 # Maximuma iteration
3131
@@ -59,8 +59,8 @@ def cal_observation_sigma(d):
5959
6060def calc_rotational_matrix (angle ):
6161
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 ],
6464 [0 , 0 , 1.0 ]])
6565 return Rt
6666
@@ -78,7 +78,8 @@ def calc_edge(x1, y1, yaw1, x2, y2, yaw2, d1,
7878
7979 edge .e [0 , 0 ] = x2 - x1 - tmp1 + tmp2
8080 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 )
8283
8384 Rt1 = calc_rotational_matrix (tangle1 )
8485 Rt2 = calc_rotational_matrix (tangle2 )
@@ -87,8 +88,6 @@ def calc_edge(x1, y1, yaw1, x2, y2, yaw2, d1,
8788 sig2 = cal_observation_sigma (d2 )
8889
8990 edge .omega = np .linalg .inv (Rt1 * sig1 * Rt1 .T + Rt2 * sig2 * Rt2 .T )
90- # print(edge.omega)
91- # edge.omega = np.eye(3)
9291
9392 edge .d1 , edge .d2 = d1 , d2
9493 edge .yaw1 , edge .yaw2 = yaw1 , yaw2
@@ -273,7 +272,8 @@ def main():
273272 # history
274273 hxTrue = xTrue
275274 hxDR = xTrue
276- hz = [np .matrix (np .zeros ((1 , 4 )))]
275+ # hz = [np.matrix(np.zeros((1, 4)))]
276+ # hz[0][0, 3] = -1
277277 hz = []
278278
279279 while SIM_TIME >= time :
0 commit comments