mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 02:43:33 +08:00
parameter_update use uORB::Subscription consistently
This commit is contained in:
@@ -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(¶m_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)};
|
||||
|
||||
|
||||
@@ -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(¶m_update) || force) {
|
||||
// update parameters from storage
|
||||
_update_params();
|
||||
|
||||
_update_total_flight_time();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user