From 4bcbb93e4df5306b15ddc41d0e8be0496c1da9ac Mon Sep 17 00:00:00 2001 From: PH Date: Fri, 9 May 2025 00:16:53 +0800 Subject: [PATCH] Add topic name and QoS profile to Publisher_ struct --- r2r/src/publishers.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/r2r/src/publishers.rs b/r2r/src/publishers.rs index cb3bd3bd7..25c45a369 100644 --- a/r2r/src/publishers.rs +++ b/r2r/src/publishers.rs @@ -38,6 +38,8 @@ unsafe impl Send for Publisher where T: WrappedTypesupport {} pub(crate) struct Publisher_ { handle: rcl_publisher_t, + topic_name: String, + qos_profile: QosProfile, // TODO use a mpsc to avoid the mutex? poll_inter_process_subscriber_channels: Mutex>>, @@ -155,6 +157,8 @@ pub fn create_publisher_helper( if result == RCL_RET_OK as i32 { Ok(Publisher_ { handle: publisher_handle, + topic_name: topic.to_string(), + qos_profile, poll_inter_process_subscriber_channels: Mutex::new(Vec::new()), }) } else {