mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 20:13:33 +08:00
parameter_update use uORB::Subscription consistently
This commit is contained in:
@@ -317,7 +317,7 @@ private:
|
||||
uORB::Subscription _gps_pos_sub{ORB_ID(vehicle_gps_position)}; /**< gps position subscription */
|
||||
uORB::Subscription _home_pos_sub{ORB_ID(home_position)}; /**< home position subscription */
|
||||
uORB::Subscription _land_detected_sub{ORB_ID(vehicle_land_detected)}; /**< vehicle land detected subscription */
|
||||
uORB::Subscription _param_update_sub{ORB_ID(parameter_update)}; /**< param update subscription */
|
||||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)}; /**< param update subscription */
|
||||
uORB::Subscription _pos_ctrl_landing_status_sub{ORB_ID(position_controller_landing_status)}; /**< position controller landing status subscription */
|
||||
uORB::Subscription _traffic_sub{ORB_ID(transponder_report)}; /**< traffic subscription */
|
||||
uORB::Subscription _vehicle_command_sub{ORB_ID(vehicle_command)}; /**< vehicle commands (onboard and offboard) */
|
||||
|
||||
@@ -119,9 +119,6 @@ Navigator::~Navigator()
|
||||
void
|
||||
Navigator::params_update()
|
||||
{
|
||||
parameter_update_s param_update;
|
||||
_param_update_sub.update(¶m_update);
|
||||
|
||||
updateParams();
|
||||
|
||||
if (_handle_back_trans_dec_mss != PARAM_INVALID) {
|
||||
@@ -202,8 +199,13 @@ Navigator::run()
|
||||
}
|
||||
}
|
||||
|
||||
/* parameters updated */
|
||||
if (_param_update_sub.updated()) {
|
||||
// check for parameter updates
|
||||
if (_parameter_update_sub.updated()) {
|
||||
// clear update
|
||||
parameter_update_s pupdate;
|
||||
_parameter_update_sub.copy(&pupdate);
|
||||
|
||||
// update parameters from storage
|
||||
params_update();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user