Add topic name and QoS profile to Publisher_ struct

This commit is contained in:
PH 2025-05-09 00:16:53 +08:00
parent 455ea630ec
commit 4bcbb93e4d
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,8 @@ unsafe impl<T> Send for Publisher<T> 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<Vec<oneshot::Sender<()>>>,
@ -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 {