Skip to content

Commit

Permalink
Always create RELIABLE Writers (fix #165)
Browse files Browse the repository at this point in the history
  • Loading branch information
JEnoch committed Dec 8, 2023
1 parent 45ccfd8 commit b8b884b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion zenoh-plugin-dds/src/dds_mgt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,25 @@ pub fn create_forwarding_dds_writer(
topic_name: String,
type_name: String,
keyless: bool,
qos: Qos,
mut qos: Qos,
) -> Result<dds_entity_t, String> {
let cton = CString::new(topic_name).unwrap().into_raw();
let ctyn = CString::new(type_name).unwrap().into_raw();

unsafe {
let t = cdds_create_blob_topic(dp, cton, ctyn, keyless);

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

let qos_native = qos.to_qos_native();
let writer: i32 = dds_create_writer(dp, t, qos_native, std::ptr::null_mut());
Qos::delete_qos_native(qos_native);
Expand Down
2 changes: 1 addition & 1 deletion zenoh-plugin-dds/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn log_ros2_deprecation_warning() {
if !LOG_ROS2_DEPRECATION_WARNING_FLAG.swap(true, std::sync::atomic::Ordering::Relaxed) {
log::warn!("------------------------------------------------------------------------------------------");
log::warn!(
"ROS 2 system detected. Did you now a new Zenoh bridge dedicated to ROS 2 exists ?"
"ROS 2 system detected. Did you know a new Zenoh bridge dedicated to ROS 2 exists ?"
);
log::warn!("Check it out on https://github.com/eclipse-zenoh/zenoh-plugin-ros2dds");
log::warn!("This DDS bridge will eventually be deprecated for ROS 2 usage in favor of this new bridge.");
Expand Down

0 comments on commit b8b884b

Please sign in to comment.