-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparticle_filter.py
More file actions
40 lines (34 loc) · 1.62 KB
/
Copy pathparticle_filter.py
File metadata and controls
40 lines (34 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from grid import *
from particle import Particle
from utils import *
from setting import *
# ------------------------------------------------------------------------
def motion_update(particles, odom):
""" Particle filter motion update
Arguments:
particles -- input list of particle represents belief p(x_{t-1} | u_{t-1})
before motion update
odom -- noisy odometry measurement, a pair of robot pose, i.e. last time
step pose and current time step pose
Returns: the list of particle represents belief \tilde{p}(x_{t} | u_{t})
after motion update
"""
return particles
# ------------------------------------------------------------------------
def measurement_update(particles, measured_marker_list, grid):
""" Particle filter measurement update
Arguments:
particles -- input list of particle represents belief \tilde{p}(x_{t} | u_{t})
before meansurement update
measured_marker_list -- robot detected marker list, each marker has format:
measured_marker_list[i] = (rx, ry, rh)
rx -- marker's relative X coordinate in robot's frame
ry -- marker's relative Y coordinate in robot's frame
rh -- marker's relative heading in robot's frame, in degree
grid -- grid world map, which contains the marker information,
see grid.h and CozGrid for definition
Returns: the list of particle represents belief p(x_{t} | u_{t})
after measurement update
"""
measured_particles = []
return measured_particles