28#include "uavcan/uavcan.h"
30#include "uavcan.equipment.gnss.Fix2.h"
39#define SECS_IN_WEEK (7*24*3600000)
55#if GPS_UAVCAN_USE_NODE_ID
98 if(
msg.ecef_position_velocity.len > 0) {
100 state.ecef_pos.x =
msg.ecef_position_velocity.data[0].position_xyz_mm[0] / 10;
101 state.ecef_pos.y =
msg.ecef_position_velocity.data[0].position_xyz_mm[1] / 10;
102 state.ecef_pos.z =
msg.ecef_position_velocity.data[0].position_xyz_mm[2] / 10;
106 state.ecef_vel.x =
msg.ecef_position_velocity.data[0].velocity_xyz[0] * 100;
107 state.ecef_vel.y =
msg.ecef_position_velocity.data[0].velocity_xyz[1] * 100;
108 state.ecef_vel.z =
msg.ecef_position_velocity.data[0].velocity_xyz[2] * 100;
115 state.lla_pos.lat =
msg.latitude_deg_1e8 / 10;
116 state.lla_pos.lon =
msg.longitude_deg_1e8 / 10;
117 state.lla_pos.alt =
msg.height_ellipsoid_mm;
127 state.ned_vel.x =
msg.ned_velocity[0] * 100;
128 state.ned_vel.y =
msg.ned_velocity[1] * 100;
129 state.ned_vel.z =
msg.ned_velocity[2] * 100;
144 if (
msg.covariance.len == 6) {
146 if (!
isnan(
msg.covariance.data[0])) {
150 if (!
isnan(
msg.covariance.data[2])) {
158 if (!
isnan(
msg.covariance.data[3]) &&
161 state.sacc =
sqrtf((
msg.covariance.data[3] +
msg.covariance.data[4] +
msg.covariance.data[5])/3) * 100;
163 }
else if(
msg.covariance.len != 0){
176 switch (
msg.gnss_time_standard)
199 state.nb_channels = 0;
Main include for ABI (AirBorneInterface).
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Main uavcan event structure for registering/calling callbacks.
Device independent GPS code (interface)
#define GPS_FIX_DGPS
DGPS fix.
#define GPS_VALID_VEL_ECEF_BIT
#define GPS_VALID_VEL_NED_BIT
#define GPS_VALID_POS_LLA_BIT
#define GPS_FIX_NONE
No GPS fix.
#define GPS_VALID_POS_ECEF_BIT
#define GPS_VALID_HMSL_BIT
#define GPS_FIX_2D
2D GPS fix
#define GPS_FIX_3D
3D GPS fix
#define GPS_FIX_RTK
RTK GPS fix.
#define GPS_VALID_COURSE_BIT
data structure for GPS information
static void gps_uavcan_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
static uavcan_event gps_uavcan_ev
void gps_uavcan_init(void)
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
Paparazzi double-precision floating point math for geodetic calculations.
Paparazzi floating point math for geodetic calculations.
Paparazzi fixed point math for geodetic calculations.
#define NormCourseRad(x)
Normalize a rad angle between 0 and 2*PI.
uavcan interface structure
volatile uint32_t nb_sec
full seconds since startup
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
void uavcan_bind(uint16_t data_type_id, uint64_t data_type_signature, uavcan_event *ev, uavcan_callback cb)
Bind to a receiving message from uavcan.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned long long uint64_t
int transfer(const Mat *from, const image_t *to)