33 #if PERIODIC_TELEMETRY
38 pprz_msg_send_INS(trans, dev, AC_ID,
46 pprz_msg_send_INS_Z(trans, dev, AC_ID,
53 pprz_msg_send_INS_REF(trans, dev, AC_ID,
62 pprz_msg_send_VECTORNAV_INFO(trans, dev, AC_ID,
76 pprz_msg_send_IMU_ACCEL(trans, dev, AC_ID,
82 pprz_msg_send_IMU_GYRO(trans, dev, AC_ID,
88 pprz_msg_send_IMU_ACCEL_SCALED(trans, dev, AC_ID,
94 pprz_msg_send_IMU_GYRO_SCALED(trans, dev, AC_ID,
99 #ifndef USE_INS_NAV_INIT
100 #define USE_INS_NAV_INIT TRUE
158 #if PERIODIC_TELEMETRY
189 idx += 3 *
sizeof(float);
193 idx += 3 *
sizeof(float);
198 idx += 3 *
sizeof(double);
203 idx += 3 *
sizeof(float);
207 idx += 3 *
sizeof(float);
226 idx += 3 *
sizeof(float);
230 idx +=
sizeof(float);
241 idx += 3 *
sizeof(float);
245 idx += 3 *
sizeof(float);
254 idx +=
sizeof(float);
304 att_rad.
phi = RadOfDeg(vn_attitude->
psi);
306 att_rad.
psi = RadOfDeg(vn_attitude->
phi);
308 vn_attitude->
phi = att_rad.
phi;
310 vn_attitude->
psi = att_rad.
psi;
336 static struct FloatRMat ltp_to_body_rmat;
356 VECT3_ASSIGN(ltp_accel, accel_meas_ltp.
x, accel_meas_ltp.
y, accel_meas_ltp.
z);
445 llh_nav0.
lat = NAV_LAT0;
446 llh_nav0.
lon = NAV_LON0;
448 llh_nav0.
alt = NAV_ALT0 + NAV_MSL0;
struct NedCoor_f ltp_accel_f
int32_t north
in centimeters
#define RATES_BFP_OF_REAL(_ri, _rf)
static void stateSetNedToBodyRMat_f(struct FloatRMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (float).
#define ECEF_BFP_OF_REAL(_o, _i)
void float_quat_of_eulers(struct FloatQuat *q, struct FloatEulers *e)
Quaternion from Euler angles.
void ins_vectornav_propagate()
Propagate the received states into the vehicle state machine.
definition of the local (flat earth) coordinate system
uint32_t pacc
position accuracy in cm
Generic transmission transport header.
struct VNPacket vn_packet
Packet struct.
uint8_t err
see page 122 of VN-200 datasheet
void ins_vectornav_set_sacc(void)
Set speed (velocity) uncertainty (NED) speed accuracy in cm/s.
float alt
in meters above WGS84 reference ellipsoid
#define INS_VN_BODY_TO_IMU_PSI
struct NedCoor_i ltp_accel_i
static struct EcefCoor_i * stateGetPositionEcef_i(void)
Get position in ECEF coordinates (int).
Periodic telemetry system header (includes downlink utility and generated code).
vector in EarthCenteredEarthFixed coordinates
vector in EarthCenteredEarthFixed coordinates
void ecef_of_ned_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned)
struct FloatEulers ypr_u
Attitude uncertainty, 1sigma, float, [degrees], yaw, pitch, roll.
static struct FloatRMat * orientationGetRMat_f(struct OrientationReps *orientation)
Get vehicle body attitude rotation matrix (float).
#define INT32_VECT3_ZERO(_v)
#define VECT3_ASSIGN(_a, _x, _y, _z)
enum VNStatus vn_status
VN status.
struct FloatVect3 lin_accel
Linear acceleration in imu frame [m/s^2].
position in UTM coordinates Units: meters
int32_t east
in centimeters
#define INS_VN_BODY_TO_IMU_THETA
void ins_init_origin_from_flightplan(void)
initialize the local origin (ltp_def) from flight plan position
struct FloatEulers attitude
Attitude, float, [degrees], yaw, pitch, roll.
vector in Latitude, Longitude and Altitude
#define GPS_FIX_3D
3D GPS fix
Vectornav VN-200 INS subsystem.
struct UtmCoor_i utm_pos
position in UTM (north,east: cm; alt: mm over ellipsoid)
static float get_sys_time_float(void)
Get the time in seconds since startup.
void vn200_event(struct VNPacket *vnp)
struct EcefCoor_i ecef
Reference point in ecef.
int32_t hmsl
Height above mean sea level in mm.
uint32_t last_3dfix_ticks
cpu time ticks at last valid 3D fix
struct FloatRates gyro
Rates in the imu frame m/s.
int32_t alt
in millimeters above WGS84 reference ellipsoid
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define ACCELS_BFP_OF_REAL(_ef, _ei)
uint32_t sacc
speed accuracy in cm/s
uint32_t last_msg_time
cpu time in sec at last received GPS message
uint8_t zone
UTM zone number.
int32_t r
in rad/s with INT32_RATE_FRAC
static struct NedCoor_i * stateGetSpeedNed_i(void)
Get ground speed in local NED coordinates (int).
#define FLOAT_VECT3_ZERO(_v)
static void stateSetSpeedNed_f(struct NedCoor_f *ned_speed)
Set ground speed in local NED coordinates (float).
void float_rmat_comp(struct FloatRMat *m_a2c, struct FloatRMat *m_a2b, struct FloatRMat *m_b2c)
Composition (multiplication) of two rotation matrices.
unsigned long long uint64_t
int32_t hmsl
height above mean sea level in mm
void float_rmat_transp_vmult(struct FloatVect3 *vb, struct FloatRMat *m_b2a, struct FloatVect3 *va)
rotate 3D vector by transposed rotation matrix.
vector in North East Down coordinates Units: meters
uint8_t mode
0-not tracking, 1 - poor performance, 2- OK
uint32_t tow
GPS time of week in ms.
void float_rmat_of_quat(struct FloatRMat *rm, struct FloatQuat *q)
static void stateSetPositionLla_i(struct LlaCoor_i *lla_pos)
Set position from LLA coordinates (int).
struct FloatVect3 accel
Acceleration in the imu frame, m/s.
float pos_u[3]
The current GPS position uncertainty in the North East Down (NED) coordinate frame, given in meters.
static void stateSetLocalOrigin_i(struct LtpDef_i *ltp_def)
Set the local (flat earth) coordinate frame origin (int).
void ins_vectornav_yaw_pitch_roll_to_attitude(struct FloatEulers *vn_attitude)
Convert yaw, pitch, and roll data from VectorNav to correct attitude yaw(0), pitch(1), roll(2) -> phi, theta, psi [deg] -> rad.
struct EcefCoor_i ecef_pos
position in ECEF in cm
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
struct LlaCoor_i lla
Reference point in lla.
#define DefaultPeriodic
Set default periodic telemetry.
int32_t lon
in degrees*1e7
float baro_z
z-position calculated from baro in meters (z-down)
float vel_u
NED velocity uncertainty [m/s].
void ins_vectornav_set_pacc(void)
Find maximum uncertainty (NED) position accuracy in cm.
void ins_vectornav_read_message(void)
Read received data.
uint8_t zone
UTM zone number.
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
static const struct usb_device_descriptor dev
float alt
in meters above WGS84 reference ellipsoid
void ltp_def_from_lla_f(struct LtpDef_f *def, struct LlaCoor_f *lla)
uint32_t last_3dfix_time
cpu time in sec at last valid 3D fix
int32_t alt
in millimeters above WGS84 reference ellipsoid
struct InsVectornav ins_vn
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
struct Int32Vect3 accel_i
struct NedCoor_i ltp_speed_i
struct OrientationReps body_to_imu
body_to_imu rotation
volatile uint32_t nb_sec
full seconds since startup
uint8_t msg_buf[VN_BUFFER_SIZE]
#define LLA_BFP_OF_REAL(_o, _i)
uint16_t ins_status
see page 122 of VN-200 datasheet
int32_t p
in rad/s with INT32_RATE_FRAC
struct NedCoor_i ltp_pos_i
uint32_t last_msg_ticks
cpu time ticks at last received GPS message
#define INS_VN_BODY_TO_IMU_PHI
uint8_t num_sv
number of sat in fix
uint16_t gspeed
norm of 2d ground speed in cm/s
void ecef_of_lla_i(struct EcefCoor_i *out, struct LlaCoor_i *in)
struct EcefCoor_i ecef_vel
speed ECEF in cm/s
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
void float_rmat_ratemult(struct FloatRates *rb, struct FloatRMat *m_a2b, struct FloatRates *ra)
rotate anglular rates by rotation matrix.
static struct NedCoor_i * stateGetPositionNed_i(void)
Get position in local NED coordinates (int).
int32_t lat
in degrees*1e7
static void stateSetBodyRates_f(struct FloatRates *body_rate)
Set vehicle body angular rate (float).
struct FloatVect3 vel_body
The estimated velocity in the imu frame, given in m/s.
void ins_vectornav_event(void)
Event handling for Vectornav.
static void stateSetAccelNed_f(struct NedCoor_f *ned_accel)
Set acceleration in NED coordinates (float).
int32_t q
in rad/s with INT32_RATE_FRAC
struct NedCoor_f vel_ned
The estimated velocity in the North East Down (NED) frame, given in m/s.
uint32_t vn_time
VN time stamp.
struct GpsState gps
global GPS state
void ltp_def_from_ecef_i(struct LtpDef_i *def, struct EcefCoor_i *ecef)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)
float timestamp
System time [s].
static struct NedCoor_i * stateGetAccelNed_i(void)
Get acceleration in NED coordinates (int).
void ins_vectornav_init(void)
Initialize Vectornav struct.
void ins_vectornav_check_status(void)
Check INS status.
static void orientationSetEulers_f(struct OrientationReps *orientation, struct FloatEulers *eulers)
Set vehicle body attitude from euler angles (float).