ros2interface can't show IDL messages
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 262
- Forks
- 228
- Avg merge
- 23h 15m
- Merged PRs (30d)
- 12
Description
Bug report
Required Info:
-
Operating System:
- Ubuntu 22.041 LTS
-
Installation type:
- Source for
ros2cli, but binaries for the rest of ROS,
- Source for
-
Version or commit hash:
- f6fc61accff8b9648408053fb66b936839fe449d
-
DDS implementation:
- FastDDS
-
Client library (if applicable):
- N/A
Steps to reproduce issue
- Have a package that contains messages in .IDL format in a workspace (e.g. https://gitlab.com/autowarefoundation/autoware.auto/autoware_auto_msgs/-/tree/master/)
- Source the workspace
- The messages show in
ros2 interface list
$ 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ros2interface/verb/show.py, especially _get_interface_lines and _show_interface, then inspect the rosidl_adapter/parser.py traceback path for IDL handling. Reproduce with ros2 interface show autoware_auto_control_msgs/msg/AckermannControlCommand in a workspace containing the referenced IDL messages. Done means the command displays the IDL message without the parsing exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100