From dd82e842d9da0095460e8ccd9136903e34b56059 Mon Sep 17 00:00:00 2001 From: Yuyuan Yuan Date: Fri, 13 Dec 2024 21:11:21 +0800 Subject: [PATCH] fix: correct the received timestamp and use the system clock rather than the ntp64 timestamp from zenoh's HLC (#338) --- rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp index 4f21300b..14f1ed8f 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp @@ -71,7 +71,7 @@ void sub_data_handler(z_loaned_sample_t * sample, void * data) sub_data->add_new_message( std::make_unique( slice, - z_timestamp_ntp64_time(z_sample_timestamp(sample)), + std::chrono::system_clock::now().time_since_epoch().count(), std::move(attachment)), topic_name); }