Cannot parse IDL file with array of strings typedef
Your Environment
Thank you for taking the time to report an issue.
To more efficiently resolve this issue, we'd like to know some basic information about your system and setup.
-
Your operating system: Ubuntu 20.04
-
Version of python you are running (
python --version
): 3.8.10 -
How did you install rosbags? Did you use pip to install from PyPI or a repository checkout or something else? pip
-
Version of rosbags you have installed (
pip show rosbags | grep Version
): 0.9.12
If you're having issues with (de)serialization of custom message types please include a copy of the following:
- Message definition files (msg or idl):
module test_msgs {
module msg {
typedef string string__3[3];
struct Arrays {
string__3 string_values;
}
}
}
- Error reported by
rosbags
:
Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/rosbags/typesys/base.py", line 69, in parse_message_definition assert npos == len(text), f'Could not parse: {text!r}' AssertionError: Could not parse: 'module test_msgs {\n module msg {\n typedef string string__3[3];\n struct Arrays {\n string__3 string_values;\n }\n }\n}'
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/opt/ApexOS/lib/python3.8/site-packages/rosbag2_parser/utils.py", line 60, in add_custom_types add_types.update(add_msgs_in_dir(submsg_dir_path, submsg_name)) File "/opt/ApexOS/lib/python3.8/site-packages/rosbag2_parser/utils.py", line 33, in add_msgs_in_dir new_msg_types.update(get_types_from_idl(msgdef)) File "/usr/local/lib/python3.8/dist-packages/rosbags/typesys/idl.py", line 601, in get_types_from_idl return parse_message_definition(VisitorIDL(), text) File "/usr/local/lib/python3.8/dist-packages/rosbags/typesys/base.py", line 72, in parse_message_definition raise TypesysError(f'Could not parse: {text!r}') from err rosbags.typesys.base.TypesysError: Could not parse: 'module test_msgs {\n module msg {\n typedef string string__3[3];\n struct Arrays {\n string__3 string_values;\n }\n }\n}'
The Issue
rosbags
cannot parse an IDL file that has a typedef array of strings.
Steps to Reproduce
- Install
rosbags
- Try and add custom msg type using example msg shown above with array of strings