Skip to content

Commit 4e1b46d

Browse files
committed
Add set_env() to change domain_id at foxy
Signed-off-by: Taehun Lim <[email protected]>
1 parent 93b10c5 commit 4e1b46d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rclrs/src/context/builder.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ impl ContextBuilder {
6969
///
7070
/// [1]: https://docs.ros.org/en/rolling/Concepts/About-Domain-ID.html
7171
pub fn domain_id(mut self, domain_id: usize) -> Self {
72+
#[cfg(ros_distro = "foxy")]
73+
std::env::set_var("ROS_DOMAIN_ID", domain_id.to_string());
74+
7275
self.domain_id = domain_id;
7376
self
7477
}

0 commit comments

Comments
 (0)