How Can a Kalman Filter Estimate Distance Using GPS and Velocity Data?

In summary: The distance the car has traveled in a straight line from its starting point. Sorry for not being clear about that earlier.In summary, the conversation is about finding the distance between points using a Kalman filter. The person has provided measurements of latitude, longitude, height, and velocity of a moving vehicle. They have also attached a picture of their attempt at setting up the state space equation for the filter, but they are unsure if it is correct. The expert advises them to explain the physics and their notation in order for them to provide any further help. The person clarifies that they want to measure the distance the car has traveled in a straight line from its starting point.
  • #1
9988776655
46
0
I want to get the distance between points. I have a measurement of latitude, longitude and height from GPS/barometer systen (which I converted into north east down coordinates) and I have another measurement of the vehicle's velocity in the north east and down direction. To find the distance, I want to set up the state space equation for a Kalman filter. I attached a picture of my attempt. In the picture, Ts is the sample period, v_k is the magnitude of the velocity, p_k is the position and D is the distance. Please correct my program.
 

Attachments

  • state space.jpg
    state space.jpg
    13 KB · Views: 549
Last edited:
Mathematics news on Phys.org
  • #2
9988776655 said:
v_k is the magnitude of the velocity, p_k is the position and D is the distance. Please correct my program.

Explain your notation or give a link to an example that explains it. You also need to explain the problem completely in words. All that's clear from your verbal description is that there is a moving object. The Kalman filter requires that you specify the physical dynamics of a situation not merely the set of measurements. Is this a falling object? - a projectile? - something self propelled?

I can't interpret your state variables. Are you using the magnitude of velocity, but not it's 3 component vectors? Do you mean p_k to be a scalar? Or does it stand for 3-D column vector with 3 entries? What distance is "the distance"?

Since your matrix implies D[k] = D[k-1] + P[k-1], perhaps the coordinates of the object are D[k] and P[k] is a displacement vector instead of a vector of giving the coordinates of the object.?

My recollection of questions about Kalman filters in the math sections is that they often go unanswered and I myself don't claim to be an expert on them. You might have better luck in the engineering sections of the forums. But even there, you have to explain enough so the physical dynamics are known. Just listing your set of measurements isn't sufficient.
 
  • #3
I posted this in the General Engineering forum without my state space equation (which is wrong anyway)
 
  • #4
Explain the physics and your notation and I'll do what I can.
 
  • #5
I'll suggest a simple approach. Something is changing the car's velocity, but you haven't mentioned any control inputs. So assume the accelerations are from random noise. That would explain the velocity changes.

Let [itex] \triangle t [/itex] be the time interval between measurements.

State variables:

Let the cars position coordinates be [itex] (X[k],Y[k],Z[k]) [/itex] at measurement [itex] k.[/itex]

Let [itex] V_x [k-1] [/itex] be the average x-velocity of the car between the [itex] k-1 [/itex] and [itex] k [/itex] measurements.
Let [itex] A_x[k-1] [/itex] be the average x-acceleration of the car between the [itex] k-1 [/itex] and [itex] k [/itex] measuremens.Dynamics:

[itex] X[k] = X[k-1] + V_x[k-1] * \triangle t + (1/2) * A_x[k-1] * (\triangle t)^2 [/itex]

[itex] V_x[k] = V_x[k-1] + A_x[k-1]*\triangle t [/itex]

Similarly, for the other coordinates:

[itex] Y[k] = Y[k-1] + V_y[k-1]* \triangle t + (1/2)* a_y[k-1] *(\triangle t)^2 [/itex]

[itex] Z[k] = Z[k-1] + V_z[k-1] *\triangle t + (1/2)*a_z[k-1] *(\triangle t)^2 [/itex]

[itex] V_y[k] = V_y[k-1] + A_y[k-1]*\triangle t [/itex]

[itex] V_z[k] = V_z[k-1] + A_z[k-1]*\triangle t [/itex]
 
  • #6
Hi. Thanks for your advice. I posted something very similar to this in the general engineering forum where I explained my notation:
https://www.physicsforums.com/threads/kalman-filter-help-me-to-set-up-a-state-equation.785573/
My version is slightly different because I assumed constant Jerk. I also integrated to get velocity and position, but I used the magnitudes as it was only important to find the magnitude of distance.
Since the object is a car, the accelerations are from putting the pedal down and braking is from using the brakes. How would you model that? Do you think my model is OK?
 
  • #7
You still haven't defined what you mean by "distance". Do you mean distance to be what the odometer on the car measures? -, which is the length of the possibly curved path the car has followed..
 
  • #8
Yes that is what I want to measure
 

1. What is a Kalman filter and how does it work?

A Kalman filter is a mathematical algorithm used to estimate the state of a system based on a series of noisy measurements. It works by combining predictions from a dynamic model of the system with measurements from sensors to improve the accuracy of the estimated state.

2. What is the state space equation in a Kalman filter?

The state space equation in a Kalman filter is a set of mathematical equations that describe the dynamics of a system. It consists of two parts: the state transition equation, which predicts the state of the system at the next time step, and the measurement equation, which relates the state to the measurements.

3. How do I choose the initial state and covariance in a Kalman filter?

The initial state and covariance are typically chosen based on prior knowledge or assumptions about the system. If there is no prior information, they can be set to zero or a small value. The Kalman filter will update these values as it receives more measurements.

4. Can a Kalman filter be used for nonlinear systems?

Yes, a Kalman filter can be extended to nonlinear systems by using an extended Kalman filter (EKF) or unscented Kalman filter (UKF). These variations use linearizations or unscented transformations to handle nonlinearity in the state space equations.

5. How do I evaluate the performance of a Kalman filter?

The performance of a Kalman filter can be evaluated by comparing the estimated state with ground truth data, if available. Other metrics, such as the root mean square error (RMSE) or mean absolute error (MAE), can also be used to assess the accuracy of the filter's estimates.

Similar threads

Replies
6
Views
2K
Replies
3
Views
3K
  • General Engineering
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • General Math
Replies
6
Views
6K
  • General Engineering
Replies
6
Views
2K
Replies
1
Views
1K
Replies
9
Views
6K
  • Calculus
Replies
1
Views
3K
Back
Top