[rclcpp_components] Enable intra-process comm via LoadNode request. (#871)

Look for a 'use_intra_process_comms' boolean in extra_arguments.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
This commit is contained in:
Michel Hidalgo 2019-10-10 13:14:24 -03:00 committed by GitHub
parent b8f7237087
commit 07cb443a18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,6 +165,17 @@ ComponentManager::OnLoadNode(
.parameter_overrides(parameters)
.arguments(remap_rules);
for (const auto & a : request->extra_arguments) {
const rclcpp::Parameter extra_argument = rclcpp::Parameter::from_parameter_msg(a);
if (extra_argument.get_name() == "use_intra_process_comms") {
if (extra_argument.get_type() != rclcpp::ParameterType::PARAMETER_BOOL) {
throw ComponentManagerException(
"Extra component argument 'use_intra_process_comms' must be a boolean");
}
options.use_intra_process_comms(extra_argument.get_value<bool>());
}
}
auto node_id = unique_id++;
if (0 == node_id) {