-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Estimate remaining flight time #17828
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @MaEtUgR , I looked through your PR after the dev call this morning and although I haven't tested it I am certainly in favor of this PR going in. CI is passing and if it goes in we can start evaluating it on hardware. I see no harm it would produce in the meantime and I think it takes things in the right direction. Thanks for your work!
-Mark
Thank you so much for the review Mark. I would have merged but now I need to rebase 😃 |
3721735
to
2222d23
Compare
This allows more accurate reporting and is compliant with the MAVLink interface.
2222d23
to
47329a0
Compare
I finally updated this pr with a rebase and the changes handling unknown battery time explicitly (not as zero seconds) like I wrote in my previous comment. Any final look on it? @mcsauder maybe? I'll follow up with a pr that compares return time with flight time and returns when they get close to each other. |
Since this was approved before and a prerequisite for the functionality in #18646 I'm merging. |
Apologies I was too slow getting to this @MaEtUgR . Everything is in great shape. Nice work, I'm really glad its in! |
Describe problem solved by this pull request
It's useful to show the user an estimate how much longer he can still fly until the battery is empty.
This estimate will also be required to make an informed decision when to return to home automatically to be able to land safely before the battery is empty.
Describe your solution
Calculate the remaining flight time based on a very heavily filtered "average" current consumption and the configured battery capacity.
Test data / coverage
The algorithm was tested on an old version of PX4 this port to the new version wasn't specifically tested yet. I suggest we check logs that fly with this functionality to see if the flight time is accurate.
Additional context
This is based on the refactor #17827