1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-12 20:08:48 +01:00
LibrePilot/flight/modules/StateEstimation/inc/stateestimation.h

80 lines
2.7 KiB
C
Raw Normal View History

2013-05-19 22:40:50 +02:00
/**
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup StateSetimation Module
* @{
*
* @file stateestimation.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
* @brief Acquires sensor data and fuses it into attitude estimate for CC
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef STATEESTIMATION_H
#define STATEESTIMATION_H
#include <openpilot.h>
typedef enum {
2013-05-22 19:05:28 +02:00
SENSORUPDATES_gyro = 1 << 0,
SENSORUPDATES_accel = 1 << 1,
SENSORUPDATES_mag = 1 << 2,
SENSORUPDATES_attitude = 1 << 3,
SENSORUPDATES_pos = 1 << 4,
SENSORUPDATES_vel = 1 << 5,
SENSORUPDATES_airspeed = 1 << 6,
SENSORUPDATES_baro = 1 << 7,
SENSORUPDATES_lla = 1 << 8,
2013-05-19 22:40:50 +02:00
} sensorUpdates;
typedef struct {
2013-05-22 19:05:28 +02:00
float gyro[3];
float accel[3];
2013-05-19 22:40:50 +02:00
float mag[3];
2013-05-22 19:05:28 +02:00
float attitude[4];
2013-05-19 22:40:50 +02:00
float pos[3];
float vel[3];
2013-05-22 19:05:28 +02:00
float airspeed[2];
float baro[1];
2013-05-19 22:40:50 +02:00
sensorUpdates updated;
} stateEstimation;
typedef struct stateFilterStruct {
2013-05-22 19:05:28 +02:00
int32_t (*init)(struct stateFilterStruct *self);
int32_t (*filter)(struct stateFilterStruct *self, stateEstimation *state);
void *localdata;
2013-05-19 22:40:50 +02:00
} stateFilter;
2013-05-22 19:05:28 +02:00
int32_t filterMagInitialize(stateFilter *handle);
int32_t filterBaroInitialize(stateFilter *handle);
int32_t filterAltitudeInitialize(stateFilter *handle);
2013-05-22 19:05:28 +02:00
int32_t filterAirInitialize(stateFilter *handle);
int32_t filterStationaryInitialize(stateFilter *handle);
int32_t filterLLAInitialize(stateFilter *handle);
2013-05-22 19:05:28 +02:00
int32_t filterCFInitialize(stateFilter *handle);
int32_t filterCFMInitialize(stateFilter *handle);
int32_t filterEKF13iInitialize(stateFilter *handle);
int32_t filterEKF13Initialize(stateFilter *handle);
int32_t filterEKF16iInitialize(stateFilter *handle);
int32_t filterEKF16Initialize(stateFilter *handle);
2013-05-19 22:40:50 +02:00
#endif // STATEESTIMATION_H