Merge pull request #3276 from erikd/driver_framework

Two uninitialized data fixes
This commit is contained in:
Lorenz Meier
2015-11-26 09:22:12 +01:00
4 changed files with 14 additions and 10 deletions
+5 -5
View File
@@ -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 */
+5 -5
View File
@@ -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 */
+2
View File
@@ -164,6 +164,8 @@ int uORB::Manager::orb_copy(const struct orb_metadata *meta, int handle, void *b
int uORB::Manager::orb_check(int handle, bool *updated)
{
/* Set to false here so that if `px4_ioctl` fails to false. */
*updated = false;
return px4_ioctl(handle, ORBIOCUPDATED, (unsigned long)(uintptr_t)updated);
}
@@ -202,6 +202,8 @@ BAROSIM::BAROSIM(const char *path) :
_TEMP(0),
_OFF(0),
_SENS(0),
_P(0.0),
_T(0.0),
_msl_pressure(101325),
_baro_topic(nullptr),
_orb_class_instance(-1),