mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-09 22:49:53 +08:00
[ins] remove ins.status
This commit is contained in:
@@ -32,11 +32,6 @@
|
||||
#include "math/pprz_algebra_float.h"
|
||||
#include "state.h"
|
||||
|
||||
enum InsStatus {
|
||||
INS_UNINIT = 0,
|
||||
INS_RUNNING = 1
|
||||
};
|
||||
|
||||
/* underlying includes (needed for parameters) */
|
||||
#ifdef INS_TYPE_H
|
||||
#include INS_TYPE_H
|
||||
@@ -44,7 +39,6 @@ enum InsStatus {
|
||||
|
||||
/** Inertial Navigation System state */
|
||||
struct Ins {
|
||||
enum InsStatus status; ///< status of the INS
|
||||
};
|
||||
|
||||
/** global INS state */
|
||||
|
||||
@@ -95,8 +95,6 @@ void ins_init(void)
|
||||
|
||||
// why do we have this here?
|
||||
alt_kalman(0.0f, 0.1);
|
||||
|
||||
ins.status = INS_RUNNING;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,13 +69,6 @@ void ins_init()
|
||||
INT32_VECT3_ZERO(ins_impl.ltp_accel);
|
||||
}
|
||||
|
||||
void ins_periodic(void)
|
||||
{
|
||||
if (ins_impl.ltp_initialized) {
|
||||
ins.status = INS_RUNNING;
|
||||
}
|
||||
}
|
||||
|
||||
void ins_reset_local_origin(void)
|
||||
{
|
||||
#if USE_GPS
|
||||
|
||||
@@ -282,7 +282,6 @@ void ins_init()
|
||||
ins_impl.gains.rh = INS_INV_RH;
|
||||
ins_impl.gains.sh = INS_INV_SH;
|
||||
|
||||
ins.status = INS_UNINIT;
|
||||
ins_impl.is_aligned = FALSE;
|
||||
ins_impl.reset = FALSE;
|
||||
|
||||
@@ -357,7 +356,6 @@ void ins_float_invariant_align(struct Int32Rates *lp_gyro,
|
||||
|
||||
// ins and ahrs are now running
|
||||
ins_impl.is_aligned = TRUE;
|
||||
ins.status = INS_RUNNING;
|
||||
}
|
||||
|
||||
void ins_float_invariant_propagate(struct Int32Rates* gyro, struct Int32Vect3* accel, float dt)
|
||||
@@ -368,7 +366,6 @@ void ins_float_invariant_propagate(struct Int32Rates* gyro, struct Int32Vect3* a
|
||||
// a complete init cycle is required
|
||||
if (ins_impl.reset) {
|
||||
ins_impl.reset = FALSE;
|
||||
ins.status = INS_UNINIT;
|
||||
ins_impl.is_aligned = FALSE;
|
||||
init_invariant_state();
|
||||
}
|
||||
@@ -488,7 +485,7 @@ void ins_float_invariant_propagate(struct Int32Rates* gyro, struct Int32Vect3* a
|
||||
void ins_update_gps(void)
|
||||
{
|
||||
|
||||
if (gps.fix == GPS_FIX_3D && ins.status == INS_RUNNING) {
|
||||
if (gps.fix == GPS_FIX_3D && ins_impl.is_aligned) {
|
||||
ins_gps_fix_once = TRUE;
|
||||
|
||||
#if INS_UPDATE_FW_ESTIMATOR
|
||||
@@ -672,7 +669,7 @@ static inline void error_output(struct InsFloatInv *_ins)
|
||||
|
||||
// pos and speed error only if GPS data are valid
|
||||
// or while waiting first GPS data to prevent diverging
|
||||
if ((gps.fix == GPS_FIX_3D && ins.status == INS_RUNNING
|
||||
if ((gps.fix == GPS_FIX_3D && ins_impl.is_aligned
|
||||
#if INS_UPDATE_FW_ESTIMATOR
|
||||
&& state.utm_initialized_f
|
||||
#else
|
||||
|
||||
@@ -119,14 +119,6 @@ void ins_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void ins_periodic(void)
|
||||
{
|
||||
if (ins_impl.ltp_initialized) {
|
||||
ins.status = INS_RUNNING;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ins_reset_local_origin(void)
|
||||
{
|
||||
ltp_def_from_ecef_i(&ins_impl.ltp_def, &gps.ecef_pos);
|
||||
|
||||
@@ -40,8 +40,6 @@ void ins_init(void)
|
||||
struct UtmCoor_f utm0 = { nav_utm_north0, nav_utm_east0, 0., nav_utm_zone0 };
|
||||
stateSetLocalUtmOrigin_f(&utm0);
|
||||
stateSetPositionUtm_f(&utm0);
|
||||
|
||||
ins.status = INS_RUNNING;
|
||||
}
|
||||
|
||||
void ins_reset_local_origin(void)
|
||||
|
||||
@@ -194,13 +194,6 @@ void ins_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void ins_periodic(void)
|
||||
{
|
||||
if (ins_impl.ltp_initialized) {
|
||||
ins.status = INS_RUNNING;
|
||||
}
|
||||
}
|
||||
|
||||
void ins_reset_local_origin(void)
|
||||
{
|
||||
#if USE_GPS
|
||||
|
||||
Reference in New Issue
Block a user