# Set target depth in Pixhawk using Pymavlink

**URL:** <https://discuss.bluerobotics.com/t/set-target-depth-in-pixhawk-using-pymavlink/4332>\
**Category:** Blue Robotics Software\
**Tags:** ardusub, pymavlink, positioning\
**Created:** [February 13, 2019, 9:07pm UTC](https://discuss.bluerobotics.com/t/set-target-depth-in-pixhawk-using-pymavlink/4332 "2019-02-13T21:07:55Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [May 11, 2021, 1:40am UTC](https://discuss.bluerobotics.com/t/set-target-depth-in-pixhawk-using-pymavlink/4332/10 "2021-05-11T01:40:45Z")

</div>

In [this comment](https://discuss.bluerobotics.com/t/altitude-hold-and-depth-hold-in-pymavlink/5686/2) (from a while ago) @williangalvani was discussing the possibility of using the `SET_POSITION_TARGET_GLOBAL_INT` or `SET_POSITION_TARGET_GLOBAL_NED` messages for setting the depth to hold. I’m not sure if support has been added for that in ArduSub, or if you’d need to add it yourself, but if you’re able to use it then you’d be able to retrieve the target value with `POSITION_TARGET_GLOBAL_INT` or `POSITION_TARGET_GLOBAL_NED` respectively.

---

_[View the full topic](https://discuss.bluerobotics.com/t/set-target-depth-in-pixhawk-using-pymavlink/4332)._
