-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inav_use_gps_no_baro testing and code review indicates erroneous description? #10040
Comments
Ah well done, you're completely right. This explains the hopeless Althold I had on the quad the other day. With the Baro disabled it was just using GPS altitude which when you've only just got a fix is usually inaccurate and drifts a lot. Althold was terrible initially but got better as the number of satellites increased which would have improved the GPS altitude measurement. I just tested with So the problem isn't so much enabling |
Actually looking at the history of
At least there's an easy fix, just turn that setting OFF if you have a working Baro. |
Yeah longer term the issue is the code doesn't do what we probably want. We'd perhaps like the code to do what the description says. At the moment, what we actually have is a "disable the baro" setting. That setting we actually have, the setting that disables the baro, should probably default to off, IMHO. Until we have a setting that doesn't disable the baro. That's assuming we actually want to implement the setting as described. In approximately 100,000 Discord messages, the setting never came up; no user has ever needed to change it that I've seen. (Until 7.1.1 when the default was changed and it did the wrong thing). It may be the setting isn't needed - as evidenced by the fact we haven't actually had it, and nobody has complained about not having it. |
With the code as it is now it will use Baro and GPS as available so I think the setting is redundant and should be removed. If you want to disable the Baro just do it from the sensors config. |
This option was working as intended till 7.0. In 7.1 it disables baro usage. Should either be renamed or better removed completety.
With code is it now, althold modes are not shown in configurator with baro sensor disabled in sensor config. The only way to show them is to set |
I was looking at #9966 and I'm not sure the description added is accurate.
I wonder if I'm missing something in the code?
Looking at the code:
inav/src/main/navigation/navigation_pos_estimator.c
Line 564 in b96c3d4
It appears to me the setting actually disables using baro altitude at all.
From my reading, baro is used only if:
if ((ctx->newFlags & EST_BARO_VALID) && (!positionEstimationConfig()->use_gps_no_baro) && (wBaro > 0.01f)) {
I then ran a test to confirm, increasing baro altitude (reduced pressure) while watching the altitude.
This is the result with inav_use_gps_no_baro = OFF, which was the default a few weeks ago:
no_baro_off.mp4
The altitude estimate correctly responds to the baro, with inav_use_gps_no_baro = OFF.
However, with inav_use_gps_no_baro = ON, changing the baro results in no change to the altitude estimate:
Caution - loud.
no_baro_on.mp4
This test result is consistent with my reading of the code.
Am I missing something in the code, or should that description be updated, and perhaps the default restored to what it was a few weeks ago?
The text was updated successfully, but these errors were encountered: