Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch composable C++ nodes #6

Closed
4 tasks done
sloretz opened this issue Jan 11, 2019 · 2 comments
Closed
4 tasks done

Launch composable C++ nodes #6

sloretz opened this issue Jan 11, 2019 · 2 comments
Assignees

Comments

@sloretz
Copy link
Contributor

sloretz commented Jan 11, 2019

Feature request

This is a feature request for launching multiple composable nodes into the same process. The acceptance criteria for this ticket is limited to launching dynamically composable rclcpp non-lifecycle nodes into a container process.

Feature description

launch_ros must pass arguments to the composable nodes where "arguments" means:

  • the information that can be passed via the command line of any rcl based node
    • parameters
    • remap rules
    • node name
    • namespace
    • log level
  • information that is specific to the client library rclcpp
    • use_intra_process_comms
    • start_parameter_services

An exception is use_global_arguments which should always be false so a composed node is not affected by arguments passed to the container process.

Arguments does not include environment variables like RMW_IMPLEMENTATION which apply to the whole container process.

PRs

Implementation considerations

launch_ros

See slide 8 of https://roscon.ros.org/2018/presentations/ROSCon2018_launch.pdf

        ExecuteComposableNodeProcess(
            package='rclcpp_components', container_executable='rclcpp_node_container', output='screen',
            composable_node_descriptions=[
                ComposableNodeDescription(
                    package_name='demo_nodes_cpp', node_plugin_name='talker',
                    name='my_talker'),
                ComposableNodeDescription(
                    package_name='demo_nodes_cpp', node_plugin_name='listener'
                    name='my_listener')
            ]
        )

ExecuteComposableNodeProcess should start a container executable with a defined API. This allows a user to create a custom container process (e.g. create a container with a custom executor). The API may be a config file and/or a ROS API. The acceptance criteria for this ticket is limited to a ROS service API that can load and unload composable nodes (see also ros2/rcl_interfaces#60).

rclcpp

There must be a new ROS package (rclcpp_components?) with a container process for rclcpp nodes. The acceptance criteria for this task is to be able to use either a single threaded executor or multithreaded executor in a container process. For example, this could be two container processes, or one with a CLI argument to choose the executor.

Launching a composable node requires a common API for constructing a node.
One option is to mimic ROS 1 nodelets which required a default constructor on the node and had an init() member function to initialize the nodes with parameters.
Another option is having a constructor with one argument and and a factory class to call it.
Regardless this task should require ros2/rclcpp#492 so there is one object NodeArguments/NodeOptions so new arguments to a node don't require changing the signature of a function.

CMake API

This ticket includes creating a CMake API for creating a composable node. This API should

  • call add_library(... SHARED ..)
  • optionally add_executable() with a generated main()
  • register the composable node with pluginlib
@hidmic
Copy link
Contributor

hidmic commented Apr 30, 2019

@sloretz @mjcarroll can we close this one?

@mjcarroll
Copy link
Member

Yup, I believe so.

@sloretz sloretz closed this as completed Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants