diff --git a/rmw_fastrtps_shared_cpp/src/rmw_publish.cpp b/rmw_fastrtps_shared_cpp/src/rmw_publish.cpp index 281c958b6..0c8fc5ffb 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_publish.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_publish.cpp @@ -111,7 +111,7 @@ __rmw_publish_serialized_message( eprosima::fastrtps::Time_t stamp; eprosima::fastrtps::Time_t::now(stamp); TRACETOOLS_TRACEPOINT(rmw_publish, publisher, serialized_message, stamp.to_ns()); - if (!info->data_writer_->write(&data)) { + if (!info->data_writer_->write_w_timestamp(&data, eprosima::fastdds::dds::HANDLE_NIL, stamp)) { RMW_SET_ERROR_MSG("cannot publish data"); return RMW_RET_ERROR; }