Skip to content

Commit

Permalink
[modules] EKF2 fixed initialization warning (#3262)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmldeponti committed Apr 9, 2024
1 parent afa9378 commit 6fb37f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sw/airborne/modules/ins/ins_ekf2.cpp
Expand Up @@ -301,7 +301,7 @@ static void ins_ekf2_publish_attitude(uint32_t stamp);
static Ekf ekf; ///< EKF class itself
static parameters *ekf_params; ///< The EKF parameters
struct ekf2_t ekf2; ///< Local EKF2 status structure
static struct extVisionSample sample_ev = {0}; ///< External vision sample
static struct extVisionSample sample_ev; ///< External vision sample
#if PERIODIC_TELEMETRY
#include "modules/datalink/telemetry.h"

Expand Down Expand Up @@ -576,6 +576,9 @@ void ins_ekf2_init(void)
/* Initialize the flow sensor limits */
ekf.set_optical_flow_limits(INS_EKF2_MAX_FLOW_RATE, INS_EKF2_SONAR_MIN_RANGE, INS_EKF2_SONAR_MAX_RANGE);

// Don't send external vision data by default
sample_ev.time_us = 0;

/* Initialize the origin from flight plan */
#if USE_INS_NAV_INIT
if(ekf.setEkfGlobalOrigin(NAV_LAT0*1e-7, NAV_LON0*1e-7, (NAV_ALT0)*1e-3)) // EKF2 works HMSL
Expand Down

0 comments on commit 6fb37f8

Please sign in to comment.