Skip to content

Commit fd5e56a

Browse files
authored
Set domain id to 0 if it is RMW_DEFAULT_DOMAIN_ID (#719)
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
1 parent f172071 commit fd5e56a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

rcl/src/rcl/init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ rcl_init(
152152
goto fail;
153153
}
154154
}
155+
if (RMW_DEFAULT_DOMAIN_ID == *domain_id) {
156+
*domain_id = 0u;
157+
}
155158

156159
rmw_localhost_only_t * localhost_only =
157160
&context->impl->init_options.impl->rmw_init_options.localhost_only;

rcl/src/rcl/node.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ rcl_node_init(
260260
goto fail;
261261
}
262262
}
263+
if (RMW_DEFAULT_DOMAIN_ID == domain_id) {
264+
domain_id = 0u;
265+
}
263266
RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Using domain ID of '%zu'", domain_id);
264267
node->impl->actual_domain_id = domain_id;
265268

0 commit comments

Comments
 (0)