Home        Store        Docs        Blog

Set target depth in Pixhawk using Pymavlink

pymavlink
ardusub
(Sakib Ahmed) #1

Hi,
I just started working on my AUV. I wanted to control it using python and pymavlink library.
How can make the rover stay at certain depth using the depth hold mode.
I can switch to “Stabilize” mode using pymavlink. But not in depth hold mode.

So, can anyone help to set the mode to “Depth Hold” and how to set the target depth

0 Likes

(Patrick José Pereira) #2

Hi Sakib,

You should be able to set “Depth Hold” mode, please check the ACK return to investigate the problem.
Also, you can check our pymavlink documentation for examples.

0 Likes

(Jacob) #3

Depth hold requires an external pressure sensor like the Bar30 to be connected. If the sensor is not detected, or there is some problem with it, you will not be allowed to use depth hold.

0 Likes

(Adnan Sabbir) #4

Hi, Jacob.
Sorry for replying late.
We attached the Bar 30 and the depth hold mode is working fine. But we have another problem now. When the target depth is set, The ROV come around 2 feet above and then again goes down to that depth.
How can we hold the dept with maximum 5 inch error ?

0 Likes

(Jacob) #5

There is some problems with depth hold mode. We are working on it:

0 Likes

(Adnan Sabbir) #6

In that case can we try something different.
In stabilize mode, we take the reading of depth sensor and then from the pymavlink(We are using an Odroid to control our AUV) and the manually throttle down the AUV. So it stays at perfect depth.

0 Likes

(Patrick José Pereira) #7

Hi Adnan,

Yes, it’s possible to do the manual alt control via pymavlink and creating your personal algorithm.

0 Likes

(Jacob) #8

The better approach would be to make better code for depth hold in the firmware. The pymavlink approach will introduce unnecessary and unwanted latency.

0 Likes