# Depth estimate suddenly changing (while positioning system enabled)

**URL:** <https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810>\
**Category:** ArduSub\
**Created:** [April 12, 2026, 8:12pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810 "2026-04-12T20:12:27Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![sietse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/sietse/32/16062_2.png) [@sietse](https://discuss.bluerobotics.com/u/sietse)\
**Post date:** [May 11, 2026, 10:21am UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/21 "2026-05-11T10:21:11Z")

</div>

Hey @rafael.lehmkuhl and @williangalvani !

Did you by any chance have the oppurtunity to look at the latest (The ones from the 7th of May) Cockpit MavLink Dumps and AHR2.alt error jumps, yet?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![rafael.lehmkuhl](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rafael.lehmkuhl/32/6630_2.png) [@rafael.lehmkuhl](https://discuss.bluerobotics.com/u/rafael.lehmkuhl)\
**Post date:** [May 11, 2026, 12:21pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/22 "2026-05-11T12:21:34Z")

</div>

Hey @sietse! I have took a look but forgot to answer.

The 3 Cockpit logs look normal to me. No jumps at all. Take a look below. Do those values make sense? I see no jumps at all. During those sessions, did you see the values jumping in the Cockpit widget?

 ![SCR-20260511-iqqc](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/0/1/014fe2b9771353cf1bdced5e79443c831738c07b.jpeg)  
 ![SCR-20260511-iqmu](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/d/a/daccf129c8316bfabb24e02981baf707623c06fb.jpeg)  
 ![SCR-20260511-iqjo](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/7/0/7048369694ef8aeced2c14a16a837a5fbd0ffbed.jpeg)

---

<div class="post-metadata">

**Author:** ![sietse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/sietse/32/16062_2.png) [@sietse](https://discuss.bluerobotics.com/u/sietse)\
**Post date:** [May 11, 2026, 12:45pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/23 "2026-05-11T12:45:17Z")

</div>

Hey @rafael.lehmkuhl,

The Depth Indicator displayed 0 m throughout all three tests, which is already an issue on its own.

The second issue seems to be with AHR2.Alt. It shows unusual jumps, as visible in the screenshots I sent on May 6, especially the final screenshot of 00000238.bin. The same behavior is also visible in the third screenshot you just sent, right at the very start.

> [@sietse](#):
>
> ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/7/6/769415967b1e59c19fa1982ca12157aa6f404588.png)

> [@rafael.lehmkuhl](#):
>
> ![SCR-20260511-iqjo](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/7/0/7048369694ef8aeced2c14a16a837a5fbd0ffbed.jpeg)

In that data, there is roughly a 7 m jump within about 0.1 seconds. Since my basin is only 1.2 m deep, these AHR2.Alt values cannot be the correct absolute depth values.

However, Baro[1].Alt appears to be reporting the correct absolute depth readings.

So my current understanding is:  
The sudden jumps in the Depth Indicator are likely caused by unrealistic jumps in AHR2.Alt, which may be an ArduSub 4.5.7 issue.

The Depth Indicator sometimes showing 0m for a extended period of time seems to be a separate issue with the Cockpit Depth Indicator Widget, since valid depth values are still present in Baro[1].Alt.

---

<div class="post-metadata">

**Author:** ![rafael.lehmkuhl](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rafael.lehmkuhl/32/6630_2.png) [@rafael.lehmkuhl](https://discuss.bluerobotics.com/u/rafael.lehmkuhl)\
**Post date:** [May 11, 2026, 1:13pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/24 "2026-05-11T13:13:28Z")

</div>

Agree. It looks like we may have two different bugs. If the Depth Indicator was showing 0 during those moments, it indeed has some problem, and it is separated to the bug in ArduSub (which is causing the AHRS2.altitude to differ from the Baro).

I will investigate the Cockpit one. I would ask you to help me on confirming how the problem occurs by recording 3 things at the same time:

- vehicle bin log (will have the Baro values)
- cockpit jsonl log (will have the ahrs2.altitude values received by cockpit)
- screen recording (so we can see what the widget is showing)

Try to record those all at the same time and make sure that they include the bug happening. This way we can more easily understand what is going on.

Thanks again for the detailed report and the patience on helping finding what is going on.

---

<div class="post-metadata">

**Author:** ![sietse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/sietse/32/16062_2.png) [@sietse](https://discuss.bluerobotics.com/u/sietse)\
**Post date:** [May 11, 2026, 2:20pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/25 "2026-05-11T14:20:48Z")

</div>

Hey @rafael.lehmkuhl!

I immediately peformed a test for you to grab the .bin file, the .jsonl file and a screen recording.

Here are the files (The screenrecording was too big to upload here directly):

> **[BlueRobotics - Google Drive](https://drive.google.com/drive/folders/18mNsRBbhAulzEiHm07zNN6OGZBESbvsH?usp=drive_link)**

> [@rafael.lehmkuhl](#):
>
> Try to record those all at the same time and make sure that they include the bug happening. This way we can more easily understand what is going on.

Note that this time the cockpit widget viewed 0m from the start, and also watch the HUD widget give different values in the second half of the video! I watched the .bin files myself and I can confirm this AHR2.Alt shift is in there, while Baro[1].alt stays working properly. The only thing is that I could not get the change of the depth indicator going from something realistic to 0. Unfortunately…

> [@rafael.lehmkuhl](#):
>
> Thanks again for the detailed report and the patience on helping finding what is going on.

No worries at all! I’m happy to work things out, together 😉

---

<div class="post-metadata">

**Author:** ![rafael.lehmkuhl](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rafael.lehmkuhl/32/6630_2.png) [@rafael.lehmkuhl](https://discuss.bluerobotics.com/u/rafael.lehmkuhl)\
**Post date:** [May 13, 2026, 12:29pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/26 "2026-05-13T12:29:14Z")

</div>

Thanks again @sietse! I will analyze everything today!

---

<div class="post-metadata">

**Author:** ![amarburg](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@amarburg](https://discuss.bluerobotics.com/u/amarburg)\
**Post date:** [May 13, 2026, 11:24pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/27 "2026-05-13T23:24:14Z")

</div>

I wanted to follow up on my depth estimate issues as well (@EliotBR )

In our last dive we experimented with adding a ferrite to the depth sensor, and eventually replaced our older Bar30 sensor with a new unit.

This reduced the spurious measurements and seems to fix the in situ calibration issue.

However, the depth reading in cockpit continued to be incorrect at ~-40m while on the surface. We examined the SCALED\_PRESSURE2, VFR\_HUD and GLOBAL\_POSITION\_INT altitudes in Mavlink and determined the depth _was_ generally tracking to the vehicle motion, but had a large “offset” which seemed to change on an infrequent (~10-30s?) basis.

Last year, we added an [integrated GPS receiver](https://www.robotshop.com/products/radiolink-se100-gps-module-pixhawk?srsltid=AfmBOoolZI_8GYIwubGAFE4dWWeWhiwK-gxdBwVft5gsiWu81jlcpKx9Prk) for localization when on the surface.

We discovered the depth problems were resolved when we disabled the GPS receiver (set SERIAL\_PROTOCOL1 from `GPS` to `None`). On some investigation, it seems that EKF was getting an absolute altitude update from the GPS … the ~40m offset corresponded to our height above local geoid.

Getting GPS-derived **position** when on the surface works well for our missions, so I’d like to keep that functionality.

What’s the EKF’s expected behavior for handling altitudes from GPS? Can we get Ardupilot to ignore GPS altitude? Is it taking a “zero altitude” at any point or can we force it to do so?

---

<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 14, 2026, 12:53am UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/28 "2026-05-14T00:53:21Z")

</div>

> [@amarburg](#):
>
> What’s the EKF’s expected behavior for handling altitudes from GPS?

What are your `EKF3_SRCx_POSZ` parameters set to?

---

<div class="post-metadata">

**Author:** ![amarburg](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@amarburg](https://discuss.bluerobotics.com/u/amarburg)\
**Post date:** [May 14, 2026, 4:13am UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/29 "2026-05-14T04:13:31Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/6/4/64b17a13b4004554d4873839c80937c05cb57101.png)

This GPS was installed by a student group, so they could have set things up weird. ..

---

<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 14, 2026, 8:30pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/30 "2026-05-14T20:30:44Z")

</div>

Hmm, what about [`EK3_OGN_HGT_MASK`](https://ardupilot.org/sub/docs/parameters-Sub-stable-V4.5.7.html#ek3-ogn-hgt-mask-bitmask-control-of-ekf-reference-height-correction)?

---

<div class="post-metadata">

**Author:** ![amarburg](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@amarburg](https://discuss.bluerobotics.com/u/amarburg)\
**Post date:** [May 14, 2026, 9:53pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/31 "2026-05-14T21:53:19Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/c/9/c960702999ea88772fc4dfa971dc9896ae575fd1.png)

---

<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 15, 2026, 3:33am UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/32 "2026-05-15T03:33:11Z")

</div>

Ok, I had a chat with Willian and have done some more digging. The current state of investigation:

1. The `AHRS2` MAVLink message is for the autopilot’s _secondary_ estimator, and likely shouldn’t be used for indicators other than for debugging purposes
  - Cockpit currently uses this for its depth indicators because ArduSub 4.5 doesn’t send `VFR_HUD` messages without a horizontal position estimate, which has been fixed in 4.7 (currently in beta) and in the 4.5 _branch_, but is not in a stable release yet
    - We’ll need to update Cockpit to not use that by default, and are intending to work that in with a broader change to move the depth widget to use a selectable source from the data lake (as one of several such changes)

  - As I understand it the secondary estimator is the old DCM, and doesn’t do anything fancy with altitude specifically, so it’s likely very similar to what the EKF would be putting out anyway, in which case it’s perhaps more of a semantic issue than (currently) a practical one, though that remains to be fully determined
  - There are multiple different MAVLink messages with some kind of altitude in them, and it’s not yet obvious which (if any) should consistently be used / is implemented with the behaviour we want, especially since some of them are conditional on other hardware on the vehicle

2. In looking at @sietse’s provided logs, the only altitude jump (in both estimators) seems to be happening when the home gets set, which I believe corresponds to the origin being set automatically upon sufficient stability of the GPS position, and _may_ indicate a bug (depending on whether the EKF actually outputs data making use of that offset, since it technically stores the offset separately)
  - This screenshot shows the autopilot’s canonical altitude (brown), compared to the primary (EKF3, purple) and secondary (DCM, orange) estimator altitudes, which I’ve manually offset up/above and down/below (respectively) to make the comparison easier
    - It does look to be following the EKF3 one rather than the DCM one (see the little trough in the first peak), though they are also very similar to each other
    - The Baro altitude (blue) is the same shape (closest to the DCM altitude, somewhat amusingly), but I’ve shown it up near the others whereas it is actually down near zero - the other signals are offset from it by the GPS altitude from the time of the origin change  
 ![Screenshot 2026-05-15 at 9.45.28 am](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/6/e/6eb541fb103a7720c76796b6057f27c61958713e.png)

3. @amarburg mentioned a more general jumping problem, where the offset seemingly changes during operation (not just when the origin gets set, which can only happen once), which was also shown in one of @sietse’s screenshots
  - I don’t believe we have an actual log of this to look at, which makes it harder to investigate that issue
  - Given this apparently goes both up _and_ down, it can’t be solely caused by the autopilot’s negative altitude recalibration behaviour, and in the screenshot there aren’t big noise spikes anyway
  - There was a [very recent change](https://github.com/ArduPilot/ardupilot/pull/32945) to resolve an issue of GPS values leaking into the EKF, but it’s only being filtered on whether an XY position is unspecified, and I’m told that section of the code isn’t relevant to altitude
    - There may be other similar bugs in the PosZ code-path(s), which we’ll need to check - we’re aware that some of ArduPilot’s codebase has traditionally assumed GPS positioning to be the norm/baseline

4. It’s unclear whether there are _also_ barometer driver and noise issues involved, though that at least seems unlikely in @sietse’s case

This is important stuff to get right, and will require some more digging before we’ve established what exactly is wrong and how to fix it or work around it. There’s also a lot of other high priority work at the moment, so (aside from adding the Cockpit source selection option) we may have to hold off on the investigating for a week or two.

A longer pair of DataFlash (`.bin`) and MAVLink telemetry logs showing _multiple_ jumps instead of just one origin change one may help to determine the source of that less clear issue.

---

<div class="post-metadata">

**Author:** ![amarburg](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@amarburg](https://discuss.bluerobotics.com/u/amarburg)\
**Post date:** [May 15, 2026, 1:47pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/33 "2026-05-15T13:47:40Z")

</div>

@EliotBR thanks for that synthesis, and apologies for not posting binlogs. Here are two from recent testing:

[00000016\_without\_gps.BIN](https://discuss.bluerobotics.com/uploads/short-url/mnxwzSvLYcOAcUyeXiFoQpVvsMB.BIN) (16.9 MB)  
[00000015\_with\_gps.BIN](https://discuss.bluerobotics.com/uploads/short-url/dHojD0dMXmWAcMovHGO50FRjmz.BIN) (4.8 MB)

The ROV is in a ~1m test tank. It is inside but near a large window, so the GPS positioning is inconsistent.

Here is the plot from `_with_gps.BIN` showing pressure (blue), GPS altitude (red) and canonical position (green)

In the plot you see us push the ROV down, and also hoist it “up” out of the water twice.

The two points I’d call out are the large DC offset in the canonical position ~43m, which we think we can attribute to the GPS altitude. And the “racheting” down of the depth throughout the trace.

There is a slight downward trend to the measured pressure which may have been actual drop in atmospheric pressure?

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/4/c/4c3e0cab5322c35751540a2eccde4b223bd94535.png)

The `_without_gps.BIN` does not contain the `POS` entry, which may be a hint to what’s happening?

The pressure altitude is generally reasonable with one spurious outlier

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/5/b/5b188f41cf0278fea7ba412a0475c8635ac4d28f.png)

---

<div class="post-metadata">

**Author:** ![sietse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/sietse/32/16062_2.png) [@sietse](https://discuss.bluerobotics.com/u/sietse)\
**Post date:** [May 18, 2026, 9:24am UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/34 "2026-05-18T09:24:10Z")

</div>

Thanks @Eliot, that helps clarify the distinction between the two behaviours.

For my case, I think your interpretation matches what I have been seeing while re-analysing my .BIN logs. The main issue appears to be a large offset introduced when the GPS origin is set, rather than continuous jumping or ratcheting behaviour throughout the dive.

This does seem to point to an issue with how AHR2.Alt is being calculated or updated in relation to the GPS origin.

> [@EliotBR](#):
>
> The `AHRS2` MAVLink message is for the autopilot’s _secondary_ estimator, and likely shouldn’t be used for indicators other than for debugging purposes

Like you already mentioned here above, AHRS2 isn’t what should be used for the exact Depth Indicator.

Disabling GPS appears to avoid the issue.

> [@EliotBR](#):
>
> 4.5 _branch_, but is not in a stable release yet

> [@EliotBR](#):
>
> We’ll need to update Cockpit to not use that by default

Do you have an estimate for when we might see a new ArduSub 4.5 stable release and/or a Cockpit release that includes the planned depth-source fixes?

> [@EliotBR](#):
>
> it’s not yet obvious which (if any) should consistently be used

Also, would there be any way to expose BARO[1].Alt as a DataLake variable and use that directly as the source for the depth indicator in Cockpit?

From what I have seen in our logs, BARO[1].Alt has been very reliable for us and has consistently shown the correct depth values, even when the other depth/altitude sources were affected by the GPS/origin offset issue. So being able to select that directly in Cockpit would be very useful, at least as a workaround or configurable option.

If you’d like to have more logs or details for me that would make things easier for you, let me know!

Thanks!

---

<div class="post-metadata">

**Author:** ![rafael.lehmkuhl](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rafael.lehmkuhl/32/6630_2.png) [@rafael.lehmkuhl](https://discuss.bluerobotics.com/u/rafael.lehmkuhl)\
**Post date:** [May 18, 2026, 1:25pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/35 "2026-05-18T13:25:07Z")

</div>

@sietse we are going to make a Cockpit release this week that includes the ability to change the source of your depth widgets. In the ArduSub front, @EliotBR will have a better estimate.

In the meantime, if you just need the mini-widget indicator (and not the HUD), you can add a [Very Generic Indicator](https://blueos.cloud/cockpit/docs/stable/usage/advanced/#very-generic-indicators) widget and point it to the `/mavlink/1/1/VFR_HUD/alt` variable. This will show the same value as is being shown on QGC.

---

<div class="post-metadata">

**Author:** ![sietse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/sietse/32/16062_2.png) [@sietse](https://discuss.bluerobotics.com/u/sietse)\
**Post date:** [May 18, 2026, 2:09pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/36 "2026-05-18T14:09:21Z")

</div>

Hey @rafael.lehmkuhl!

I’m looking forward to the new Cockpit release.

> [@rafael.lehmkuhl](#):
>
> if you just need the mini-widget indicator (and not the HUD)

Does this mean that the generic indicator will use the same data source that the HUD depth widget normally displays?

If that is the case, I am wondering whether this would actually solve the problem, since we observed the following:

> [@sietse](#):
>
> and also watch the HUD widget give different values in the second half of the video!

In the video I uploaded to Google Drive, the Depth indicator shows 0m, while the HUD Depth shows around -11m to -12 m.

The test basin was only about 1m deep, so there was still an approximately 11m offset in the HUD Depth widget as well. Wouldn’t that suggest that the HUD Depth widget was also using AHR2.Alt instead of Baro[1].Alt? Or atleast VFR\_HUD/alt is based on the AHR2.alt value rather than the Baro[1].alt value?

> [@rafael.lehmkuhl](#):
>
> `/mavlink/1/1/VFR_HUD/alt`

I’m currently selecting this one for my generic indicator, but I was wondering what the difference is between the /mavlink/1/1/VFR\_HUD/alt and the VFR\_HUD/alt.

![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/e/3/e35a0b402e1342e290d9c6a69c069a75db8e9644.png)

Thanks! 😃

---

<div class="post-metadata">

**Author:** ![rafael.lehmkuhl](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rafael.lehmkuhl/32/6630_2.png) [@rafael.lehmkuhl](https://discuss.bluerobotics.com/u/rafael.lehmkuhl)\
**Post date:** [May 18, 2026, 2:27pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/37 "2026-05-18T14:27:24Z")

</div>

Actually both the Depth Indicator (the mini-widget) and the Depth HUD (the regular widget) consume from the same place (AHRS2.altitude), so they should show the same value. If they are showing different values for you, this can indicate a bug in the widget. I will take a look.

I’m not sure if @EliotBR and @williangalvani have decided yet how exactly this will be implemented in ArduSub, but I believe they will try to expose something around what is being shown in the Baro[…].alt.

About `VFR_HUD/alt` vs `/mavlink/1/1/VFR_HUD/alt`, the first one is a legacy variable, while the new one with the `/mavlink/x/y` prefix was created to allow multi-vehicle/multi-components support in Cockpit. For a single vehicle operation, they will show you the same value, but try to always use the new one. In the future we are going to migrate everyone to the newer type and stop exposing the legacy one.

Let us know how the `VFR_HUD.alt` works for you.

---

<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 18, 2026, 3:53pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/38 "2026-05-18T15:53:34Z")

</div>

Out of curiosity, could you try the latest beta ArduSub and see if the issue is still there?

I have a change in mind that would stop using the EKF origin for the altitude when it’s set to use the baro as its source, but Willian mentioned he tried the latest state and couldn’t replicate the issue to start with. I’m not aware of any code changes that would have fixed that, but it doesn’t hurt to confirm 🤷🏼‍♂️

---

<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 18, 2026, 10:24pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/39 "2026-05-18T22:24:31Z")

</div>

> [@amarburg](#):
>
> … binlogs. Here are two from recent testing …

Thanks - I’ll try to take a look late this week 🙂

> [@sietse](#):
>
> Do you have an estimate for when we might see a new ArduSub 4.5 stable release

ArduPilot is nearing the stable combined release of 4.7 - currently estimated in ~1 month. If you can confirm the origin issue isn’t already fixed in the latest 4.7 beta then we should be able to make this a priority to fix as part of that. That said, please check all 3 of `VFR_HUD.alt`, `GLOBAL_POSITION_INT.alt`, and `GLOBAL_POSITION_INT.relative_alt` - I believe the last one never includes an origin offset (though be aware that if you set a home position with a non-zero altitude, it _will_ adjust to be relative to that).

Given the proximity of 4.7 I’m unsure whether we’ll make another Sub-4.5 stable. We could push one out with the current state of the branch, but I’m not in control of that process, and there’s lots of ongoing release testing and some feature developments that that would be taking time away from. Is it important to you that 4.5 gets that additional stable release?

I’m unsure if there are any CI issues with 4.5 now (which would make another release of it extra unlikely), but I was at least able to build the latest branch state without issues if you want to try that version too:  
[ardusub\_4-5\_latest\_navigator.elf](https://discuss.bluerobotics.com/uploads/short-url/fSmAxMNtOEvg7hbbxjxe52dm5Df.elf) (2.2 MB)

> [@sietse](#):
>
> would there be any way to expose BARO[1].Alt as a DataLake variable

That’s internal autopilot data that doesn’t currently get exposed directly over MAVLink. The closest thing would be to calculate it in Cockpit by reading the pressure data and adjusting it using the parameter values read from the autopilot. I’m wanting to make sending the baro altitude directly the expected behaviour when the EKF is set baro for PosZ, but that’s an unimplemented firmware change that will require discussion with others, and may have nuances I’m not thinking of that make it infeasible.

---

<div class="post-metadata">

**Author:** ![sietse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/sietse/32/16062_2.png) [@sietse](https://discuss.bluerobotics.com/u/sietse)\
**Post date:** [May 19, 2026, 2:17pm UTC](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810/40 "2026-05-19T14:17:52Z")

</div>

Hey @rafael.lehmkuhl and @EliotBR !

> [@rafael.lehmkuhl](#):
>
> Actually both the Depth Indicator (the mini-widget) and the Depth HUD (the regular widget) consume from the same place (AHRS2.altitude), so they should show the same value

We concluded that AHR2.alt isn’t a proper value for depth. Therefore the Depth Indicator would give me strange values, since it’s using AHR2.alt.

We also concluded that the Depth Indicator stating 0m, is a cockpit bug. This has nothing to do with AHR2.alt giving odd values. This is because AHR2.alt never flatlined at exactly 0m.

During my dives in a 1m deep tank. The Depth Indicator and HUD indicator would work properly till a Set Origin occurs. When the Set Origin occurs, AHR2.alt (in a few tests) would jump from a 0 to 1m depth to a 11 to 12m depth. The Set Origin messing with the AHR2.alt value is a bug, therefore it should either be fixed, or AHR2.alt should just not be used for representing the actual Depth.

A different issue is that, while the Depth Indicator and Depth HUD are both using AHR2.alt, the Depth Indicator is displaying 0m, while the Depth HUD is displaying the actual AHR2.alt value, which is the jumped odd value, and not even the right Baro[1].alt value.

I’m assuming VFR\_HUD/alt is also using AHR2.alt, instead of mirroring the Baro[1].alt value? Otherwise I wouldn’t get those weird 11m and 12m depth values on my Depth HUD, right?  
So trying to use VFR\_HUD.alt for the Generic Indicator, wouldn’t fix the issue, since it’s basically that same AHR2.alt value?

> [@EliotBR](#):
>
> could you try the latest beta ArduSub and see if the issue is still there?

> [@EliotBR](#):
>
> if you want to try that version too:  
> [ardusub\_4-5\_latest\_navigator.elf](https://discuss.bluerobotics.com/uploads/short-url/fSmAxMNtOEvg7hbbxjxe52dm5Df.elf) (2.2 MB)

I’ve been testing ArduSub v4.7.0 Beta 5, your modified v4.5, and the regular v4.5.7.

Here is a Google Drive link where I uploaded the .BIN files for each ArduSub version, along with a screen recording of each test. In the recordings, I used the Plotter widget to plot AHRS2.altitude, VFR\_HUD.alt, GLOBAL\_POSITION\_INT.alt, and GLOBAL\_POSITION\_INT.relative\_alt.

> **[19th of May Test Files - Google Drive](https://drive.google.com/drive/folders/1gN0fNGWXYeplkI39tiSQqOsf_zVf-vtO?usp=drive_link)**

Hope this helps! 😃

[Previous page](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810.md?page=1)

[Next page](https://discuss.bluerobotics.com/t/depth-estimate-suddenly-changing-while-positioning-system-enabled/22810.md?page=3)
