# Understanding the difference between the covariances of pose\_with\_covariance topic and odom topic

**URL:** <https://community.stereolabs.com/t/understanding-the-difference-between-the-covariances-of-pose-with-covariance-topic-and-odom-topic/2535>\
**Category:** ROS2\
**Tags:** slam, ros, sdk, jetson\
**Created:** [May 1, 2023, 6:13pm UTC](https://community.stereolabs.com/t/understanding-the-difference-between-the-covariances-of-pose-with-covariance-topic-and-odom-topic/2535 "2023-05-01T18:13:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdanan](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/g/e19b73/32.png) [@gdanan](https://community.stereolabs.com/u/gdanan)\
**Post date:** [May 1, 2023, 6:13pm UTC](https://community.stereolabs.com/t/understanding-the-difference-between-the-covariances-of-pose-with-covariance-topic-and-odom-topic/2535/1 "2023-05-01T18:13:48Z")

</div>

Hey there, In order to fuse the ZED estimation in my EKF, I’m trying to understand the covariance behaviors in the topics of pose\_with\_covariance and odom. I refer to the trace of the position covariance.  
In the odom topic I saw that the covariance is bounded to a really small bound. where the max is about 2e-6.  
On the other hand, in the pose\_with\_covariance I saw a different behavior, first, the covariance is growing at a steady pace, it also decreases sometimes but most of the time it’s growing.  
When the camera sees a white wall, the covariance explodes in a weird way from 5.0 to about 1e11 at once. while the odom topic covariance stays at the max bound I mentioned before.

Why there is a difference between the behaviors of them? what is the difference in the calculation between both of the covariances? And which of the covariances (odom/pose\_with\_covariance) do you recommend using in order to fuse them correctly in the EKF?

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [May 2, 2023, 9:09am UTC](https://community.stereolabs.com/t/understanding-the-difference-between-the-covariances-of-pose-with-covariance-topic-and-odom-topic/2535/2 "2023-05-02T09:09:32Z")

</div>

Hi @gdanan  
Welcome to the Stereolabs community.

The correct behavior of the covariance is the one described for the `pose` topic.  
The covariance published with the `odom` topic is related to the “odometry step”, so it’s not a cumulative covariance, but it’s relative only to the latest step.  
We will fix this behavior.

---

<div class="post-metadata">

**Author:** ![gdanan](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/g/e19b73/32.png) [@gdanan](https://community.stereolabs.com/u/gdanan)\
**Post date:** [May 3, 2023, 6:51pm UTC](https://community.stereolabs.com/t/understanding-the-difference-between-the-covariances-of-pose-with-covariance-topic-and-odom-topic/2535/3 "2023-05-03T18:51:36Z")

</div>

Thanks for the answer!  
So the odom covariance is purposely bounded to 2e-6?

And which behavior will you fix? the odom topic covariance? or the sudden covariance explosion of the pose\_with\_covariance topic?

So according to your answer, in order to fuse the ZED camera with other sensors in my EKF I should use the odom topic, right?

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [May 4, 2023, 10:27am UTC](https://community.stereolabs.com/t/understanding-the-difference-between-the-covariances-of-pose-with-covariance-topic-and-odom-topic/2535/4 "2023-05-04T10:27:59Z")

</div>

The covariance of the topic is to be fixed.

Usually in the EKF you should fuse the odometry information that is continuous, so it does not jump, a situation that can bring a bad estimation of the velocity.

---

<div class="post-metadata">

**Author:** ![gdanan](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/g/e19b73/32.png) [@gdanan](https://community.stereolabs.com/u/gdanan)\
**Post date:** [May 4, 2023, 11:27am UTC](https://community.stereolabs.com/t/understanding-the-difference-between-the-covariances-of-pose-with-covariance-topic-and-odom-topic/2535/5 "2023-05-04T11:27:06Z")

</div>

The /odom topic covariance is to be fixed?

---

<div class="post-metadata">

**Author:** ![dcknowles](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/d/e47774/32.png) [@dcknowles](https://community.stereolabs.com/u/dcknowles)\
**Post date:** [May 9, 2023, 10:09pm UTC](https://community.stereolabs.com/t/understanding-the-difference-between-the-covariances-of-pose-with-covariance-topic-and-odom-topic/2535/6 "2023-05-09T22:09:57Z")

</div>

Thank you for the clarification, and I look forward to the covariance being updated.

@Myzhar could you also give us insight or documentation on the strategy StereoLabs uses for computing the pose/VIO covariance in the first place? I see that if the camera is assumed to be in a 2D plane, then the Z, x-axis rotation, and y-axis rotation diagonal and corresponding cross-correlation terms [are zeroed out](https://github.com/stereolabs/zed-ros-wrapper/blob/master/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp#L1721-L1727), but how are the rest of the covariance terms computed?
