17 #ifndef URG_STAMPED_DEVICE_TIME_ORIGIN_H 18 #define URG_STAMPED_DEVICE_TIME_ORIGIN_H 26 namespace device_time_origin
48 const boost::posix_time::ptime& time_request,
49 const boost::posix_time::ptime& time_response,
50 const uint64_t& device_timestamp)
60 const boost::posix_time::ptime& time_response,
61 const uint64_t& device_timestamp,
71 namespace jump_detector
75 const ros::Time& current_device_time_origin,
76 const double allowed_device_time_origin_diff)
78 if (last_device_time_origin ==
ros::Time(0))
81 const ros::Duration origin_diff = last_device_time_origin - current_device_time_origin;
82 return std::abs(origin_diff.
toSec()) > allowed_device_time_origin_diff;
88 #endif // URG_STAMPED_DEVICE_TIME_ORIGIN_H
DriftedTime(const ros::Time origin, const float gain)
ros::Time estimateOriginByAverage(const boost::posix_time::ptime &time_request, const boost::posix_time::ptime &time_response, const uint64_t &device_timestamp)
bool detectTimeJump(const ros::Time &last_device_time_origin, const ros::Time ¤t_device_time_origin, const double allowed_device_time_origin_diff)
ros::Time estimateOrigin(const boost::posix_time::ptime &time_response, const uint64_t &device_timestamp, const ros::Duration &communication_delay, ros::Time &time_at_device_timestamp)
Duration & fromNSec(int64_t t)
static Time fromBoost(const boost::posix_time::ptime &t)