Go to the documentation of this file.00001 #ifndef UBLOX_GPS_UTILS_H
00002 #define UBLOX_GPS_UTILS_H
00003
00004 #include <math.h>
00005 #include <time.h>
00006 #include "ublox_msgs/NavPVT.h"
00007
00008 extern "C" {
00009 #include "ublox_gps/mkgmtime.h"
00010 }
00011
00015 template<typename NavPVT>
00016 long toUtcSeconds(const NavPVT& msg) {
00017
00018 struct tm time = {0};
00019 time.tm_year = msg.year - 1900;
00020 time.tm_mon = msg.month - 1;
00021 time.tm_mday = msg.day;
00022 time.tm_hour = msg.hour;
00023 time.tm_min = msg.min;
00024 time.tm_sec = msg.sec;
00025
00026
00027
00028 return mkgmtime(&time);
00029 }
00030
00031 #endif