Skip to content

Commit c9103f3

Browse files
committed
Ignore @key annotations
1 parent c70c86c commit c9103f3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rosidl_convertor/idl_convertor.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ def __init__(self):
106106
self.current_module = ""
107107
self.typedefs = {} # Store typedef declarations
108108

109+
def _contains_key_annotations(self, content: str) -> bool:
110+
"""Check if IDL content contains @key annotations (not supported in ROS2 .msg)"""
111+
return '@key' in content
112+
109113
def parse_file(self, idl_file_path: str) -> List[IdlInterface]:
110114
"""Parse an IDL file and return list of interfaces"""
111115
with open(idl_file_path, 'r') as f:
@@ -117,6 +121,11 @@ def parse_content(self, content: str, file_path: str = "") -> List[IdlInterface]
117121
"""Parse IDL content string"""
118122
interfaces = []
119123

124+
# Check for unsupported features
125+
if self._contains_key_annotations(content):
126+
print(f"Warning: Skipping {file_path} - contains @key annotations which are not supported in ROS2 .msg files")
127+
return interfaces
128+
120129
# Extract modules and their contents BEFORE preprocessing (to preserve @verbatim)
121130
modules = self._extract_modules(content)
122131

0 commit comments

Comments
 (0)