Particle_carRobot.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Udacity_Robotics_cs373 作者: lijiyao111 项目源码 文件源码
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
#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号