39 #ifndef USE_INS_NAV_INIT
40 #define USE_INS_NAV_INIT TRUE
45 #include "generated/flight_plan.h"
64 #define INS_PT_IMU_ID ABI_BROADCAST
74 #define INS_PT_GPS_ID GPS_MULTI_ID
80 uint32_t stamp __attribute__((unused)),
107 #if PERIODIC_TELEMETRY
110 static void send_ins(
struct transport_tx *trans,
struct link_device *
dev)
112 pprz_msg_send_INS(trans,
dev, AC_ID,
120 static float fake_baro_z = 0.0;
121 pprz_msg_send_INS_Z(trans,
dev, AC_ID,
128 static float fake_qfe = 0.0;
130 pprz_msg_send_INS_REF(trans,
dev, AC_ID,
143 llh_nav0.
lat = NAV_LAT0;
144 llh_nav0.
lon = NAV_LON0;
146 llh_nav0.
alt = NAV_ALT0 + NAV_MSL0;
164 #if PERIODIC_TELEMETRY
198 uint32_t stamp __attribute__((unused)),
Main include for ABI (AirBorneInterface).
Event structure to store callbacks in a linked list.
struct GpsState gps
global GPS state
struct LlaCoor_i lla_int_from_gps(struct GpsState *gps_s)
Get GPS lla (integer) Converted on the fly if not available.
struct EcefCoor_i ecef_vel_int_from_gps(struct GpsState *gps_s)
Get GPS ecef velocity (integer) Converted on the fly if not available.
struct EcefCoor_i ecef_int_from_gps(struct GpsState *gps_s)
Get GPS ecef pos (integer) Converted on the fly if not available.
Device independent GPS code (interface)
int32_t hmsl
height above mean sea level (MSL) in mm
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
#define GPS_FIX_3D
3D GPS fix
data structure for GPS information
#define VECT3_COPY(_a, _b)
#define INT32_POS_OF_CM_DEN
#define INT32_SPEED_OF_CM_S_NUM
#define ACCEL_BFP_OF_REAL(_af)
#define INT32_SPEED_OF_CM_S_DEN
#define INT32_POS_OF_CM_NUM
#define INT32_VECT3_ZERO(_v)
void int32_rmat_transp_vmult(struct Int32Vect3 *vb, struct Int32RMat *m_b2a, struct Int32Vect3 *va)
rotate 3D vector by transposed rotation matrix.
#define INT32_VECT3_SCALE_2(_a, _b, _num, _den)
int32_t lat
in degrees*1e7
int32_t hmsl
Height above mean sea level in mm.
int32_t alt
in millimeters above WGS84 reference ellipsoid
struct LlaCoor_i lla
Reference point in lla.
struct EcefCoor_i ecef
Reference point in ecef.
int32_t lon
in degrees*1e7
void ecef_of_lla_i(struct EcefCoor_i *out, struct LlaCoor_i *in)
Convert a LLA to ECEF.
void ltp_def_from_ecef_i(struct LtpDef_i *def, struct EcefCoor_i *ecef)
void ned_of_ecef_point_i(struct NedCoor_i *ned, struct LtpDef_i *def, struct EcefCoor_i *ecef)
Convert a point from ECEF to local NED.
void ned_of_ecef_vect_i(struct NedCoor_i *ned, struct LtpDef_i *def, struct EcefCoor_i *ecef)
Rotate a vector from ECEF to NED.
void ltp_def_from_lla_i(struct LtpDef_i *def, struct LlaCoor_i *lla)
vector in EarthCenteredEarthFixed coordinates
vector in Latitude, Longitude and Altitude
definition of the local (flat earth) coordinate system
vector in North East Down coordinates
static void stateSetAccelNed_i(struct NedCoor_i *ned_accel)
Set acceleration in NED coordinates (int).
static struct Int32RMat * stateGetNedToBodyRMat_i(void)
Get vehicle body attitude rotation matrix (int).
struct LtpDef_i ned_origin_i
Definition of the local (flat earth) coordinate system.
static void stateSetPositionNed_i(struct NedCoor_i *ned_pos)
Set position from local NED coordinates (int).
static void stateSetLocalOrigin_i(struct LtpDef_i *ltp_def)
Set the local (flat earth) coordinate frame origin (int).
static void stateSetAccelBody_i(struct Int32Vect3 *body_accel)
Set acceleration in Body coordinates (int).
static void stateSetSpeedNed_i(struct NedCoor_i *ned_speed)
Set ground speed in local NED coordinates (int).
Integrated Navigation System interface.
void ins_reset_local_origin(void)
INS local origin reset.
static void gps_cb(uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
struct NedCoor_i ltp_speed
static void send_ins(struct transport_tx *trans, struct link_device *dev)
struct InsGpsPassthrough ins_gp
struct NedCoor_i ltp_accel
static abi_event accel_ev
void ins_gps_passthrough_init(void)
static void send_ins_ref(struct transport_tx *trans, struct link_device *dev)
static void send_ins_z(struct transport_tx *trans, struct link_device *dev)
#define INS_PT_IMU_ID
ABI bindings on ACCEL data.
void ins_reset_altitude_ref(void)
INS altitude reference reset.
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
#define INS_PT_GPS_ID
ABI binding for gps data.
Simply passes GPS through to the state interface.
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.