time.h
Go to the documentation of this file.
1 #ifndef MRPT_BRIDGE_TIME_H
2 #define MRPT_BRIDGE_TIME_H
3 
4 #include <mrpt/system/datetime.h>
5 #include <ros/time.h>
6 
7 namespace mrpt_bridge
8 {
14 inline void convert(const ros::Time& src, mrpt::system::TTimeStamp& des)
15 {
16  // return (((uint64_t)src.sec) * (uint64_t)10000000) +
17  // ((uint64_t)116444736*1000000000);
18  des = mrpt::system::time_tToTimestamp((time_t)src.sec) + src.nsec / 100;
19  // printf("nsec %" PRIu64 "\n", des);
20 }
21 
27 inline void convert(const mrpt::system::TTimeStamp& src, ros::Time& des)
28 {
29  des.sec = ((uint64_t)src) / ((uint64_t)10000000) -
30  (((uint64_t)116444736) * ((uint64_t)100));
31  des.nsec = ((uint64_t)src) % ((uint64_t)10000000) * 100;
32  // printf("ros.sec %" PRIu32 "\n", des.sec);
33  // printf("ros.nsec %" PRIu32 "\n", des.nsec);
34 }
35 
36 }; // namespace mrpt_bridge
37 
38 #endif
File includes methods for converting CNetworkOfPoses*DInf <=> NetworkOfPoses message types...
bool convert(const mrpt_msgs::ObservationRangeBeacon &_msg, const mrpt::poses::CPose3D &_pose, mrpt::obs::CObservationBeaconRanges &_obj)


mrpt_bridge
Author(s): Markus Bader , Raphael Zack
autogenerated on Sat Apr 28 2018 02:49:17