# robot_pose_ekf, sensor priority

Hello,

I am using robot_pose_ekf for fusing data from encoder and IMU. I was wondering, where at the code I can find the section of actual fusing of data, and if someone is familiar with the process, could you please describe it here how does it happen?

Also, is there a way to specify priority of data source for fusion process? For example, I want to trust more to IMU data then to encoders?

Best regards.

edit retag close merge delete

Sort by » oldest newest most voted robot_pose_ekf will fuse the data in a probabilistic manner by using the covariances specified on the incoming topics.

The simplest way to "weight" the data is to adjust make the entries in the covariance matrix larger.

more

Thank you for the answer. However, I do not understand how practically to do so. Here is my assumption, if for example I want to use IMU: float weight = 1.2; imu_covariance_(i+1, j+1) =weight * ( imu->orientation_covariance[3*i+j]); Would this be the best way to do this?

In the past, I have just adjusted the (4,4), (5,5), and (6,6) entries in the covariance matrix for the IMU before passing them to robot_pose_ekf. For instance, if the entries are 0.01 from the driver, adjust them up to 0.1 or 1.0 to make them less important to the EKF.

Hmm, it seems to me that imu_covariance as well as orientation_covariance are 3x3 matrices. Can you please explain (4,4), (5,5), and (6,6) entries ?

Apologies, I was thinking of the Odometry message (which contains a geometry_msgs/PoseWithCovariance, 36 entry array). You are correct, you should be adjusting the orientation_covariance matrix.

Thank you a lot. This really made my start with this node much easier. I would just like to clarify: Way to adjust covariances is this: imu_covariance_(i+1, j+1) =weight * ( imu->orientation_covariance[3*i+j]); ?

P.S Also, do you perhaps know is multiplying the odom and imu covariances with same number equivalent to not multiplying them at all? This is basically the question about logic behind EKF. Are covariances, from different sources used in respect to each other, or?