Skip to content

Show launch argument names in print-description output - #999

Open
official-burak wants to merge 1 commit into
ros2:rollingfrom
official-burak:print-description-argument-names
Open

Show launch argument names in print-description output#999
official-burak wants to merge 1 commit into
ros2:rollingfrom
official-burak:print-description-argument-names

Conversation

@official-burak

@official-burak official-burak commented Aug 25, 2026

Copy link
Copy Markdown

Changelog

  • Make --print-description show DeclareLaunchArgument names, defaults, and descriptions
  • Identify OpaqueFunction by the wrapped callable
  • Label LaunchDescription with its entity count

Description

Fixes #975

LaunchIntrospector.format_launch_description (what ros2 launch --print-description uses) fell through to Action('<... object at 0x...>') for most actions. Declared arguments therefore printed an address instead of the argument name.

Give those actions a useful __repr__ (Action.describe() already returns that) and use describe() in the introspector fallback.

Test evidence

Before:

<launch.launch_description.LaunchDescription object at 0x...>
└── Action('<launch.actions.declare_launch_argument.DeclareLaunchArgument object at 0x...>')

After:

LaunchDescription(1 entity)
└── DeclareLaunchArgument(name='use_sim_time', default_value='false', description='Use simulation clock')

pytest test/launch/test_launch_introspector.py test/launch/actions/test_declare_launch_argument.py failed first (missing use_sim_time / generate_nodes in the tree), then passed after the change (10 passed).

--print-description currently renders DeclareLaunchArgument and
OpaqueFunction with the default object repr, so operators only see
addresses instead of argument names or the wrapped callable.

Signed-off-by: Burak Keskin <official.burak@icloud.com>
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

Successfully merging this pull request may close these issues.

--print-description option shows unhelpful output

1 participant