Ask Your Question
1

Can I pass in node options (e.g., IPC=true) when composing nodes using the CLI or launch files

asked 2019-07-10 13:42:53 -0600

clyde gravatar image

updated 2019-12-17 14:33:11 -0600

This demo shows how IPC works: https://github.com/ros2/demos/tree/ma...

The nodes in this demo are all defined such that use_intra_process_communications is initialized to true when the node is constructed.

This demo shows how composition works: https://github.com/ros2/demos/tree/ma...

The nodes in this demo are all defined such that somebody -- the node container? -- passes in node options when the nodes are instantiated. This appears to be a requirement for composition.

Is there a way to specify node options (e.g., use_intra_process_communications=true) using the ros2 CLI or using launch files? I'm not seeing anything in the Python launch code.

Edit: I'm skimming the rclcpp and rcl code, and I see that some arguments are parsed (params, log handling, etc.), but I don't see anything to turn IPC on/off. Is there a feature request / bug tracking this?

Edit 2: It appears that the answer is "no", and this is the issue: https://github.com/ros2/rclcpp/issues...

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-12-17 13:38:38 -0600

clyde gravatar image

updated 2019-12-18 18:23:13 -0600

This is possible from a launch file using extra_arguments, e.g.:

def generate_launch_description():
    """Generate launch description with multiple components."""
    container = ComposableNodeContainer(
            node_name='my_container',
            node_namespace='',
            package='rclcpp_components',
            node_executable='component_container',
            composable_node_descriptions=[
                ComposableNode(
                    package='composition',
                    node_plugin='composition::Talker',
                    node_name='talker',
                    extra_arguments=[{'use_intra_process_comms': True}]),
                ComposableNode(
                    package='composition',
                    node_plugin='composition::Listener',
                    node_name='listener',
                    extra_arguments=[{'use_intra_process_comms': True}])
            ],
            output='screen',
    )

It's also possible to pass extra_arguments on the command line, see documentation at ros2 component load --help.

I believe that this was introduced in Eloquent.

edit flag offensive delete link more

Comments

Does this works? I wanted to do the same thing but cannot able to pass the parameters this way. Thanks in advance.

Edit: I am using foxy

shivaang12 gravatar image shivaang12  ( 2020-01-27 15:00:45 -0600 )edit

It does work in eloquent.

FabianMene gravatar image FabianMene  ( 2020-01-30 07:40:49 -0600 )edit

I think I have asked wrong question (sorry, I just realized). I am trying to pass params to the composable node. Do you know how it can be done? Thanks in advance.

Edit: I figured out from this https://github.com/ros2/rclcpp/issues...

shivaang12 gravatar image shivaang12  ( 2020-01-30 08:36:59 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-07-10 13:42:53 -0600

Seen: 178 times

Last updated: Dec 18 '19