mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 04:20:34 +08:00
Navigator: Reorder data members to fix valgrind warnings
During construction of an Navigator object, a pointer to the incomplete object was passed to the RTL constructor which then called a method on the incomplete Navigator object accessing uninitialized data.
This commit is contained in:
@@ -217,6 +217,11 @@ private:
|
||||
|
||||
bool _inside_fence; /**< vehicle is inside fence */
|
||||
|
||||
bool _can_loiter_at_sp; /**< flags if current position SP can be used to loiter */
|
||||
bool _pos_sp_triplet_updated; /**< flags if position SP triplet needs to be published */
|
||||
bool _pos_sp_triplet_published_invalid_once; /**< flags if position SP triplet has been published once to UORB */
|
||||
bool _mission_result_updated; /**< flags if mission result has seen an update */
|
||||
|
||||
NavigatorMode *_navigation_mode; /**< abstract pointer to current navigation mode class */
|
||||
Mission _mission; /**< class that handles the missions */
|
||||
Loiter _loiter; /**< class that handles loiter */
|
||||
@@ -231,11 +236,6 @@ private:
|
||||
|
||||
NavigatorMode *_navigation_mode_array[NAVIGATOR_MODE_ARRAY_SIZE]; /**< array of navigation modes */
|
||||
|
||||
bool _can_loiter_at_sp; /**< flags if current position SP can be used to loiter */
|
||||
bool _pos_sp_triplet_updated; /**< flags if position SP triplet needs to be published */
|
||||
bool _pos_sp_triplet_published_invalid_once; /**< flags if position SP triplet has been published once to UORB */
|
||||
bool _mission_result_updated; /**< flags if mission result has seen an update */
|
||||
|
||||
control::BlockParamFloat _param_loiter_radius; /**< loiter radius for fixedwing */
|
||||
control::BlockParamFloat _param_acceptance_radius; /**< acceptance for takeoff */
|
||||
control::BlockParamInt _param_datalinkloss_obc; /**< if true: obc mode on data link loss enabled */
|
||||
|
||||
@@ -134,6 +134,10 @@ Navigator::Navigator() :
|
||||
_geofence{},
|
||||
_geofence_violation_warning_sent(false),
|
||||
_inside_fence(true),
|
||||
_can_loiter_at_sp(false),
|
||||
_pos_sp_triplet_updated(false),
|
||||
_pos_sp_triplet_published_invalid_once(false),
|
||||
_mission_result_updated(false),
|
||||
_navigation_mode(nullptr),
|
||||
_mission(this, "MIS"),
|
||||
_loiter(this, "LOI"),
|
||||
@@ -143,10 +147,6 @@ Navigator::Navigator() :
|
||||
_dataLinkLoss(this, "DLL"),
|
||||
_engineFailure(this, "EF"),
|
||||
_gpsFailure(this, "GPSF"),
|
||||
_can_loiter_at_sp(false),
|
||||
_pos_sp_triplet_updated(false),
|
||||
_pos_sp_triplet_published_invalid_once(false),
|
||||
_mission_result_updated(false),
|
||||
_param_loiter_radius(this, "LOITER_RAD"),
|
||||
_param_acceptance_radius(this, "ACC_RAD"),
|
||||
_param_datalinkloss_obc(this, "DLL_OBC"),
|
||||
@@ -694,7 +694,7 @@ void
|
||||
Navigator::publish_mission_result()
|
||||
{
|
||||
_mission_result.instance_count = _mission_instance_count;
|
||||
|
||||
|
||||
/* lazily publish the mission result only once available */
|
||||
if (_mission_result_pub != nullptr) {
|
||||
/* publish mission result */
|
||||
|
||||
Reference in New Issue
Block a user