34 #include "generated/airframe.h"
36 #ifndef IMU_MAX_SENSORS
37 #define IMU_MAX_SENSORS 3
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.
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.
struct Int32Vect3 neutral
Neutral values, compensation on unscaled->scaled.
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.
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.
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 ...
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.
void imu_SetBodyToImuPhi(float phi)
void imu_ResetBodyToImu(float reset)
struct imu_calib_t calibrated
Calibration bitmask.
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 abi_id
ABI sensor ID.
abstract IMU interface providing fixed point interface
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.