Skip to content

Commit 0d596eb

Browse files
committed
there is a bug ...
1 parent 96b50a1 commit 0d596eb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

SLAM/FastSLAM/fast_slam.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
# Simulation parameter
19-
Qsim = np.diag([0.2, math.radians(1.0)])**2
19+
Qsim = np.diag([0.0, math.radians(0.0)])**2
2020
Rsim = np.diag([1.0, math.radians(10.0)])**2
2121

2222
DT = 0.1 # time tick [s]
@@ -100,6 +100,8 @@ def add_new_lm(particle, z):
100100

101101
particle.lm[lm_id, 0] = particle.x + r * c
102102
particle.lm[lm_id, 1] = particle.y + r * s
103+
# print(particle.lm)
104+
# print(lm_id)
103105

104106
# covariance
105107
Gz = np.matrix([[c, -r * s],
@@ -110,11 +112,17 @@ def add_new_lm(particle, z):
110112
return particle
111113

112114

115+
def feature_update(particle, z, R):
116+
117+
return particle
118+
119+
113120
def compute_weight(particle, z):
114121

115122
lm_id = int(z[0, 2])
116123

117124
lmxy = np.matrix(particle.lm[lm_id, :])
125+
print(lmxy)
118126

119127
# calc landmark xy
120128
r = z[0, 0]
@@ -154,7 +162,8 @@ def update_with_observation(particles, z):
154162
else:
155163
w = compute_weight(particles[ip], z[iz, :]) # w = p(z_k | x_k)
156164
particles[ip].w = particles[ip].w + w
157-
# particles(i)= feature_update(particles(i), zf, idf, R)
165+
particles[ip] = feature_update(
166+
particles[ip], z[iz, :], Cx[0:2, 0:2])
158167

159168
return particles
160169

0 commit comments

Comments
 (0)