mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 06:53: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user