Skip to content

Commit

Permalink
[rclcpp_components] Enable intra-process comm via LoadNode request. (#…
Browse files Browse the repository at this point in the history
…871)

Look for a 'use_intra_process_comms' boolean in extra_arguments.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic authored Oct 10, 2019
1 parent b8f7237 commit 07cb443
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rclcpp_components/src/component_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 07cb443

Please sign in to comment.