ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.19k stars 9.71k forks source link

Error use of Kalman filter for filtering the theta of a VisualObject in the perception module #5304

Open csukuangfj opened 6 years ago

csukuangfj commented 6 years ago

See the code https://github.com/ApolloAuto/apollo/blob/c104ebb3bd95e1331dd99c9df4b3a488615ca767/modules/perception/obstacle/camera/filter/object_camera_filter.cc#L97

Since the essence of the Kalman filter is to linearly combine the predicted state and the measured state, it cannot be used directly to filter an angle.

For an extreme case, suppose the predicted angle is 359 degrees, the measured angle is 1 degree, and the weight is 0.5, the Kalman filter will return (359 + 1) * 0.5 = 180 degrees, which is far from the expected result. The same problem exists if the angle is in the range [-180, 180).

daohu527 commented 2 years ago

Closed due to inactivity. If the problem persists, pls feel free to reopen it or create a new one and refer to it.

csukuangfj commented 2 years ago

I think this can be considered as a bug.

daohu527 commented 2 years ago

@csukuangfj You know this is a question about 3 years ago, we will check and then feedback!