From a3487ab8a3fea451e456b3d6f762b29a0b3dd27f Mon Sep 17 00:00:00 2001 From: TSC21 Date: Mon, 9 Mar 2020 18:59:18 +0000 Subject: [PATCH] microRTPS: timesync: fix unit conversion --- msg/templates/urtps/microRTPS_timesync.h.em | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msg/templates/urtps/microRTPS_timesync.h.em b/msg/templates/urtps/microRTPS_timesync.h.em index e4764395a6..bff86b9f85 100644 --- a/msg/templates/urtps/microRTPS_timesync.h.em +++ b/msg/templates/urtps/microRTPS_timesync.h.em @@ -142,8 +142,8 @@ public: @[end if]@ inline int64_t getOffset() { return _offset_ns.load(); } - inline void addOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL + _offset_ns.load()) / 10000ULL; } - inline void subtractOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL - _offset_ns.load()) / 10000ULL; } + inline void addOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL + _offset_ns.load()) / 1000ULL; } + inline void subtractOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL - _offset_ns.load()) / 1000ULL; } private: std::atomic _offset_ns;