# How to set mb12xx sonar to use it as Z value in local\_position?

**URL:** <https://discuss.px4.io/t/how-to-set-mb12xx-sonar-to-use-it-as-z-value-in-local-position/23035>\
**Category:** PX4 Autopilot\
**Created:** [June 28, 2021, 2:12pm UTC](https://discuss.px4.io/t/how-to-set-mb12xx-sonar-to-use-it-as-z-value-in-local-position/23035 "2021-06-28T14:12:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11137](https://discuss.px4.io/user_avatar/discuss.px4.io/11137/32/8937_2.png) [@11137](https://discuss.px4.io/u/11137)\
**Post date:** [June 28, 2021, 2:12pm UTC](https://discuss.px4.io/t/how-to-set-mb12xx-sonar-to-use-it-as-z-value-in-local-position/23035/1 "2021-06-28T14:12:09Z")

</div>

How to set mb12xx sonar to use it as Z value in local\_position? As I understand if I will set EKF2\_HGT\_MODE as Range sensor it will not help me with mb12xx.  
I`d like to use to local pose px4flow(without rabge sensor) and mb12xx as range sensor, but not to use baro and GPS. Is it possible? May be it`s possible to do this from code?

---

<div class="post-metadata">

**Author:** ![11137](https://discuss.px4.io/user_avatar/discuss.px4.io/11137/32/8937_2.png) [@11137](https://discuss.px4.io/u/11137)\
**Post date:** [June 28, 2021, 2:45pm UTC](https://discuss.px4.io/t/how-to-set-mb12xx-sonar-to-use-it-as-z-value-in-local-position/23035/2 "2021-06-28T14:45:23Z")

</div>

It posts data to distance\_sensor, but I`d like to see this data in locale\_position\_ned.z
