MCPcopy Create free account
hub / github.com/AtsushiSakai/PythonRobotics / compute_jacobians

Function compute_jacobians

SLAM/FastSLAM2/fast_slam2.py:130–147  ·  view source on GitHub ↗
(particle, xf, Pf, Q)

Source from the content-addressed store, hash-verified

128
129
130def compute_jacobians(particle, xf, Pf, Q):
131 dx = xf[0, 0] - particle.x
132 dy = xf[1, 0] - particle.y
133 d2 = dx**2 + dy**2
134 d = math.sqrt(d2)
135
136 zp = np.array(
137 [d, pi_2_pi(math.atan2(dy, dx) - particle.yaw)]).reshape(2, 1)
138
139 Hv = np.array([[-dx / d, -dy / d, 0.0],
140 [dy / d2, -dx / d2, -1.0]])
141
142 Hf = np.array([[dx / d, dy / d],
143 [-dy / d2, dx / d2]])
144
145 Sf = Hf @ Pf @ Hf.T + Q
146
147 return zp, Hv, Hf, Sf
148
149
150def update_KF_with_cholesky(xf, Pf, v, Q, Hf):

Callers 3

update_landmarkFunction · 0.70
compute_weightFunction · 0.70
proposal_samplingFunction · 0.70

Calls 1

pi_2_piFunction · 0.70

Tested by

no test coverage detected