# robot_localization: how to define f function

Hi to all,

I'm using and studying the robot_localization package in order to integrate it with my system. At the moment, I would like to better understand how it works and so I've read the Thomas Moore's article and I also watched the video presentation.

Unfortunately, I can't understand how the function f is described in the following relation:

How it is possible to mathematically define the function f and Q?

Can you help me in understanding this, please? I know it's maths and that it is not related to ROS, but I think that it is very important to understand these functions for me.

Thank you!

edit retag close merge delete

I've read this topic, but I would like to have an example on how to write the full f function, if possible.

( 2016-10-17 15:18:27 -0500 )edit

May be, I've found the state transition matrix described in this way. But I can only see 9 components for the vector and not 12 as specified in the article. Why?

( 2016-10-17 15:32:56 -0500 )edit

An EKF is estimating the state of something. It's up to the author to determine which variables to estimate. The link you provided is just estimating a different set of variables. Specifically, it appears to lack orientation and angular velocity.

( 2016-12-19 04:13:26 -0500 )edit

Sort by » oldest newest most voted

This would be a good question for the Robotics Stack Exchange. Briefly, the function f is a vector-valued function that takes as its input the entire state vector x_t-1, and outputs a state vector x_t. In this case, even though it's a single function in the paper, we can really express it as a set of functions like this:

 X = X + X_velocity * time_delta + X_acceleration * 0.5 * time_delta^2 

 Y = Y + Y_velocity * time_delta + Y_acceleration * 0.5 * time_delta^2 

...etc. The only difference from what I have written here is that we have to rotate both the velocities and accelerations by the robot's orientation, since those quantities are given in the robot's body frame.

more