rate limit most parameter_update subscriptions

- parameter updates can be quite expensive because they trigger nearly all modules to reload all of their parameters immediately
 - limit modules from updating faster than once per second
This commit is contained in:
Daniel Agar
2021-01-10 21:09:15 -05:00
committed by GitHub
parent 70e503cb91
commit 967d35a6b6
73 changed files with 212 additions and 122 deletions
@@ -241,7 +241,7 @@ void BlockLocalPositionEstimator::Run()
_lastArmedState = armedState;
// see which updates are available
bool paramsUpdated = _sub_param_update.update();
const bool paramsUpdated = _parameter_update_sub.updated();
_baroUpdated = false;
if ((_param_lpe_fusion.get() & FUSE_BARO) && _sub_airdata.update()) {
@@ -266,6 +266,10 @@ void BlockLocalPositionEstimator::Run()
// update parameters
if (paramsUpdated) {
// clear update
parameter_update_s pupdate;
_parameter_update_sub.copy(&pupdate);
SuperBlock::updateParams();
ModuleParams::updateParams();
updateSSParams();