[ins] EKF2 fix localization of global waypoints (#2704)

This commit is contained in:
Freek van Tienen
2021-05-04 16:38:26 +02:00
committed by GitHub
parent 50dd0c3494
commit 4a3ae9fbb7
2 changed files with 12 additions and 0 deletions
+4
View File
@@ -27,6 +27,7 @@
*/
#include "subsystems/ins/ins_ekf2.h"
#include "subsystems/navigation/waypoints.h"
#include "subsystems/abi.h"
#include "stabilization/stabilization_attitude.h"
#include "generated/airframe.h"
@@ -347,6 +348,9 @@ void ins_ekf2_update(void)
ltp_def_from_lla_i(&ekf2.ltp_def, &lla_ref);
stateSetLocalOrigin_i(&ekf2.ltp_def);
/* update local ENU coordinates of global waypoints */
waypoints_localize_all();
ekf2.ltp_stamp = origin_time;
}
}
@@ -26,6 +26,10 @@
#ifndef WAYPOINTS_H
#define WAYPOINTS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "std.h"
#include "math/pprz_geodetic_int.h"
#include "math/pprz_geodetic_float.h"
@@ -128,4 +132,8 @@ extern void waypoint_localize(uint8_t wp_id);
/** update local ENU coordinates of all global waypoints */
extern void waypoints_localize_all(void);
#ifdef __cplusplus
}
#endif
#endif /* WAYPOINTS_H */