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
+3 -1
View File
@@ -63,11 +63,13 @@
#include "output_mavlink.h"
#include <uORB/Subscription.hpp>
#include <uORB/SubscriptionInterval.hpp>
#include <uORB/topics/parameter_update.h>
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/module.h>
using namespace time_literals;
using namespace vmount;
/* thread state */
@@ -208,7 +210,7 @@ static int vmount_thread_main(int argc, char *argv[])
return -1;
}
uORB::Subscription parameter_update_sub{ORB_ID(parameter_update)};
uORB::SubscriptionInterval parameter_update_sub{ORB_ID(parameter_update), 1_s};
thread_running = true;
ControlData *control_data = nullptr;
g_thread_data = &thread_data;