ROS Concurrency

ROS Intra-Process Communication

ROS2 IPC bypasses the middleware, so you don’t have to serialize the message that is being sent.

Some resources

See Composable Node for actual implementation.

Important: you need the following (taken from https://github.com/stereolabs/zed-ros2-wrapper/blob/master/zed_wrapper/src/zed_wrapper.cpp)

  // Create an executor that will be responsible for execution of callbacks for a set of nodes.
  // With this version, all callbacks will be called from within this thread (the main one).
  rclcpp::executors::MultiThreadedExecutor exec;
  rclcpp::NodeOptions options;
 
  options.use_intra_process_comms(true);
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
 
# ..
ld.add_action(ComposableNodeContainer(
    name='a_buncha_nodes',
    namespace='',
    package='rclcpp_components',
    executable='component_container',
    composable_node_descriptions=[
        ComposableNode(
            package='palomino',
            plugin='palomino::VincentDriver',
            name='vincent_driver',
            # ..
            extra_arguments=[{'use_intra_process_comms': True}],
        ),
    ]
))

in Nitros

https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros/blob/da49a97663d6d6be6f66b9bc4eaa21d0750ebac5/isaac_ros_nitros/src/nitros_publisher.cpp#L210

So that is set at the publisher level, not the node level?

NitrosPublisher does not inherit from rclcpp::Node. NitrosNode does.

void NitrosPublisher::addSupportedDataFormat(
  const std::string & data_format,
  const double weight)
{
  rclcpp::PublisherOptions pub_options;
  pub_options.use_intra_process_comm = rclcpp::IntraProcessSetting::Enable;