diff --git a/rcl/src/rcl/init.c b/rcl/src/rcl/init.c index 0cb92bb2f..94a874cf6 100644 --- a/rcl/src/rcl/init.c +++ b/rcl/src/rcl/init.c @@ -152,6 +152,9 @@ rcl_init( goto fail; } } + if (RMW_DEFAULT_DOMAIN_ID == *domain_id) { + *domain_id = 0u; + } rmw_localhost_only_t * localhost_only = &context->impl->init_options.impl->rmw_init_options.localhost_only; diff --git a/rcl/src/rcl/node.c b/rcl/src/rcl/node.c index 46d248026..42ec35d9f 100644 --- a/rcl/src/rcl/node.c +++ b/rcl/src/rcl/node.c @@ -260,6 +260,9 @@ rcl_node_init( goto fail; } } + if (RMW_DEFAULT_DOMAIN_ID == domain_id) { + domain_id = 0u; + } RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Using domain ID of '%zu'", domain_id); node->impl->actual_domain_id = domain_id;