Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.29 KB | None | 0 0
  1.     def correct(self, reobservedLandmarks, newLandmarks):
  2.         for landmark in reobservedLandmarks:
  3.  
  4.             location = Point(self.stateVector[0], self.stateVector[1])
  5.             rotation = self.stateVector[2]
  6.  
  7.             storedLandmark = Point(self.stateVector[(landmark.id*2)+3], self.stateVector[(landmark.id*2)+4])
  8.  
  9.             predictedDist = location.euclideanDistance(storedLandmark)
  10.             predictedAngle = math.atan2(storedLandmark.y - location.y, storedLandmark.x - location.x) - math.radians(rotation % 360)
  11.  
  12.             h = Point(predictedDist, predictedAngle)
  13.             z = Point(landmark.dist, math.radians(landmark.angle))
  14.  
  15.             errorR = np.array([[predictedDist*0.01, 0],[0, 1]])
  16.             identityV = np.identity(2)
  17.  
  18.             jacobianH = np.zeros([2, 5])
  19.             jacobianH[1][2] = -1
  20.  
  21.             jacobianH[0][0] = location.x - storedLandmark.x / errorR[0][0]
  22.             jacobianH[0][1] = location.y - storedLandmark.y
  23.             jacobianH[1][0] = storedLandmark.y - location.y
  24.             jacobianH[1][1] = storedLandmark.x - location.x / errorR[1][1]
  25.  
  26.             jacobianH[0][3] = -jacobianH[0][0]
  27.             jacobianH[0][4] = -jacobianH[0][1]
  28.             jacobianH[1][3] = -jacobianH[1][0]
  29.             jacobianH[1][4] = -jacobianH[1][1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement