Set domain id to 0 if it is RMW_DEFAULT_DOMAIN_ID (#719)

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
This commit is contained in:
Ivan Santiago Paunovic 2020-07-20 10:38:49 -03:00 committed by GitHub
parent f172071469
commit fd5e56a0e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -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;

View file

@ -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;