From 1083af21e80e9bf7df4671ba6811b23ffa4d18a8 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Wed, 13 Mar 2019 10:50:13 -0400 Subject: [PATCH] mc_pos_control limit to 50 Hz --- src/modules/mc_pos_control/mc_pos_control_main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/mc_pos_control/mc_pos_control_main.cpp b/src/modules/mc_pos_control/mc_pos_control_main.cpp index 74417afc5b57..79b7852a664b 100644 --- a/src/modules/mc_pos_control/mc_pos_control_main.cpp +++ b/src/modules/mc_pos_control/mc_pos_control_main.cpp @@ -582,11 +582,13 @@ MulticopterPositionControl::run() _vehicle_land_detected_sub = orb_subscribe(ORB_ID(vehicle_land_detected)); _control_mode_sub = orb_subscribe(ORB_ID(vehicle_control_mode)); _params_sub = orb_subscribe(ORB_ID(parameter_update)); - _local_pos_sub = orb_subscribe(ORB_ID(vehicle_local_position)); _att_sub = orb_subscribe(ORB_ID(vehicle_attitude)); _home_pos_sub = orb_subscribe(ORB_ID(home_position)); _traj_wp_avoidance_sub = orb_subscribe(ORB_ID(vehicle_trajectory_waypoint)); + _local_pos_sub = orb_subscribe(ORB_ID(vehicle_local_position)); + orb_set_interval(_local_pos_sub, 20); // 50 Hz updates + // get initial values for all parameters and subscribtions parameters_update(true); poll_subscriptions();