diff --git a/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/qos.hpp b/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/qos.hpp index ad5799452f..7e5b380c71 100644 --- a/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/qos.hpp +++ b/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/qos.hpp @@ -173,6 +173,23 @@ rtps_qos_to_rmw_qos( break; } qos->liveliness_lease_duration = dds_duration_to_rmw(rtps_qos.m_liveliness.lease_duration); + + if (rtps_qos.history.has_value()) { + switch (rtps_qos.history->kind) { + case eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS: + qos->history = RMW_QOS_POLICY_HISTORY_KEEP_LAST; + break; + case eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS: + qos->history = RMW_QOS_POLICY_HISTORY_KEEP_ALL; + break; + default: + qos->history = RMW_QOS_POLICY_HISTORY_UNKNOWN; + break; + } + qos->depth = static_cast(rtps_qos.history->depth); + } else { + qos->history = RMW_QOS_POLICY_HISTORY_UNKNOWN; + } } extern template RMW_FASTRTPS_SHARED_CPP_PUBLIC