MCPcopy Index your code
hub / github.com/AtsushiSakai/PythonRobotics / predict_particles

Function predict_particles

SLAM/FastSLAM2/fast_slam2.py:93–106  ·  view source on GitHub ↗
(particles, u)

Source from the content-addressed store, hash-verified

91
92
93def predict_particles(particles, u):
94
95 for i in range(N_PARTICLE):
96 px = np.zeros((STATE_SIZE, 1))
97 px[0, 0] = particles[i].x
98 px[1, 0] = particles[i].y
99 px[2, 0] = particles[i].yaw
100 ud = u + (np.random.randn(1, 2) @ R).T # add noise
101 px = motion_model(px, ud)
102 particles[i].x = px[0, 0]
103 particles[i].y = px[1, 0]
104 particles[i].yaw = px[2, 0]
105
106 return particles
107
108
109def add_new_lm(particle, z, Q):

Callers 1

fast_slam2Function · 0.70

Calls 1

motion_modelFunction · 0.70

Tested by

no test coverage detected