parameter_update use uORB::Subscription consistently

This commit is contained in:
Daniel Agar
2019-09-29 10:49:03 -04:00
parent bbb96cbd0c
commit c8e59c4e39
47 changed files with 274 additions and 259 deletions
@@ -62,9 +62,13 @@ void FixedwingLandDetector::_update_topics()
void FixedwingLandDetector::_update_params()
{
parameter_update_s param_update;
// check for parameter updates
if (_parameter_update_sub.updated()) {
// clear update
parameter_update_s pupdate;
_parameter_update_sub.copy(&pupdate);
if (_param_update_sub.update(&param_update)) {
// update parameters from storage
_update_params();
}
}
@@ -73,7 +73,7 @@ private:
static constexpr hrt_abstime FLYING_TRIGGER_TIME_US = 0_us;
uORB::Subscription _airspeed_sub{ORB_ID(airspeed)};
uORB::Subscription _param_update_sub{ORB_ID(parameter_update)};
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)};
uORB::Subscription _vehicle_acceleration_sub{ORB_ID(vehicle_acceleration)};
uORB::Subscription _vehicle_local_position_sub{ORB_ID(vehicle_local_position)};
+7 -2
View File
@@ -151,10 +151,15 @@ void LandDetector::Run()
void LandDetector::_check_params(const bool force)
{
parameter_update_s param_update;
// check for parameter updates
if (_parameter_update_sub.updated() || force) {
// clear update
parameter_update_s pupdate;
_parameter_update_sub.copy(&pupdate);
if (_param_update_sub.update(&param_update) || force) {
// update parameters from storage
_update_params();
_update_total_flight_time();
}
}
+1 -1
View File
@@ -174,7 +174,7 @@ private:
perf_counter_t _cycle_perf{perf_alloc(PC_ELAPSED, "land_detector_cycle")};
uORB::Subscription _actuator_armed_sub{ORB_ID(actuator_armed)};
uORB::Subscription _param_update_sub{ORB_ID(parameter_update)};
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)};
DEFINE_PARAMETERS_CUSTOM_PARENT(
ModuleParams,