Go to the documentation of this file.00001 #ifndef GPS_IMU_h
00002 #define GPS_IMU_h
00003
00004 #include <inttypes.h>
00005
00006 #define IMU_MAXPAYLOAD 32
00007
00008 class GPS_IMU_Class
00009 {
00010 private:
00011
00012 union int_union {
00013 int16_t word;
00014 uint8_t byte[2];
00015 } intUnion;
00016
00017 union long_union {
00018 int32_t dword;
00019 uint8_t byte[4];
00020 } longUnion;
00021
00022 uint8_t ck_a;
00023 uint8_t ck_b;
00024 uint8_t IMU_ck_a;
00025 uint8_t IMU_ck_b;
00026 uint8_t IMU_step;
00027 uint8_t IMU_class;
00028 uint8_t message_num;
00029 uint8_t payload_length;
00030 uint8_t payload_counter;
00031 uint8_t buffer[IMU_MAXPAYLOAD];
00032
00033 long IMU_timer;
00034 long IMU_ecefVZ;
00035 void IMU_join_data();
00036 void IMU2_join_data();
00037 void GPS_join_data();
00038 void checksum(unsigned char IMU_data);
00039 long join_4_bytes(unsigned char Buffer[]);
00040
00041 public:
00042
00043 GPS_IMU_Class();
00044 void Init();
00045 void Read();
00046
00047
00048 long roll_sensor;
00049 long pitch_sensor;
00050 int airspeed;
00051 float imu_health;
00052 uint8_t imu_ok;
00053
00054 long Time;
00055 long Lattitude;
00056 long Longitude;
00057 long Altitude;
00058 long Ground_Speed;
00059 long Ground_Course;
00060 long Speed_3d;
00061
00062 uint8_t NumSats;
00063 uint8_t Fix;
00064 uint8_t NewData;
00065 uint8_t PrintErrors;
00066 };
00067
00068 extern GPS_IMU_Class GPS;
00069 #endif