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
00017
00018 des = mrpt::system::time_tToTimestamp((time_t)src.sec) + src.nsec / 100;
00019
00020 }
00021
00027 inline void convert(const mrpt::system::TTimeStamp& src, ros::Time& des)
00028 {
00029 des.sec = ((uint64_t)src) / ((uint64_t)10000000) -
00030 (((uint64_t)116444736) * ((uint64_t)100));
00031 des.nsec = ((uint64_t)src) % ((uint64_t)10000000) * 100;
00032
00033
00034 }
00035
00036 };
00037
00038 #endif