Skip to content
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

flight mode manager: fix terrain hold #22294

Merged
merged 2 commits into from
Nov 7, 2023
Merged

Conversation

AlexKlimaj
Copy link
Member

@AlexKlimaj AlexKlimaj commented Nov 1, 2023

Continuation of #21885 and should fix #22221

Flew under the deck which caused the GNSS fusion to stop then flew back out.
https://review.px4.io/plot_app?log=d6be638f-4ca1-4ed9-ae6b-8969ea724a9a

On a 650
https://review.px4.io/plot_app?log=de32ab72-e175-4ea4-8d6b-a76fae956b7e

@dakejahl
Copy link
Contributor

dakejahl commented Nov 2, 2023

This fixes terrain hold 🎉 Hovering very close to the ground, the drone maintains its altitude. Previously it would sink due to ground effect on the baro.
https://review.px4.io/plot_app?log=96c9a5e8-2b36-484b-8ccf-c9de20a5030b

@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/height-estimation-error/34674/2

bresch
bresch previously approved these changes Nov 6, 2023
Copy link
Member

@bresch bresch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Should we also set the default value of MPC_ALT_MODE to "hold"?
What's the behavior if there is no range-finder?

@bresch bresch mentioned this pull request Nov 6, 2023
@AlexKlimaj
Copy link
Member Author

Looks good. Should we also set the default value of MPC_ALT_MODE to "hold"? What's the behavior if there is no range-finder?

It depends on _dist_to_bottom being valid. Looks like it shouldn't use terrain hold without a distance sensor. Needs testing though.

@bresch
Copy link
Member

bresch commented Nov 7, 2023

It depends on _dist_to_bottom being valid. Looks like it shouldn't use terrain hold without a distance sensor. Needs testing though.

Looks good, yes, _dist_to_bottom is dist_bottom when dist_bottom_valid and NAN otherwise. dist_bottom_valid is only true when there is constant range finder fusion.

@dagar dagar merged commit 4dda99c into PX4:main Nov 7, 2023
84 of 86 checks passed
@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-maintainers-call-november-07-2023/35031/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[Bug] Terrain Hold: Local Z doesn't follow distance sensor
6 participants