-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add stats_total_packs
#10808
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
Add stats_total_packs
#10808
Conversation
|
Hey, the idea of recording total packs is an interesting one, however there is an issue in that it will also increase the counter incorrectly if you're testing with only a USB cable plugged in and no battery. You can check to see if a battery is connected by checking the detected cell count. I think it might be better if you check the It might also make sense to check total flight time on the current pack is greater than a sensible value, e.g. 1 minute. |
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.
Please add the elements in the enum as last before the counter and increase the PG version.
Instructions on how to do that are mentioned in the source code.
68549ae to
eb7d85c
Compare
|
@haslinghuis should we put a label "Needs coordination with betaflight-configurator"? |
I was planning to flash 4.3 with stats_total_packs next week and build Configurator with my edits and see how it's going in the next days, so I can test this weekend. I've already commit on my branch. I want to test before PR |
|
@limonspb this is a new feature so coordination with configurator is not needed, also with our msp rules we need to wait for the next release for add it to MSP. |
This change actually changes |
|
@limonspb you are right I overloocked osd elements parts sorry, tag should be added yes. |
|
Tested on STMF7X2 ; forgot to set In OSD and post flight but according to CLI it looks like it works. I will do more testing next week, since my testing sessions were interrupt by a running dog that didn't want to leave me alone. :'( One thing is wrong for sure though : OSD TOTAL PACKS in flight, just like the OSD TOTAL FLIGHTS, will print the #count of the previous flight, not the current, since it will be incremented only at disarm. I'll be looking into it. Should I make another PR to correct OSD TOTAL FLIGHTS behavior (show |
|
Awaiting more tests and insight - a PR has to be atomic (not depending on other PR's). First have to see how new insights and testing influences |
eb7d85c to
6e7808b
Compare
|
Made the corrections needed. Just edited the osdelement.c so OSD show the pack we're on. Tested on workbench with 20 secs arming sequences on STM32F7X2. It's working fine :
The current feature, as intended, does not seem to influence how |
|
Rebase needed here @bree29 |
|
No way to figure it out. Same story on the configurator. Tag them for 4.4 ; you'll have plenty of work right now ; I'll try to get a Git wizard somehow. |
|
Usually the best solution is to first squash all your commits into one, then do the rebase against master. I find GitHub desktop very useful. |
3ff358d to
7b5516f
Compare
|
Well, there is my issue. I could revert back to my initial commit. I solved all conflicts that have been raised before (mainly beautify codes) by keeping upstream and discarding manually my change. I then get my cleanish commit. But everytime I try rebasing against master with |
|
Shouldn't you rebase against upstream master? If your 'cleanish commit' is OK, there are not a ton of changes. You could just get master and manually apply them with copy and paste, if nothing else worked. |
|
@bree29 my suggestions, to sort of start over from clean:
:) |
7b5516f to
cf1f3da
Compare
|
I do think I made it (this time). I see only one commit here. Thanks for my copypasta monkey mind, it helped a lot, really. |
cf1f3da to
4cce8f7
Compare
|
AUTOMERGE: (FAIL)
|
|
@bree29 please rebase |
4cce8f7 to
c3e834c
Compare
c3e834c to
7983ea3
Compare
|
Do you want to test this code? Here you have an automated build: |
|
To be honest, I think we should not add a new element for 'packs'. The value of the parameter is only for the pleasure of the pilot, to see how much time this particular quad has been flown since the stats we're erased. It is not a high value thing. Total time in the air is likely more useful than 'packs'. Hence my thinking is that perhaps we could revise the meaning of 'flights', or how we record total flight time, but that we should not continue with this PR, and it should be closed. |
stats_total_packs
What is there today :
stats_total_flights is supposed to count our flights. And it does ! But what do we count as "flights" ? (Turtle mode, breaks, fast checkin, ...). Reviewing DVR (and the ones we forgot to press play), we have to go to the end to see which flight we are talking about. Sometimes we didn't really miss a DVR : flight count for two.
What's that feature provides :
That new feature works just as
stats_total_flights, except :I both add this feature and the ability to add it in OSD both stat and during the flight. It is usefull for "enthousiastic racers" (see #10215).
Issues ?
However, I am concerned about adding yet another persistant_stat element. There is today 26 elements on 32 availables on the 32bit chip. See #10503 arguments.
It would be possible to set stats_total_flights to either work like right now, or counting in packs. It would also be trickier, "and why change something that does work / field test", and was suggested in #10803 to make it a different parameter.
Fixes #10803
The commit has passed the
make pre-pushand I attach unified_zip targets for user to test the feature.2021-06-22_17-52 : updated unified_zip from last commit.
betaflight_4.3.0_STM32G47X_68549ae7f.zip
betaflight_4.3.0_STM32F745_68549ae7f.zip
betaflight_4.3.0_STM32F7X2_68549ae7f.zip
betaflight_4.3.0_STM32F411_68549ae7f.zip
betaflight_4.3.0_STM32F405_68549ae7f.zip