/* * ===================================================================================== * * Filename: navdata.h * * Description: Navdata head file * * Version: 1.0 * Created: 2018/8/15 17:22:18 * Revision: none * Compiler: gcc * * Author: Jarod Lee * Organization: * * ===================================================================================== */ #ifndef __NAV_DATA_H #define __NAV_DATA_H #include #define MAX_SVID 300 enum { CONSTELL_TYPE_UNKNOWN = 0, CONSTELL_TYPE_GPS, CONSTELL_TYPE_GLN, CONSTELL_TYPE_BDS, MAX_CONSTELL_TYPES, }; /* * Satellite structure */ struct sate { int constell; // GPS or GLN or BDS.... int prn; int cn0; int elev; // elevation int azim; // azimuth bool in_use; // is the satellite used in fix bool valid; // is the satellite valid }; /* * Gnss date structure */ struct gnss_date { int year; int month; int day; }; /* * Gnss time structure */ struct gnss_time { int hour; int minute; int second; int ms; }; /* * Navigation data */ struct nav_data { struct gnss_date date; // 日期 struct gnss_time time; // 时间 bool is_fixed; // 定位状态 double lat; // 纬度 double lon; // 经度 float alt; // 海拔 float speed; // 速度 float heading; // 航向角度 float hdop; // 水平精度 float vdop; // 垂直精度因子。反映高程(海拔)的精度。 float pdop; // 位置精度因子。反映三维位置的综合精度。 int sv_inuse; // 参与定位的卫星数量。即在计算当前位置时,实际使用了多少颗卫星的数据。 int sv_inview; // 当前可视的卫星数量。即接收机天空中视野范围内一共搜到了多少颗卫星。 int sv_count; // 卫星总数(具体含义取决于上下文,有时等同于 sv_inview,或者是用于遍历卫星数组的计数器)。 struct sate sates[MAX_SVID]; // 用来存储每一颗具体卫星的详细数据(如卫星ID、信噪比、仰角、方位角等)。 }; int prn2svid(int prn, int constell); // convert @prn and @constell to SVID int tell_constell(int svid); // tell the constellation type of @svid const char *constell_name(int constell); // get constellation type's name void navdata_init(struct nav_data *d); // int nav_data to 0 #endif