We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd7323a commit 729fd3cCopy full SHA for 729fd3c
rclrs/src/context.rs
@@ -82,14 +82,19 @@ impl Context {
82
/// assert_eq!(domain_id, 11);
83
/// # Ok::<(), RclrsError>(())
84
/// ```
85
- #[cfg(not(ros_distro = "foxy"))]
86
pub fn domain_id(&self) -> usize {
87
let mut rcl_context = self.rcl_context_mtx.lock().unwrap();
88
let mut domain_id: usize = 0;
+ #[cfg(not(ros_distro = "foxy"))]
89
let ret = unsafe {
90
// SAFETY: No preconditions for this function.
91
rcl_context_get_domain_id(&mut *rcl_context, &mut domain_id)
92
};
93
+ #[cfg(ros_distro = "foxy")]
94
+ let ret = unsafe {
95
+ // SAFETY: Getting the default domain ID, based on the environment
96
+ rcl_get_default_domain_id(&mut domain_id)
97
+ };
98
99
debug_assert_eq!(ret, 0);
100
domain_id
0 commit comments