# Depth-Hold mode custom depth/altitude

**URL:** <https://discuss.bluerobotics.com/t/depth-hold-mode-custom-depth-altitude/9195>\
**Category:** BlueROV2\
**Created:** [March 3, 2021, 12:43pm UTC](https://discuss.bluerobotics.com/t/depth-hold-mode-custom-depth-altitude/9195 "2021-03-03T12:43:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baaazo](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@Baaazo](https://discuss.bluerobotics.com/u/Baaazo)\
**Post date:** [March 3, 2021, 12:43pm UTC](https://discuss.bluerobotics.com/t/depth-hold-mode-custom-depth-altitude/9195/1 "2021-03-03T12:43:24Z")

</div>

Hello, I was trying to set the cutstom altitude using RC channels in depth hold mode and manual mode, however its pretty messy solution. Is there any kind of parameter that can change the target altitude in depth hold mode? I dont use guided mode since i need manual control over the robot with target depth/altitude dependant on sensory data.

---

<div class="post-metadata">

**Author:** ![williangalvani](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@williangalvani](https://discuss.bluerobotics.com/u/williangalvani)\
**Post date:** [March 3, 2021, 3:56pm UTC](https://discuss.bluerobotics.com/t/depth-hold-mode-custom-depth-altitude/9195/2 "2021-03-03T15:56:53Z")

</div>

Hi, check [this gist](https://gist.github.com/Williangalvani/78859b23d6eebdd899a1c2a5ece20804)

---

<div class="post-metadata">

**Author:** ![Baaazo](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@Baaazo](https://discuss.bluerobotics.com/u/Baaazo)\
**Post date:** [March 4, 2021, 12:59pm UTC](https://discuss.bluerobotics.com/t/depth-hold-mode-custom-depth-altitude/9195/3 "2021-03-04T12:59:15Z")

</div>

thanks for the response  
It works! After publishing altitude on setpoint raw/global topic on MAVROS it works perfectly as i wanted it to!

---

<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:** [September 7, 2021, 12:09am UTC](https://discuss.bluerobotics.com/t/depth-hold-mode-custom-depth-altitude/9195/4 "2021-09-07T00:09:50Z")

</div>

Since this has come up again, it’s worth noting that this is now an example in our [pymavlink documentation](https://www.ardusub.com/developers/pymavlink.html#set-target-depthattitude), in a more readable and versatile form than the initial gist.

---

<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:** [September 7, 2021, 12:09am UTC](https://discuss.bluerobotics.com/t/depth-hold-mode-custom-depth-altitude/9195/5 "2021-09-07T00:09:58Z")

</div>

Closed on September 7, 2021, 12:09am UTC


