Skip to content

Commit

Permalink
Add an API to the primitive options builder for avoiding ROS namespac…
Browse files Browse the repository at this point in the history
…e conventions

Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
  • Loading branch information
mxgrey committed Nov 21, 2024
1 parent 012ff2e commit f33e8d5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rclrs/src/node/primitive_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit f33e8d5

Please sign in to comment.