# Using Ping Sonar in QGC - which Distance\_Sensor value to choose?

**URL:** <https://discuss.bluerobotics.com/t/using-ping-sonar-in-qgc-which-distance-sensor-value-to-choose/17119>\
**Category:** QGroundControl\
**Created:** [June 11, 2024, 12:46am UTC](https://discuss.bluerobotics.com/t/using-ping-sonar-in-qgc-which-distance-sensor-value-to-choose/17119 "2024-06-11T00:46:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnow](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@bsnow](https://discuss.bluerobotics.com/u/bsnow)\
**Post date:** [June 11, 2024, 12:46am UTC](https://discuss.bluerobotics.com/t/using-ping-sonar-in-qgc-which-distance-sensor-value-to-choose/17119/1 "2024-06-11T00:46:25Z")

</div>

Hi,

We have a Ping Sonar on our BlueROV. All working fine - BlueOS recognizes it, and we have ‘MAVLink Distances’ switched on, in the hopes of being able to feed the altimeter data in QGroundControl. The unit works just find in Ping Viewer, and altitude values seem correct.

When we try to read this value into QGroundControl, we can only see ‘Max\_Distance’ or ‘Min\_Distance’ as options, as well as a bunch of ‘RotationPitchXX’ options - which don’t seem like they would be the right choice. However, this post ([NMEA Depth sensor display in QGC](https://discuss.bluerobotics.com/t/nmea-depth-sensor-display-in-qgc/17065)) seems to suggest we should choose the "RotationPitch270’ value to get our distances into QGC. This seems unintuitive – is this the correct value to choose?

On a slightly related note, can we connect to the the sensor and read the date in QGC _and_ PingViewer at the same time, or only at application at a time?

Thanks,

Ben

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [June 11, 2024, 2:31am UTC](https://discuss.bluerobotics.com/t/using-ping-sonar-in-qgc-which-distance-sensor-value-to-choose/17119/2 "2024-06-11T02:31:21Z")

</div>

Hi @bsnow,

> [@bsnow](#):
>
> This seems unintuitive – is this the correct value to choose?

Pitching up by 270 degrees is equivalent to pitching down by 90 degrees. The Ping Sonar driver in BlueOS currently assumes that a connected Ping Sonar device is pointing downwards, acting as an altimeter, so that’s how it sends the distance sensor messages to the autopilot.

There are [plans to expand the support in future](https://github.com/bluerobotics/BlueOS/issues/264), including allowing the user to select the orientation their device is actually pointing in (e.g. in case they want to use it for lateral obstacle avoidance instead of vertical distance to the sea floor / river/lake bed), but for now it’s just assumed down.

> [@bsnow](#):
>
> On a slightly related note, can we connect to the the sensor and read the date in QGC _and_ PingViewer at the same time, or only at application at a time?

Yes, both should work simultaneously - if the driver is receiving profile requests from Ping Viewer then it just skims the distance values from the sensor’s responses to send to the autopilot (which then passes them on to its control station, like QGC or Cockpit), whereas if there are no messages being sent then the driver requests distances from the sonar so it can send them to the autopilot.

---

<div class="post-metadata">

**Author:** ![bsnow](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@bsnow](https://discuss.bluerobotics.com/u/bsnow)\
**Post date:** [June 17, 2024, 2:17am UTC](https://discuss.bluerobotics.com/t/using-ping-sonar-in-qgc-which-distance-sensor-value-to-choose/17119/3 "2024-06-17T02:17:56Z")

</div>

Hi @EliotBR,

Thanks for the explanation, got it working with the Rotation270 parameter from the distance sensor!

Ben
