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

AP_STATS: allow writing to param STAT_RESET #23638

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

magicrub
Copy link
Contributor

bugfix: param STAT_RESET should not be read-only. A fair chunk of code depends on it being able to change. Even the param description says (set to 0 to reset statistics)

@magicrub magicrub added the BUG label Apr 28, 2023
@magicrub
Copy link
Contributor Author

image

@amilcarlucas and do you remember the reason behind this? @peterbarker doesn't.

@khancyr
Copy link
Contributor

khancyr commented May 3, 2023

this discussion will probably help : #6402

@rmackay9
Copy link
Contributor

rmackay9 commented May 6, 2023

My guess is that MP's full parameter list will still allow you to set it to zero regardless of whether AP's param descriptions say it is read-only or not.

@amilcarlucas
Copy link
Contributor

The point was that you should not mees up all the stats just because you loaded an old parameter file.

The statas are still resetable, but only if you explicitly write a zero to it.

@rmackay9
Copy link
Contributor

rmackay9 commented May 8, 2023

@magicrub, let's close this one perhaps?

@magicrub
Copy link
Contributor Author

At the very least we should update the docs:
Seconds since January 1st 2016 (Unix epoch+1451606400) since statistics reset (set to 0 to reset statistics)
to something like
Seconds since January 1st 2016 (Unix epoch+1451606400) since statistics reset. This is marked Read-only to inhibit accidental rights by popular GCS's. However, custom GCS's can set to 0 to reset the statistics

On another note:
The epoch offset of 1451606400 is only used by AP_STAT, the value of 1420070400 is used in 4 different places, including MAVLink and GPS. Doesn't mean we should change it.. just saying. Changing it would lead to breaking behavior on users expecting that number to not change.

@magicrub
Copy link
Contributor Author

Dev call from Dec 25, 2023: @tridge says to re-word the description to not allow writes and new MAVLink msg to do the reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants