Go to the documentation of this file.00001 #ifndef MRPT_BRIDGE_TIME_H
00002 #define MRPT_BRIDGE_TIME_H
00003
00004 #include <mrpt/system/datetime.h>
00005 #include <ros/time.h>
00006
00007 namespace mrpt_bridge {
00008
00014 inline void convert(const ros::Time &src, mrpt::system::TTimeStamp &des) {
00015
00016 des = mrpt::system::time_tToTimestamp((time_t) src.sec) + src.nsec/100;
00017
00018 }
00019
00025 inline void convert(const mrpt::system::TTimeStamp &src, ros::Time &des) {
00026 des.sec = ((uint64_t)src) / ((uint64_t) 10000000) - (((uint64_t) 116444736) * ((uint64_t) 100));
00027 des.nsec = ((uint64_t)src) % ((uint64_t) 10000000) * 100;
00028
00029
00030 }
00031
00032 };
00033
00034 #endif