def sense(self, add_noise=1):
Z=[]
for i in range(len(landmarks)):
deltay=landmarks[i][0]-self.y
deltax=landmarks[i][1]-self.x
bearing=atan2(deltay, deltax)-self.orientation
if add_noise:
bearing += random.gauss(0.0, self.bearing_noise)
bearing %=2*pi
Z.append(bearing)
return Z
# copy your code from the previous exercise
# and modify it so that it simulates bearing noise
# according to
# self.bearing_noise
############## ONLY ADD/MODIFY CODE ABOVE HERE ####################
# --------
#
# extract position from a particle set
#
Particle_carRobot.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录