diff --git a/rmw_fastrtps_shared_cpp/src/qos.cpp b/rmw_fastrtps_shared_cpp/src/qos.cpp index 6b1425224..6027915a6 100644 --- a/rmw_fastrtps_shared_cpp/src/qos.cpp +++ b/rmw_fastrtps_shared_cpp/src/qos.cpp @@ -20,14 +20,16 @@ #include "fastrtps/attributes/SubscriberAttributes.h" #include "rmw/error_handling.h" +#include "rmw_dds_common/time_utils.hpp" static eprosima::fastrtps::Duration_t rmw_time_to_fastrtps(const rmw_time_t & time) { + rmw_time_t clamped_time = rmw_dds_common::clamp_rmw_time_to_dds_time(time); return eprosima::fastrtps::Duration_t( - static_cast(time.sec), - static_cast(time.nsec)); + static_cast(clamped_time.sec), + static_cast(clamped_time.nsec)); } static