-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Autostart: Allow overriding airframe defaults #8006
Conversation
Good idea! Could we handle it from here though without the extra variable? https://github.com/PX4/Firmware/blob/master/ROMFS/px4fmu_common/init.d/rcS#L147 If the param ver changes then set AUTOCNF, but skip the full param reset. That keeps each airframe config simpler. |
How about this? Use the AUTOCNF mechanism if SYS_PARAM_VER is different and only set it to DEFAULTS_VER if we make it to the end of autostart. |
Autocnf wipes params first and therefore we can't use the same mechanism. |
SYS_AUTOCONFIG resets the params, then sets AUTOCNF. This would be setting AUTOCNF independently. |
That's alright then. |
e920206
to
ff3e923
Compare
Updated this branch to AUTOCNF version. |
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.
The param comment needs to be updated as well: https://github.com/PX4/Firmware/blob/master/src/modules/systemlib/system_params.c#L141
I find this a bit problematic. It can lead to unexpected effects for both devels and users. For example if you use a generic quad config, this will reset your configured PWM range (https://github.com/PX4/Firmware/blob/master/ROMFS/tap_common/init.d/rc.mc_defaults#L8). Even worse for all VTOLs, it changes the tuning gains: https://github.com/PX4/Firmware/blob/master/ROMFS/tap_common/init.d/rc.vtol_defaults#L7
fi | ||
|
||
param set SYS_PARAM_VER ${DEFAULTS_VER} | ||
unset DEFAULTS_VER | ||
param save |
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.
param save
is not needed
VTOL defaults shouldn't be setting tuning parameters. We could try to be more conservative with the AUTOCNF section of the the default (MC, FW, VTOL, GND). I'm more concerned with users missing defaults. In practice many select an airframe once, upgrade in place, and miss out on new defaults. To be honest I don't know what the best solution is. |
I agree we should have something like this in place, but it should be more fine-grained. Some options that I see:
|
Alright, let's keep thinking this through. I like the idea of doing more on the QGC side, but obviously quite a lot is missing to do that usefully. What if we added another mechanism to track these alternate defaults? Params actually set by a user should be preserved if at all possible. Params that were never touched by a user should continue to track the default. If the default (or alternate default) value of a parameter changes and the user has set that parameter they should be alerted. |
Sounds good to me. I'm just wondering how easy it is to distinguish. For example if we treat all params changed via mavlink as user-set, it means if you backup the params and then load them via QGC, all will be marked as user-set. Similar for the 'set to default' functionality (which uses the same mavlink message) and |
We still need a solution for this. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing as stale. |
This is necessary to enable setting new airframe defaults after significant configuration changes.
@dagar needs to be considered in your param PR.