/** ****************************************************************************** * @addtogroup INS INS * @brief The INS Modules perform * * @{ * @addtogroup INS_Main * @brief Main function which does the hardware dependent stuff * @{ * * * @file ins.c * @author David "Buzz" Carlson (buzz@chebuzz.com) * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. * @brief INSGPS Test Program * @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 */ /* OpenPilot Includes */ #include "ins.h" #include "pios.h" #include #include "fifo_buffer.h" void reset_values(); /** * @addtogroup INS_Global_Data INS Global Data * @{ * Public data. Used by both EKF and the sender */ //! Contains the data from the mag sensor chip struct mag_sensor mag_data; //! Contains the data from the accelerometer struct accel_sensor accel_data; //! Contains the data from the gyro struct gyro_sensor gyro_data; //! Conains the current estimate of the attitude struct attitude_solution attitude_data; //! Contains data from the altitude sensor struct altitude_sensor altitude_data; //! Contains data from the GPS (via the SPI link) struct gps_sensor gps_data; //! Offset correction of barometric alt, to match gps data //static float baro_offset = 0; //static float mag_len = 0; typedef enum { INS_IDLE, INS_DATA_READY, INS_PROCESSING } states; volatile int32_t ekf_too_slow; volatile int32_t total_conversion_blocks; /** * @} */ /* INS functions */ void blink(int led, int times) { for(int i=0; i