# Height estimation error

**URL:** <https://discuss.px4.io/t/height-estimation-error/34674>\
**Category:** v1.14\
**Created:** [October 6, 2023, 10:08am UTC](https://discuss.px4.io/t/height-estimation-error/34674 "2023-10-06T10:08:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nonn0](https://discuss.px4.io/user_avatar/discuss.px4.io/nonn0/32/6904_2.png) [@Nonn0](https://discuss.px4.io/u/Nonn0)\
**Post date:** [October 6, 2023, 10:08am UTC](https://discuss.px4.io/t/height-estimation-error/34674/1 "2023-10-06T10:08:56Z")

</div>

We have problems flying offboard using Vison, where we are not able to takeoff at a predefined altitude (we are flying indoor).  
Then I investigated a little be more and hence I did a test (here the result: [https://logs.px4.io/plot\_app?log=be6f9b48-5a1e-446b-af7f-065ec7536cb8](https://logs.px4.io/plot_app?log=be6f9b48-5a1e-446b-af7f-065ec7536cb8)) where the drone was on a desk, the motors weren’t powered and manually I moved the drone up and down. I compared the ekf2 estimation with the ranger finder reading and something is wrong.  
The range sensor works fine but the EKF2 local position NED (z-axis) is wrong.  
Can anyone help me understand where I am wrong or if there is a software problem?  
Thanks in advance, Massimo

The main params config for the ekf2 filter are the following:  
EKF2\_HGT\_REF: 2  
EKF2\_RNG\_CTRL: 2

---

<div class="post-metadata">

**Author:** ![AlexKlimaj](https://discuss.px4.io/user_avatar/discuss.px4.io/alexklimaj/32/14479_2.png) [@AlexKlimaj](https://discuss.px4.io/u/AlexKlimaj)\
**Post date:** [November 3, 2023, 3:33pm UTC](https://discuss.px4.io/t/height-estimation-error/34674/2 "2023-11-03T15:33:39Z")

</div>

This may or may not be relevant to your issue.

> <https://github.com/PX4/PX4-Autopilot/pull/22294>
>
> Continuation of https://github.com/PX4/PX4-Autopilot/pull/21885 and should fix h…ttps://github.com/PX4/PX4-Autopilot/issues/22221
> 
> Flew under the deck which caused the GNSS fusion to stop then flew back out.
> https://review.px4.io/plot\_app?log=d6be638f-4ca1-4ed9-ae6b-8969ea724a9a
> 
> On a 650
> https://review.px4.io/plot\_app?log=de32ab72-e175-4ea4-8d6b-a76fae956b7e

---

<div class="post-metadata">

**Author:** ![Jetson\_Nano](https://discuss.px4.io/user_avatar/discuss.px4.io/jetson_nano/32/14871_2.png) [@Jetson\_Nano](https://discuss.px4.io/u/Jetson_Nano)\
**Post date:** [November 16, 2024, 10:57am UTC](https://discuss.px4.io/t/height-estimation-error/34674/3 "2024-11-16T10:57:51Z")

</div>

@Nonn0 Did you get to solve this error? Even I’m facing the same issues.

---

<div class="post-metadata">

**Author:** ![Nonn0](https://discuss.px4.io/user_avatar/discuss.px4.io/nonn0/32/6904_2.png) [@Nonn0](https://discuss.px4.io/u/Nonn0)\
**Post date:** [November 18, 2024, 8:55am UTC](https://discuss.px4.io/t/height-estimation-error/34674/4 "2024-11-18T08:55:07Z")

</div>

No. I found that the range sensor is integrated into the EKF2 after a distance threshold. Before such an altitude, the EKF2 uses the IMU and an internal dynamical model (I guess) to estimate the altitute

---

<div class="post-metadata">

**Author:** ![Jetson\_Nano](https://discuss.px4.io/user_avatar/discuss.px4.io/jetson_nano/32/14871_2.png) [@Jetson\_Nano](https://discuss.px4.io/u/Jetson_Nano)\
**Post date:** [December 11, 2024, 10:27am UTC](https://discuss.px4.io/t/height-estimation-error/34674/5 "2024-12-11T10:27:32Z")

</div>

Thank you for reverting back.
