Skip to content

Commit

Permalink
Always create RELIABLE Writers (fix #23)
Browse files Browse the repository at this point in the history
  • Loading branch information
JEnoch committed Dec 8, 2023
1 parent eb66be5 commit 846fc07
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion zenoh-plugin-ros2dds/src/route_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl RouteSubscriber<'_> {
ros2_type: String,
zenoh_key_expr: OwnedKeyExpr,
keyless: bool,
writer_qos: Qos,
mut writer_qos: Qos,
context: Context,
) -> Result<RouteSubscriber<'a>, String> {
let transient_local = is_transient_local(&writer_qos);
Expand All @@ -118,6 +118,17 @@ impl RouteSubscriber<'_> {
let type_name = ros2_message_type_to_dds_type(&ros2_type);
let queries_timeout = context.config.get_queries_timeout_tl_sub(&ros2_name);

// force RELIABLE QoS for Writers (#23)
if let Some(cyclors::qos::Reliability {
kind: cyclors::qos::ReliabilityKind::BEST_EFFORT,
..
}) = &mut writer_qos.reliability
{
// Per DDS specification, the default Reliability value for DataWriters is RELIABLE with max_blocking_time=100ms
// Thus just use default value.
writer_qos.reliability = None;
}

log::debug!(
"Route Subscriber ({zenoh_key_expr} -> {ros2_name}): create Writer with {writer_qos:?}"
);
Expand Down

0 comments on commit 846fc07

Please sign in to comment.