#ifndef _FG_UGEAR_II_HXX #define _FG_UGEAR_II_HXX #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include SG_USING_STD(cout); SG_USING_STD(endl); SG_USING_STD(string); SG_USING_STD(vector); enum ugPacketType { GPS_PACKET = 0, IMU_PACKET = 1, NAV_PACKET = 2, SERVO_PACKET = 3, HEALTH_PACKET = 4 }; struct imu { double time; double p,q,r; /* angular velocities */ double ax,ay,az; /* acceleration */ double hx,hy,hz; /* magnetic field */ double Ps,Pt; /* static/pitot pressure */ // double Tx,Ty,Tz; /* temperature */ double phi,the,psi; /* attitudes */ uint64_t err_type; /* error type */ }; struct gps { double time; double lat,lon,alt; /* gps position */ double ve,vn,vd; /* gps velocity */ double ITOW; uint64_t err_type; /* error type */ }; struct nav { double time; double lat,lon,alt; double ve,vn,vd; // float t; uint64_t err_type; }; struct servo { double time; uint16_t chn[8]; uint64_t status; }; struct health { double time; double target_roll_deg; /* AP target roll angle */ double target_heading_deg; /* AP target heading angle */ double target_pitch_deg; /* AP target pitch angle */ double target_climb_fps; /* AP target climb rate */ double target_altitude_ft; /* AP target altitude */ uint64_t command_sequence; /* highest received command sequence num */ uint64_t target_waypoint; /* index of current waypoint target */ uint64_t loadavg; /* system "1 minute" load average */ uint64_t ahrs_hz; /* actual ahrs loop hz */ uint64_t nav_hz; /* actual nav loop hz */ }; // Manage a saved ugear log (track file) class UGTrack { private: vector gps_data; vector imu_data; vector