ukf icon indicating copy to clipboard operation
ukf copied to clipboard

Why are the measurement vector variances declared static?

Open asymingt opened this issue 5 years ago • 2 comments

Is there a reason that the measurement_covariance and root_measurement_covariance variables on the FixedMeasurementVector and DynamicMeasurementVector classes are declared static? This seems to prevent uncertainty changes per obervation in cases where multiple filters are used in parallel.

asymingt avatar Mar 29 '19 13:03 asymingt

Hi Andrew,

Originally, my thinking was along the lines that each specialisation of the FixedMeasurementVector or DynamicMeasurementVector class would represent a particular set of sensors — independent of any particular filter instance — and so sharing the measurement noise covariance among all filters using that measurement vector specialisation would be more convenient as it would remove the need to set the measurement noise covariance for each filter individually.

However, looking back at it now, the use of a static member variable in the class really is a bit ugly. And, as you've pointed out, it causes problems if you'd like to change the measurement noise covariance between observations for multiple filters in parallel.

I've just pushed a new branch (dd-measurement-covariance) which moves the measurement noise covariance out of the measurement vector classes and into the filter instance (which also makes it consistent with the way state and process noise covariance are managed). Does that fit better with your use case?

danieldyer avatar Mar 30 '19 15:03 danieldyer

Hi Daniel

Firstly, thank you for pushing that branch. I will take a look at it over the next couple of days. But, from what you have described it fits my use case perfectly. I greatly appreciate your help!

Andrew

asymingt avatar Mar 31 '19 15:03 asymingt