launch component into existing container
I want to launch a component into an existing container. Can anybody help me with this error?
As far as I can see, my code is identical with image_pipeline/stereo_image_proc/launch/stereo_image_proc.launch.py , which uses LoadComposableNodes too. However, the foxy branch does not contain this action anymore. Is it maybe deprecated in foxy? Is there an alternative?
When I run a container in bash#0 with
ros2 run rclcpp_components component_container
and then execute the following launch file in bash#1:
#!/usr/bin/python3
import launch
import launch.actions
import launch.substitutions
from launch_ros.descriptions import ComposableNode
from launch_ros.actions import LoadComposableNodes
def generate_launch_description():
ld = launch.LaunchDescription()
comp_node = ComposableNode(
package="composition",
plugin="composition::Talker",
name='compose_name',
namespace='compose_namespace',
parameters=[],
remappings=[],
)
load_component = LoadComposableNodes(
composable_node_descriptions=[comp_node],
target_container='/ComponentManager'),
ld.add_action(load_component)
return ld
I get the following error:
ros2 launch src/my_package/launch/test.launch.py
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2021-05-11-21-28-08-187318-ROS_WS-2144061
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:274> exception=AttributeError("'tuple' object has no attribute 'describe_sub_entities'")>
Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 276, in _process_one_event
await self.__process_event(next_event)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 296, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
return self.execute(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/include_launch_description.py", line 140, in execute
declared_launch_arguments = launch_description.get_launch_arguments()
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description.py", line 126, in get_launch_arguments
process_entities(self.entities, _conditional_inclusion=conditional_inclusion)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description.py", line 120, in process_entities
entity.describe_sub_entities(), _conditional_inclusion=False)
AttributeError: 'tuple' object has no attribute 'describe_sub_entities'