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

Launch error in tf2 tutorial: AttributeError: 'ellipsis' object has no attribute 'describe_sub_entities'

asked 2022-08-03 13:40:45 -0500

RocaPiedra gravatar image

Hi,

I've just been going through the tf2 tutorial for ros2 foxy and I'm having a lot of trouble with the launch files (and I'm just copy/pasting the files as they come in the tutorial), they throw this error:


/dev_ws# ros2 launch learning_tf2_py turtle_tf2_demo.launch.py Task exception was never retrieved future: <task finished="" name="Task-2" coro="&lt;LaunchService._process_one_event()" done,="" defined="" at="" opt="" ros="" foxy="" lib="" python3.8="" site-packages="" launch="" launch_service.py:226=""> exception=AttributeError("'ellipsis' 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 228, in _process_one_event await self.__process_event(next_event) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, 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 145, 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: 'ellipsis' object has no attribute 'describe_sub_entities'


I've verified that the error is not related to my installation as same thing happens in a docker container. I'm kind of in a hurry, do you have any clue what's going on? the launch file is:


from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration

from launch_ros.actions import Node

def generate_launch_description():
    return LaunchDescription([
        ...,
        DeclareLaunchArgument(
            'target_frame', default_value='turtle1',
            description='Target frame name.'
        ),
        Node(
            package='learning_tf2_py',
            executable='turtle_tf2_broadcaster',
            name='broadcaster2',
            parameters=[
                {'turtlename': 'turtle2'}
            ]
        ),
        Node(
            package='learning_tf2_py',
            executable='turtle_tf2_listener',
            name='listener',
            parameters=[
                {'target_frame': LaunchConfiguration('target_frame')}
            ]
        ),
    ])


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-08-03 13:52:59 -0500

RocaPiedra gravatar image

Wow that was very dumb from me...

The issue is that I'm not reading what I'm copying and the error threw me off, there are some dots at the beginning of the return that must be causing the failure, when I copied the file from geometry_tutorials it had some additional nodes declared and not those ..., I'll let this shameful question over here just in case someone else has the same issue.

The proper files are in geometry_tutorials, and the correct launch file would be:

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration

from launch_ros.actions import Node


def generate_launch_description():
    return LaunchDescription([
        DeclareLaunchArgument(
            'target_frame', default_value='turtle1',
            description='Target frame name.'
        ),
        Node(
            package='turtlesim',
            executable='turtlesim_node',
            name='sim'
        ),
        Node(
            package='turtle_tf2_py',
            executable='turtle_tf2_broadcaster',
            name='broadcaster1',
            parameters=[
                {'turtlename': 'turtle1'}
            ]
        ),
        Node(
            package='turtle_tf2_py',
            executable='turtle_tf2_broadcaster',
            name='broadcaster2',
            parameters=[
                {'turtlename': 'turtle2'}
            ]
        ),
        Node(
            package='turtle_tf2_py',
            executable='turtle_tf2_listener',
            name='listener',
            parameters=[
                {'target_frame': LaunchConfiguration('target_frame')}
            ]
        ),
    ])
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-08-03 13:40:45 -0500

Seen: 270 times

Last updated: Aug 03 '22