8 #ifndef _LIBALMATH_ALMATH_SCENEGRAPH_QIROSMSG_H_
9 #define _LIBALMATH_ALMATH_SCENEGRAPH_QIROSMSG_H_
11 #include <qi/clock.hpp>
52 using qirep = qi::Duration::rep;
53 constexpr qirep rosMin = 1;
54 constexpr qirep rosMax =
56 static_cast<qirep
>(std::numeric_limits<uint32_t>::max()) * 1000000000;
57 assert(rosMin == static_cast<qirep>(ros::TIME_MIN.toNSec()));
58 assert(rosMax == static_cast<qirep>(ros::TIME_MAX.toNSec()));
60 ret.fromNSec(std::min(rosMax, std::max(rosMin, time_since_epoch.count())));
65 using qirep = qi::Duration::rep;
68 assert(time <= ros::TIME_MAX);
69 return qi::Duration(static_cast<qirep>(time.toNSec()));
qi::Duration toQiDuration(ros::Time time)
ros::Time toValidRosTime(qi::Duration time_since_epoch)