Add flights counter to stats#10020
Conversation
|
I think uint16_t would be plenty to be honest. That's enough for 1 flight a day for 179 years 🤣 |
|
I'm wondering if it needs better detection for incrementing the number of flights. Just relying on the arm/disarm action can provide false positives. |
stronnag
left a comment
There was a problem hiding this comment.
Please update the PG Template version as you've added a field;
PG_REGISTER_WITH_RESET_TEMPLATE(statsConfig_t, statsConfig, PG_STATS_CONFIG, 1);
i.e. from 1 to 2
|
Any updates on this? |
Seems OK to me other than the minor formatting comment I made. |
OptimusTi
left a comment
There was a problem hiding this comment.
I'd increase this number to avoid false flights due to distance accumulation during armed workbench tests, if that makes sense.
Co-authored-by: OptimusTi <[email protected]>
|
Any additional suggestions or requests on this? Style now is according to @breadoven request, min flight distance was changed to 30m |
|
Hey, how do we go forward with this? |
|
It sounds like all of the comments have been addressed. Has anyone other than the developer tested this? If not, can someone please do so? |
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
I'm proposing a new field to be added to stats, flight counter, i.e. number of flights. I used an assumption that a flight counts once the craft is armed and disarmed and a certain time passes between the two (same as other fields); but only once per each battery pack. I also used uint32 for the field, which I feel is a bit excessive; for uint16 max number of flights would be 32768, I'm leaning on your judgement on that matter.