parameter_update use uORB::Subscription consistently

This commit is contained in:
Daniel Agar
2019-07-28 11:55:52 -04:00
parent bbb96cbd0c
commit c8e59c4e39
47 changed files with 274 additions and 259 deletions
+5 -7
View File
@@ -87,7 +87,6 @@
#include <uORB/topics/manual_control_setpoint.h>
#include <uORB/topics/mavlink_log.h>
#include <uORB/topics/mission.h>
#include <uORB/topics/parameter_update.h>
#include <uORB/topics/power_button_state.h>
#include <uORB/topics/safety.h>
#include <uORB/topics/subsystem_info.h>
@@ -1297,7 +1296,6 @@ Commander::run()
uORB::Subscription cpuload_sub{ORB_ID(cpuload)};
uORB::Subscription geofence_result_sub{ORB_ID(geofence_result)};
uORB::Subscription land_detector_sub{ORB_ID(vehicle_land_detected)};
uORB::Subscription param_changed_sub{ORB_ID(parameter_update)};
uORB::Subscription safety_sub{ORB_ID(safety)};
uORB::Subscription sp_man_sub{ORB_ID(manual_control_setpoint)};
uORB::Subscription subsys_sub{ORB_ID(subsystem_info)};
@@ -1418,14 +1416,14 @@ Commander::run()
transition_result_t arming_ret = TRANSITION_NOT_CHANGED;
/* update parameters */
bool params_updated = param_changed_sub.updated();
bool params_updated = _parameter_update_sub.updated();
if (params_updated || param_init_forced) {
// clear update
parameter_update_s update;
_parameter_update_sub.copy(&update);
/* parameters changed */
parameter_update_s param_changed;
param_changed_sub.copy(&param_changed);
// update parameters from storage
updateParams();
/* update parameters */
+2
View File
@@ -60,6 +60,7 @@
#include <uORB/topics/iridiumsbd_status.h>
#include <uORB/topics/mission_result.h>
#include <uORB/topics/offboard_control_mode.h>
#include <uORB/topics/parameter_update.h>
#include <uORB/topics/telemetry_status.h>
#include <uORB/topics/vehicle_acceleration.h>
#include <uORB/topics/vehicle_command.h>
@@ -274,6 +275,7 @@ private:
bool _print_avoidance_msg_once{false};
// Subscriptions
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)};
uORB::Subscription _vehicle_acceleration_sub{ORB_ID(vehicle_acceleration)};
uORB::SubscriptionData<airspeed_s> _airspeed_sub{ORB_ID(airspeed)};