mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 12:43:35 +08:00
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:
@@ -225,14 +225,10 @@ void LandingTargetEstimator::update()
|
||||
|
||||
void LandingTargetEstimator::_check_params(const bool force)
|
||||
{
|
||||
bool updated = _parameterSub.updated();
|
||||
if (_parameter_update_sub.updated() || force) {
|
||||
parameter_update_s pupdate;
|
||||
_parameter_update_sub.copy(&pupdate);
|
||||
|
||||
if (updated) {
|
||||
parameter_update_s paramUpdate;
|
||||
_parameterSub.copy(¶mUpdate);
|
||||
}
|
||||
|
||||
if (updated || force) {
|
||||
_update_params();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user