DSPRelated.com
Forums

Matlab implementation for kalman filters

Started by suresh December 18, 2002
Hi all,

I am using kalman filters for localisation of a robot.

I am trying to implement the propagation and updation equations of
a
kalman filter shown below, using MATLAB.

xhat(k+1) = phi * xhat(k)

where phi is a state transition matrix.

xhat(k) = a state vector that have the following values

left wheel velocity, right wheel velocity and orientation
theta as a 3 x 1 matrix.

where phi = [1 0 0; 0 1 0; -.75 .75 0].

P(k+1) = phi*p(k)*phi(tranpose) + Q

where Q is a system noise covariance matrix.
P is a covariance matrix.

My problem is I am a beginner and not sure of how exactly the above
equation can be realized as a matrix equations/expressions. i have
tried implementing the above equation by initialising xhat as a
null
matrix and later on finding/calculating the elements of this matrix
as a for loop. But I think the errors i am getting is related to
inappropriate method of realising it as a matrix equation without
violating the rules and thus avoiding errors in matlab. So could
some
one give me a basic idea of how it can be done either in a command
line form or as a function.

Regards
Suresh



Setting the system up with a NULL is not generally appropriate. If I
remember my mathematics correctly ... you will need to define some boundary
conditions to initialize the system.

Regards,
Tom Dillon

-----Original Message-----
From: suresh <> [mailto:]
Sent: Wednesday, December 18, 2002 9:37 AM
To:
Subject: [matlab] Matlab implementation for kalman filters Hi all,

I am using kalman filters for localisation of a robot.

I am trying to implement the propagation and updation equations of
a
kalman filter shown below, using MATLAB.

xhat(k+1) = phi * xhat(k)

where phi is a state transition matrix.

xhat(k) = a state vector that have the following values

left wheel velocity, right wheel velocity and orientation
theta as a 3 x 1 matrix.

where phi = [1 0 0; 0 1 0; -.75 .75 0].

P(k+1) = phi*p(k)*phi(tranpose) + Q

where Q is a system noise covariance matrix.
P is a covariance matrix.

My problem is I am a beginner and not sure of how exactly the above
equation can be realized as a matrix equations/expressions. i have
tried implementing the above equation by initialising xhat as a
null
matrix and later on finding/calculating the elements of this matrix
as a for loop. But I think the errors i am getting is related to
inappropriate method of realising it as a matrix equation without
violating the rules and thus avoiding errors in matlab. So could
some
one give me a basic idea of how it can be done either in a command
line form or as a function.

Regards
Suresh _____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/matlab

More DSP-Related Groups: http://www.dsprelated.com/groups.php3

">http://docs.yahoo.com/info/terms/



Hi Suresh
I dont know whether the formulation of the problem
is correct or not. But to get help about the MATLAB
error messages, you should post the MATLAB code you
have tried and the equations you are trying to
implement along with the error messages you are
getting.

It is very easy to learn and start coding m scipts.

Navan

--- "suresh <>"
<> wrote:
> Hi all,
>
> I am using kalman filters for localisation of a
> robot.
>
> I am trying to implement the propagation and
> updation equations of
> a
> kalman filter shown below, using MATLAB.
>
> xhat(k+1) = phi * xhat(k)
>
> where phi is a state transition matrix.
>
> xhat(k) = a state vector that have the following
> values
>
> left wheel velocity, right wheel velocity
> and orientation
> theta as a 3 x 1 matrix.
>
> where phi = [1 0 0; 0 1 0; -.75 .75 0].
>
> P(k+1) = phi*p(k)*phi(tranpose) + Q
>
> where Q is a system noise covariance matrix.
> P is a covariance matrix.
>
> My problem is I am a beginner and not sure of how
> exactly the above
> equation can be realized as a matrix
> equations/expressions. i have
> tried implementing the above equation by
> initialising xhat as a
> null
> matrix and later on finding/calculating the
> elements of this matrix
> as a for loop. But I think the errors i am getting
> is related to
> inappropriate method of realising it as a matrix
> equation without
> violating the rules and thus avoiding errors in
> matlab. So could
> some
> one give me a basic idea of how it can be done
> either in a command
> line form or as a function.
>
> Regards
> Suresh


__________________________________________________