diff --git a/third-party/realdds/src/dds-device-impl.cpp b/third-party/realdds/src/dds-device-impl.cpp index 6dd10f1511..a79d99237e 100644 --- a/third-party/realdds/src/dds-device-impl.cpp +++ b/third-party/realdds/src/dds-device-impl.cpp @@ -85,7 +85,7 @@ dds_device::impl::impl( std::shared_ptr< dds_participant > const & participant, , _subscriber( std::make_shared< dds_subscriber >( participant ) ) , _device_settings( device_settings( participant ) ) , _reply_timeout_ms( - _device_settings.nested( "control", "reply-timeout-ms" ).default_value< size_t >( 2000 ) ) + _device_settings.nested( "control", "reply-timeout-ms" ).default_value< size_t >( 2500 ) ) { create_control_writer(); create_notifications_reader(); @@ -564,6 +564,9 @@ void dds_device::impl::create_control_writer() _control_writer = std::make_shared< dds_topic_writer >( topic ); dds_topic_writer::qos wqos( eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS ); wqos.history().depth = 10; // default is 1 + // If our reply timeout is less than the heartbeat period, we could lose the control message! + // So we set a short heartbeat time at half the reply timeout... + wqos.reliable_writer_qos().times.heartbeatPeriod = _reply_timeout_ms / 2000.; _control_writer->override_qos_from_json( wqos, _device_settings.nested( "control" ) ); _control_writer->run( wqos ); } diff --git a/third-party/realdds/src/dds-topic-writer.cpp b/third-party/realdds/src/dds-topic-writer.cpp index 7051b44f38..11f9ee8cd5 100644 --- a/third-party/realdds/src/dds-topic-writer.cpp +++ b/third-party/realdds/src/dds-topic-writer.cpp @@ -92,6 +92,8 @@ void dds_topic_writer::override_qos_from_json( qos & wqos, rsutils::json const & // Default values should be set before we're called: // All we do here is override those - if specified! override_reliability_qos_from_json( wqos.reliability(), qos_settings.nested( "reliability" ) ); + if( wqos.reliability().kind == eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS ) + qos_settings.nested( "heartbeat-period" ).get_ex( wqos.reliable_writer_qos().times.heartbeatPeriod ); override_durability_qos_from_json( wqos.durability(), qos_settings.nested( "durability" ) ); override_history_qos_from_json( wqos.history(), qos_settings.nested( "history" ) ); override_liveliness_qos_from_json( wqos.liveliness(), qos_settings.nested( "liveliness" ) );