35 #include "generated/airframe.h"
37 #ifndef IMU_MAX_SENSORS
38 #define IMU_MAX_SENSORS 4
static const float scale[]
uint32_t last_stamp
Last measurement timestamp for integration.
struct Int32Rates scaled
Last scaled values in body frame.
struct Int32RMat body_to_sensor
Rotation from body to sensor frame (body to imu combined with imu to sensor)
struct imu_calib_t calibrated
Calibration bitmask.
struct imu_accel_t * imu_get_accel(uint8_t sender_id, bool create)
Find or create the accel in the imu structure.
struct FloatVect3 current_scale
Current scaling multiplying.
struct imu_accel_t accels[IMU_MAX_SENSORS]
The accelerometer sensors.
uint8_t abi_id
ABI sensor ID.
bool scale
Scale calibrated.
float temperature
Temperature in degrees celcius.
Butterworth2LowPass filter[3]
Lowpass filter optional.
float filter_freq
Lowpass filter frequency (Hz)
struct imu_gyro_t * imu_get_gyro(uint8_t sender_id, bool create)
Find or create the gyro in the imu structure.
uint32_t last_stamp
Last measurement timestamp for integration.
float filter_sample_freq
Lowpass filter sample frequency (Hz)
struct Int32Vect3 neutral
Neutral values, compensation on unscaled->scaled.
uint8_t mag_abi_send_id
Filter out and send only a specific ABI id in telemetry for the magnetometer.
void imu_set_defaults_mag(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Vect3 *neutral, const struct Int32Vect3 *scale)
Set the defaults for a mag sensor WARNING: Should be called before sensor is publishing messages to e...
struct OrientationReps body_to_imu
Rotation from body to imu (all sensors) frame.
bool filter
Enable the lowpass filter.
struct Int32Vect3 unscaled
Last unscaled values in sensor frame.
void imu_SetBodyToImuTheta(float theta)
float temperature
Temperature in degrees celcius.
struct Int32Rates neutral
Neutral values, compensation on unscaled->scaled.
bool current
Current calibrated.
struct Int32RMat body_to_sensor
Rotation from body to sensor frame (body to imu combined with imu to sensor)
bool initialized
Check if the IMU is initialized.
Butterworth2LowPass filter[3]
Lowpass filter optional.
void imu_set_defaults_accel(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Vect3 *neutral, const struct Int32Vect3 *scale)
Set the defaults for a accel sensor WARNING: Should be called before sensor is publishing messages to...
struct imu_calib_t calibrated
Calibration bitmask.
struct Int32Vect3 scale[2]
Scaling, first is numerator and second denominator.
struct Int32Rates scale[2]
Scaling, first is numerator and second denominator.
struct Imu imu
global IMU state
void imu_set_defaults_gyro(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Rates *neutral, const struct Int32Rates *scale)
Set the defaults for a gyro sensor WARNING: Should be called before sensor is publishing messages to ...
float filter_sample_freq
Lowpass filter sample frequency (Hz)
struct Int32Vect3 scaled
Last scaled values in body frame.
struct imu_gyro_t gyros[IMU_MAX_SENSORS]
The gyro sensors.
void imu_init(void)
External functions.
struct Int32RMat body_to_sensor
Rotation from body to sensor frame (body to imu combined with imu to sensor)
void imu_SetBodyToImuPsi(float psi)
struct Int32Rates unscaled
Last unscaled values in sensor frame.
uint8_t abi_id
ABI sensor ID.
void imu_SetBodyToImuCurrent(float set)
struct imu_mag_t mags[IMU_MAX_SENSORS]
The magnetometer sensors.
struct Int32Vect3 scale[2]
Scaling, first is numerator and second denominator.
bool neutral
Neutral values calibrated.
bool b2i_set_current
flag for adjusting body_to_imu via settings.
struct Int32Vect3 neutral
Neutral values, compensation on unscaled->scaled.
struct Int32Vect3 unscaled
Last unscaled values in sensor frame.
float filter_freq
Filter frequency.
void imu_SetBodyToImuPhi(float phi)
void imu_ResetBodyToImu(float reset)
struct imu_calib_t calibrated
Calibration bitmask.
uint8_t accel_abi_send_id
Filter out and send only a specific ABI id in telemetry for the accelerometer.
struct Int32Vect3 scaled
Last scaled values in body frame.
bool rotation
Rotation calibrated.
struct imu_mag_t * imu_get_mag(uint8_t sender_id, bool create)
Find or create the mag in the imu structure.
uint8_t gyro_abi_send_id
Filter out and send only a specific ABI id in telemetry for the gyro.
uint8_t abi_id
ABI sensor ID.
abstract IMU interface providing fixed point interface
Simple first order low pass filter with bilinear transform.
Second order low pass filter structure.
Paparazzi floating point algebra.
Paparazzi fixed point algebra.
Generic orientation representation and conversions.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.