From f33e8d5f24ef82a4b9f6bffaabd5e5466ff023b1 Mon Sep 17 00:00:00 2001 From: "Michael X. Grey" Date: Thu, 21 Nov 2024 13:17:33 +0800 Subject: [PATCH] Add an API to the primitive options builder for avoiding ROS namespace conventions Signed-off-by: Michael X. Grey --- rclrs/src/node/primitive_options.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rclrs/src/node/primitive_options.rs b/rclrs/src/node/primitive_options.rs index 5682873cf..0299c70f0 100644 --- a/rclrs/src/node/primitive_options.rs +++ b/rclrs/src/node/primitive_options.rs @@ -171,6 +171,15 @@ pub trait IntoPrimitiveOptions<'a>: Sized { fn liveliness_lease_duration(self, duration: Duration) -> PrimitiveOptions<'a> { self.liveliness_lease(QoSDuration::Custom(duration)) } + + /// [Avoid the ROS namespace conventions][1] for the primitive. + /// + /// [1]: QoSProfile::avoid_ros_namespace_conventions + fn avoid_ros_namespace_conventions(self) -> PrimitiveOptions<'a> { + let mut options = self.into_primitive_options(); + options.avoid_ros_namespace_conventions = Some(true); + options + } } impl<'a> IntoPrimitiveOptions<'a> for PrimitiveOptions<'a> {