NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
imu.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include "common/maths.h"
#include "build_config.h"
#include <platform.h>
#include "debug.h"
#include "common/axis.h"
#include "common/filter.h"
#include "common/quaternion.h"
#include "config/config.h"
#include "drivers/system.h"
#include "drivers/sensor.h"
#include "drivers/accgyro.h"
#include "drivers/compass.h"
#include "imu.h"
#include "gyro.h"
#include "compass.h"
#include "acceleration.h"
#include "barometer.h"
#include "sonar.h"
#include "system_calls.h"
Include dependency graph for imu.c:

Macros

#define SPIN_RATE_LIMIT   20
 

Enumerations

enum  { IMU_FLAG_USE_ACC = (1 << 0), IMU_FLAG_USE_MAG = (1 << 1), IMU_FLAG_USE_YAW = (1 << 2), IMU_FLAG_DCM_CONVERGE_FASTER = (1 << 3) }
 

Functions

void imu_reset (struct imu *self)
 
void imu_init (struct imu *self, const struct config *config)
 
void imu_reset_velocity_estimate (struct imu *self)
 
bool imu_is_leveled (struct imu *self, uint8_t max_angle)
 
void imu_update (struct imu *self, float dt)
 
void imu_input_accelerometer (struct imu *self, int16_t x, int16_t y, int16_t z)
 
void imu_input_magnetometer (struct imu *self, int16_t x, int16_t y, int16_t z)
 
void imu_input_gyro (struct imu *self, int16_t x, int16_t y, int16_t z)
 
void imu_input_yaw_dd (struct imu *self, int16_t yaw)
 
void imu_get_rotation (struct imu *self, quat_t *q)
 
float imu_get_cos_tilt_angle (struct imu *self)
 
int16_t imu_calc_throttle_angle_correction (struct imu *self, uint8_t throttle_correction_value)
 
void imu_get_attitude_dd (struct imu *self, union attitude_euler_angles *att)
 
void imu_get_gyro (struct imu *self, int16_t gyr[3])
 
float imu_get_gyro_scale (struct imu *self)
 
void imu_get_raw_accel (struct imu *self, union imu_accel_reading *accel)
 
int16_t imu_get_roll_dd (struct imu *self)
 
int16_t imu_get_pitch_dd (struct imu *self)
 
int16_t imu_get_yaw_dd (struct imu *self)
 
float imu_get_velocity_integration_time (struct imu *self)
 
float imu_get_avg_vertical_accel_cmss (struct imu *self)
 
float imu_get_est_vertical_vel_cms (struct imu *self)
 
void imu_enable_fast_dcm_convergence (struct imu *self, bool on)