All problems
Kalman Predict 2D
Problem
Run the 2D predict step of a Kalman tracker.
State and velocity are [x, y] and [vx, vy]; covariance is [px, py]. Return [x + vx, y + vy, px + q, py + q] rounded to 4 decimal places.
Test cases
case 1
in: [[0,0],[1,2],[1,1],0.5]
expected: [1,2,1.5,1.5]
case 2
in: [[5,-1],[0,0],[2,3],1]
expected: [5,-1,3,4]
case 3
in: [[1.5,2.5],[0.5,-0.5],[0.25,0.75],0.25]
expected: [2,2,0.5,1]
Starter codePython
def kalman_predict_2d(state, velocity, cov, q):
# Your code here
pass3 test cases · run your code against them in the editor