# Mavros/local_position/odom Z-Axis drift

Source: https://forum.modalai.com/topic/3131/mavros-local_position-odom-z-axis-drift
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2024-02-19 23:03:13 UTC by Kashish Garg
Replies: 5 · Views: 1536

## Kashish Garg · 2024-02-19 23:03:13 UTC

Hello, we are running into an issue where the qvio-server doesn't match with the odometry msgs published on /mavros/local_position/odom on the Starling platform.
I have run plotted the qvio and mavros/local_position odometries over time and there is an extensive divergence with the platform completely still
![bacfb1df-84c6-43c1-aaf7-29f43e5dd6a8-image.png](https://forum.modalai.com/assets/uploads/files/1708383786977-bacfb1df-84c6-43c1-aaf7-29f43e5dd6a8-image-resized.png)

## Reply by Kashish Garg · 2024-02-20 21:39:23 UTC

@Kashish-Garg Just bumping to get a hand with this. i have tried disabling Baro sensors and playing with enabling/disabling other sensors. Its clear the mavros/vision/pose is accurate, but on the z-axis in local_position is drifting/showing significant error. Any help is greatly appreciated!

## Reply by Moderator (ModalAI staff) · 2024-02-21 16:48:57 UTC (in reply to Kashish Garg)

@Kashish-Garg Does it fly properly without your code in manual and position modes? What does local_position report in QGC when you fly? 

Are you waiting a long time before taking off? What if you fly first to let EKF2 converge?

We don't have enough information to help you, you'll need to start with first principles to debug the system

## Reply by Riccardo Franceschini · 2024-02-23 13:03:06 UTC (in reply to Moderator)

Hi @Moderator and @Kashish-Garg, we have noticed a similar behavior involving a discrepancy between the qvio server and /mavros/local_position/pose on the z-axis. We have attempted to resolve this by disabling and re-enabling the barometer sensor, but the issue persists. The inconsistency does not always occur and does not appear to be related to aggressive flight behaviors.

## Reply by Zachary Lowell 0 · 2024-02-23 18:46:23 UTC

Is this indoor our outdoor flight? If you are running indoors, then the barometer should not be the main item used for ekf2_hgt_mode in PX4 and vision should be the detector for height source.

Can you attach an altimeter like a benewake lidar or something that is very bare metal and have that sensor become the range finder in the px4 instance?

Zach

## Reply by Kashish Garg · 2024-03-14 15:38:15 UTC (in reply to Riccardo Franceschini)

@Riccardo-Franceschini We were not able to resolve this issue. However because our control stack is sending TRPY commands to mavros, this didn't come into play at all. The concern for us originated when the drone was taking off significantly higher than commanded. It turned out the propeller coefficients we received from ModalAI were insufficient.
