mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:08:52 +08:00
land_detector: move _parameterSub to the right place
This commit is contained in:
@@ -105,6 +105,7 @@ void LandDetector::_cycle()
|
||||
|
||||
// Initialize uORB topics.
|
||||
_armingSub = orb_subscribe(ORB_ID(actuator_armed));
|
||||
_parameterSub = orb_subscribe(ORB_ID(parameter_update));
|
||||
_initialize_topics();
|
||||
|
||||
_check_params(true);
|
||||
|
||||
@@ -150,9 +150,6 @@ protected:
|
||||
orb_advert_t _landDetectedPub{nullptr};
|
||||
vehicle_land_detected_s _landDetected{};
|
||||
|
||||
int _parameterSub{-1};
|
||||
int _armingSub{-1};
|
||||
|
||||
LandDetectionState _state{LandDetectionState::LANDED};
|
||||
|
||||
systemlib::Hysteresis _freefall_hysteresis{false};
|
||||
@@ -181,6 +178,9 @@ private:
|
||||
perf_counter_t _cycle_perf;
|
||||
|
||||
bool _previous_arming_state{false}; ///< stores the previous _arming.armed state
|
||||
|
||||
int _parameterSub{-1};
|
||||
int _armingSub{-1};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -97,7 +97,6 @@ void MulticopterLandDetector::_initialize_topics()
|
||||
_vehicleLocalPositionSetpointSub = orb_subscribe(ORB_ID(vehicle_local_position_setpoint));
|
||||
_attitudeSub = orb_subscribe(ORB_ID(vehicle_attitude));
|
||||
_actuatorsSub = orb_subscribe(ORB_ID(actuator_controls_0));
|
||||
_parameterSub = orb_subscribe(ORB_ID(parameter_update));
|
||||
_sensor_bias_sub = orb_subscribe(ORB_ID(sensor_bias));
|
||||
_vehicle_control_mode_sub = orb_subscribe(ORB_ID(vehicle_control_mode));
|
||||
_battery_sub = orb_subscribe(ORB_ID(battery_status));
|
||||
|
||||
Reference in New Issue
Block a user