ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You have to enable intraprocess communication explicitly to have it kick in. You do this with the NodeOptions passed to the nodes. Try the following in combined_node.cpp:

int main(int argc, char** argv)
{
  rclcpp::init(argc, argv);
  rclcpp::executors::MultiThreadedExecutor executor;
  auto intra_comms_options = rclcpp::NodeOptions{}.use_intra_process_comms(true);
  auto probe = std::make_shared<simple_perf_test::ProbeComponent>(intra_comms_options);
  auto target = std::make_shared<simple_perf_test::TargetComponent>(intra_comms_options);
  executor.add_node(probe);
  executor.add_node(target);
  executor.spin();
  rclcpp::shutdown();
  return 0;
}