Robotics StackExchange | Archived questions

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

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:


/devws# ros2 launch learningtf2py turtletf2demo.launch.py [INFO] [launch]: All log files can be found below /root/.ros/log/2022-08-03-18-29-24-875095-7fee628f4b5c-152 [INFO] [launch]: Default logging verbosity is set to INFO Task exception was never retrieved future: <Task finished name='Task-2' coro=<LaunchService.processoneevent() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launchservice.py:226> exception=AttributeError("'ellipsis' object has no attribute 'describesubentities'")> Traceback (most recent call last): File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchservice.py", line 228, in processoneevent await self.processevent(nextevent) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchservice.py", line 248, in processevent visitallentitiesandcollectfutures(entity, self.context)) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visitallentitiesandcollectfuturesimpl.py", line 45, in visitallentitiesandcollectfutures futurestoreturn += visitallentitiesandcollectfutures(subentity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visitallentitiesandcollectfuturesimpl.py", line 45, in visitallentitiesandcollectfutures futurestoreturn += visitallentitiesandcollectfutures(subentity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visitallentitiesandcollectfuturesimpl.py", line 38, in visitallentitiesandcollectfutures subentities = 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/includelaunchdescription.py", line 145, in execute declaredlauncharguments = launchdescription.getlauncharguments() File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchdescription.py", line 126, in getlauncharguments processentities(self.entities, _conditionalinclusion=conditionalinclusion) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchdescription.py", line 120, in processentities entity.describesubentities(), _conditionalinclusion=False) AttributeError: 'ellipsis' object has no attribute 'describesubentities'


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')}
            ]
        ),
    ])


Asked by RocaPiedra on 2022-08-03 13:40:45 UTC

Comments

Answers

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')}
            ]
        ),
    ])

Asked by RocaPiedra on 2022-08-03 13:52:59 UTC

Comments