# Kalman Filter on Sensor Fusion

Assume I have 2 sensors capable of measuring distance to an object of known distance. If I apply a Kalman filter to these 2 sensors, I would have 2 correction and prediction equations. If I have 2 predicted distance values from this, what are some methods to return a final predicted value with this information? Or, in other words, is there a method in which I can return a more accurate predicted value using the two sensors instead of just one? There should be a better method than to just return an average of the two predicted values, especially in the case where 1 sensor may be potentially blocked.

• There seems to be a disconnect between what you're asking and what a Kalman filter does. If each distance estimate you're trying to get is unrelated to previous ones, then there's no application for a Kalman filter -- just take the statistically best combination of the two sensors. So -- are you actually filtering, or are you just taking distance measurements from multiple sensors without using prior measurements? Commented Nov 20, 2022 at 20:30
• This is probably the type of thing you're looking for--assuming I understood the question: en.wikipedia.org/wiki/Sensor_fusion Commented Nov 21, 2022 at 6:56
• Seems like Kalman filter fits your problem. Did you try to implement it and you have got problems? Please try to play the observation equation and show what did not work... Commented Nov 21, 2022 at 12:42
– Royi
Commented Feb 25, 2023 at 11:24

This case is actually a great case for Kalman Filter.

Basically the Kalman Filter fuses data. In its classic form it fuses a prior data with a measurement.

In your case it will fuse data with 2 measurements. If all calibrated correctly it will actually yield even a better result.

Conceptually, assume you don't have the Kalman filter, but you have those 2 measurements. Moreover, assume they are done at the exact same time, how would you use them?

For the optimal answer, under the the assumption the measurement noise is Gaussian, you may have a look at:

This is basically what the Kalman Filter would do, merge them according to the certainty level of each sensor which is modeled by the variance of the measurement noise.

In case the 2 sensors are not time aligned you just work using the regular Kalman Filter model with the difference of creating the model matrix online to calculate the actual time difference.

The most important parameter in your case is accurately define the noise measurement of each sensor.