37 #include "generated/airframe.h"
42 #ifndef ARDUIMU_I2C_DEV
43 #define ARDUIMU_I2C_DEV i2c0
49 #define ArduIMU_SLAVE_ADDR 0x22
51 #ifdef ARDUIMU_SYNC_SEND
53 #include "pprzlink/messages.h"
74 #define HIGH_ACCEL_LOW_SPEED 15.0
75 #define HIGH_ACCEL_LOW_SPEED_RESUME 4.0
76 #define HIGH_ACCEL_HIGH_THRUST (0.8*MAX_PPRZ)
77 #define HIGH_ACCEL_HIGH_THRUST_RESUME (0.1*MAX_PPRZ)
98 #define FillBufWith32bit(_buf, _index, _value) { \
99 _buf[_index] = (uint8_t) (_value); \
100 _buf[_index+1] = (uint8_t) ((_value) >> 8); \
101 _buf[_index+2] = (uint8_t) ((_value) >> 16); \
102 _buf[_index+3] = (uint8_t) ((_value) >> 24); \
110 #if USE_HIGH_ACCEL_FLAG
115 pprz_t cmd = command_get(COMMAND_THROTTLE);
197 #ifdef ARDUIMU_SYNC_SEND
#define INS_PITCH_NEUTRAL_DEFAULT
#define INS_ROLL_NEUTRAL_DEFAULT
struct FloatRates arduimu_rates
void ArduIMU_periodicGPS(void)
struct FloatVect3 arduimu_accel
struct FloatEulers arduimu_eulers
ArduIMU simulation.
void ArduIMU_periodic(void)
bool arduimu_calibrate_neutrals
Hardware independent code for commands handling.
Common code for AP and FBW telemetry.
struct GpsState gps
global GPS state
Device independent GPS code (interface)
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
uint16_t gspeed
norm of 2d ground speed in cm/s
uint16_t speed_3d
norm of 3d speed in cm/s
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
enum I2CTransactionStatus status
Transaction status.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
bool i2c_receive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint16_t len)
Submit a read only transaction.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransDone
transaction set to done by user level
I2C transaction structure.
#define FLOAT_EULERS_ZERO(_e)
#define FLOAT_VECT3_ZERO(_v)
#define FLOAT_RATES_ZERO(_r)
#define RATE_FLOAT_OF_BFP(_ai)
#define ANGLE_FLOAT_OF_BFP(_ai)
#define ACCEL_FLOAT_OF_BFP(_ai)
static void stateSetAccelNed_f(uint16_t id, struct NedCoor_f *ned_accel)
Set acceleration in NED coordinates (float).
static void stateSetNedToBodyEulers_f(uint16_t id, struct FloatEulers *ned_to_body_eulers)
Set vehicle body attitude from euler angles (float).
static void stateSetBodyRates_f(uint16_t id, struct FloatRates *body_rate)
Set vehicle body angular rate (float).
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
void ahrs_update_gps(void)
#define FillBufWith32bit(_buf, _index, _value)
#define HIGH_ACCEL_LOW_SPEED
static int16_t recievedData[NB_DATA]
#define HIGH_ACCEL_HIGH_THRUST_RESUME
#define HIGH_ACCEL_HIGH_THRUST
#define ArduIMU_SLAVE_ADDR
struct i2c_transaction ardu_gps_trans
struct i2c_transaction ardu_ins_trans
Paparazzi fixed point algebra.
vector in North East Down coordinates Units: meters
API to get/set the generic vehicle states.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
int int32_t
Typedef defining 32 bit int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.