Skip to content

ros2interface can't show IDL messages #780

Description

@esteve

Bug report

Required Info:

  • Operating System:

    • Ubuntu 22.041 LTS
  • Installation type:

    • Source for ros2cli, but binaries for the rest of ROS,
  • Version or commit hash:

  • DDS implementation:

    • FastDDS
  • Client library (if applicable):

    • N/A

Steps to reproduce issue

$ ros2 interface list -m
Messages:
    action_msgs/msg/GoalInfo
    action_msgs/msg/GoalStatus
    action_msgs/msg/GoalStatusArray
    actionlib_msgs/msg/GoalID
    actionlib_msgs/msg/GoalStatus
    actionlib_msgs/msg/GoalStatusArray
    autoware_auto_control_msgs/msg/AckermannControlCommand
    autoware_auto_control_msgs/msg/AckermannLateralCommand
    autoware_auto_control_msgs/msg/HighLevelControlCommand
    autoware_auto_control_msgs/msg/LongitudinalCommand
    autoware_auto_debug_msgs/msg/BoolStamped
    autoware_auto_debug_msgs/msg/Float32MultiArrayStamped
    autoware_auto_debug_msgs/msg/Float32Stamped
    autoware_auto_debug_msgs/msg/Float64MultiArrayStamped
    autoware_auto_debug_msgs/msg/Float64Stamped
    autoware_auto_debug_msgs/msg/Int32MultiArrayStamped
    autoware_auto_debug_msgs/msg/Int32Stamped
    autoware_auto_debug_msgs/msg/Int64MultiArrayStamped
    autoware_auto_debug_msgs/msg/Int64Stamped
    autoware_auto_debug_msgs/msg/MultiArrayDimension
    autoware_auto_debug_msgs/msg/MultiArrayLayout
    autoware_auto_debug_msgs/msg/StringStamped
...
  • Show one of the IDL messages
$ ros2 interface show autoware_auto_control_msgs/msg/AckermannControlCommand

Expected behavior

ros2 interface show will show the message

Actual behavior

ros2 interface show throws an exception because it can't parse IDL messages:

$ ros2 interface show autoware_auto_control_msgs/msg/AckermannControlCommand
#include "autoware_auto_control_msgs/msg/AckermannLateralCommand.idl"
#include "autoware_auto_control_msgs/msg/LongitudinalCommand.idl"
#include "builtin_interfaces/msg/Time.idl"

Error processing 'module autoware_auto_control_msgs {' of 'autoware_auto_control_msgs/AckermannControlCommand': ''module' is an invalid message name. It should have the pattern '^[A-Z][A-Za-z0-9]*$''
Traceback (most recent call last):
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/ros2cli/bin/ros2", line 33, in <module>
    sys.exit(load_entry_point('ros2cli==0.21.0', 'console_scripts', 'ros2')())
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/ros2cli/lib/python3.10/site-packages/ros2cli/cli.py", line 89, in main
    rc = extension.main(parser=parser, args=args)
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/ros2interface/lib/python3.10/site-packages/ros2interface/command/interface.py", line 35, in main
    return extension.main(args=args)
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/ros2interface/lib/python3.10/site-packages/ros2interface/verb/show.py", line 201, in main
    _show_interface(
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/ros2interface/lib/python3.10/site-packages/ros2interface/verb/show.py", line 148, in _show_interface
    for line in _get_interface_lines(interface_identifier):
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/ros2interface/lib/python3.10/site-packages/ros2interface/verb/show.py", line 116, in _get_interface_lines
    yield InterfaceTextLine(
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/ros2interface/lib/python3.10/site-packages/ros2interface/verb/show.py", line 43, in __init__
    msg_spec = parse_message_string(
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/rosidl_adapter/local/lib/python3.10/dist-packages/rosidl_adapter/parser.py", line 520, in parse_message_string
    Type(type_string, context_package_name=pkg_name),
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/rosidl_adapter/local/lib/python3.10/dist-packages/rosidl_adapter/parser.py", line 277, in __init__
    super(Type, self).__init__(
  File "/home/esteve/Projects/tier4/ros2cli_ws/install/rosidl_adapter/local/lib/python3.10/dist-packages/rosidl_adapter/parser.py", line 205, in __init__
    raise InvalidResourceName(
rosidl_adapter.parser.InvalidResourceName: 'module' is an invalid message name. It should have the pattern '^[A-Z][A-Za-z0-9]*$'

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions