-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Parameter system enhancement #14363
Parameter system enhancement #14363
Conversation
Is there any actual benefit to keeping this as bson other than import simplicity? Wondering if we should do it directly in a human readable format and leave the possibility of loading from the sd card open. |
I'm wondering if the safest thing to do would be to load the defaults as soon as possible right next to the What do you think? |
src/lib/parameters/parameters.cpp
Outdated
param_wbuf_s *s = param_find_changed(param); | ||
|
||
if (s == nullptr) { | ||
// // don't store new value if default | ||
// if (val_is_default) { |
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.
Why is this commented?
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.
@dagar I was thinking about one case where this might lead to undesired behavior but thinking about it again I think it's ok. I will add this again.
I liked the this approach! and have some small notes/questions:
|
@RomanBapst @dagar Does this change put us in a position where parameters can be translated? |
Yes, I think we can do that. Let me change and do some tests. |
Yes, I think we can do that.
Ok, will check.
Possibly, I agree that the current solution is not the best. |
I can explain to you what we have right now. The generic PX4 defaults are still and only accessible via the Parameters.xml file. The question is in which format do you want to have them. Before build time they are available in a human readable format and after build time they are available in bson format (the format which the PX4 paramter system uses to load and save params.) |
9162c8b
to
c359073
Compare
- added param import-as-default command - support storing a default parameter value set at run-time Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
human readable parameter files Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
…efault Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Is this PR can also save flash memory? |
FYI We are in the process (see #15389) of adding support for GCS to query a vehicle for metadata and other information. The GCS requests metadata of a particular type and COMPONENT_INFORMATION message is returned with URI (HTTP or mavftp) of file containing that data in There has been some discussion that it would be useful to be able to provision parameters as a file via MAVFTP and for GCS request them - a compressed .json.bz file likely to be more far efficient to download via MAVFTP than via the current parameter format. Don't know if this would impact how you implement this. FWIW Very cool that the defaults can be supplied as a file. Allowing these to be on SD card or in firmware and have the system choose the SD card preferentially is a good model. Having the default be factory updatable via mavlink even cooler. |
I'd like to get this moving again. Can we establish a plain text parameter file format (or use QGCs) and skip the build time bson generation? My goal is that ultimately an airframe is nothing more than a set of parameters. Some of those options can live directly in the code base for convenience, but for the majority of users it should be sufficient to have a simple parameter file they can save/load from QGC. |
Why do we need both |
Needs to be rebased. |
Alternatively, we could get the core parameter system changes in, then incrementally start transitioning the existing AUTOCNF scripting. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Feb 3, 2021, Dev Call update: The plan going forward is to split this PR in two, one for the Param architecture, and the second for the parameter per board updates which can happen over time. |
Continued in #16796 |
This pull request brings the following enhancements to the PX4 parameter system:
Short summary
Detailed Summary
param load-as-default param_file
. This new command reads parameter values from a file and stores them internally as the default value for that parameter. This default value is not the same as the actual parameter value, the two things are stored separately. If that parameter has not been modified before (e.g. it does not exist in the list of params stored in FRAM) it will also set the value of the parameter accordingly.This command is used at each place where there used to be the AUTOCNF section.
This brings the advantage that the default board-, vehicle_type- and airframe config parameters are now accessible as files.
I created a spreadsheets which shows how the actual- and default value of a specific parameter changes for different scenarios.
https://docs.google.com/spreadsheets/d/1RVHwuwpJRBwl1YKYZ88FEJS0VzTK17DghgDgVqUuJwc/edit?usp=sharing
Open points for discussion