-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Reintroduce optional parameter versioning mechanism for airframe maintainers #22813
Conversation
We could add something to make it easy to skip the |
How about |
13db715
to
fe24f94
Compare
I
This pr is about the parameter versioning mechanism and not about airspeed calibration or revising the volatile parameter reset mechanism. |
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.
Thanks for coming back to this - I agree that we have to focus on bringing the reset mechanism in here, and should move the work around which params to not reset to another PR.
I just have some proposals for cleaner comments. Otherwise looks good to me (haven't tried it out myself though).
FYI There have been some questions in the last couple of days on discord about how parameters "change managed" across versions, following renames and deletions. Would appreciate an update to the param docs for that. |
fe24f94
to
d7437b4
Compare
@sfuhrer Thanks for your suggestions, it's important to be clear 🙏 I tried to adjust the wording from what we originally had to address the valid input. |
d7437b4
to
ca6cd87
Compare
Rebased on main to have CI run again. The previous errors looked like the ones we fixed recently, see #23200 |
69 bytes over flash on v5 |
0eb92de
to
e03414b
Compare
The case where the airframe maintainer wants to enforce a reset to airframe is not covered anymore with the `param set-default` mechanism. For products based on PX4 this is still required to ensure proper functionality after a major update.
e03414b
to
111be14
Compare
autostart scripts: Reintroduce SYS_PARAM_VER (PX4#22813)
The case where the airframe maintainer wants to enforce a reset to airframe is not covered anymore with the `param set-default` mechanism. For products based on PX4 this is still required to ensure proper functionality after a major update.
The case where the airframe maintainer wants to enforce a reset to airframe is not covered anymore with the `param set-default` mechanism. For products based on PX4 this is still required to ensure proper functionality after a major update.
The case where the airframe maintainer wants to enforce a reset to airframe is not covered anymore with the `param set-default` mechanism. For products based on PX4 this is still required to ensure proper functionality after a major update.
Solved Problem
When working on multiple projects I found that many reintroduced a mechanism to allow automatically resetting the parameter configuration during a product update. This functionality was initially introduced in #11760 and removed again in #17279 because we (including me) thought that the
param set-default
mechanism of #16796 would solve all the cases. But the case where the airframe maintainer wants to enforce a reset to airframe defaults is not covered anymore with theparam set-default
mechanism. For products based on PX4 this is still required to ensure proper functionality after a major update.Solution
I suggest to reintroduce what was removed in #17279 in a slightly adapted way.
The mechanism is still exactly the same. An airframe maintainer can optionally add e.g. an
set PARAM_DEFAULTS_VER 2
line in the airframe file such that vehicles coming from an older (or newer) version airframe as detected using theSYS_PARAM_VER
parameter get reset to the default configuration. As usual accumulating flight numbers, hours, RC, sensor and newly also airspeed calibration are preserved.Changelog Entry
Alternatives
I tried to work around the necessity to trigger a reboot for the mechanism but after some testing it's still the most useful way in my eyes. The parameter version is only available after loading the airframe but arch and board defaults need to be loaded before that and the reset has to be done before that even because otherwise all
param set
lines in these configurations would be reset again. So either we'd load the airframe twice per boot or just reboot the system if a reset is required.Test coverage
I tested this on a vehicle which already had a parameter version from the previous mechanism and it seamlessly reset to the latest defaults even if I manually changed the parameters manually before the update.
Context
I was in discussion with @dagar about a possibly better less shotgun way to address the specific use cases solved by this mechanism but at least to me it's not clear yet how to solve all cases especially during bringups and major updates where a known working configuration is usually crucial to move multiple vehicles forward.