diff --git a/mros2_header_generator/msg_data_generator.py b/mros2_header_generator/msg_data_generator.py index 13f64a9..01a2370 100644 --- a/mros2_header_generator/msg_data_generator.py +++ b/mros2_header_generator/msg_data_generator.py @@ -13,7 +13,7 @@ def msgDataGenerator(line): msgDef.append(msgDefGenerator(m_line, dependingFileNames)) lineArr = line.strip().split('/') - lineArr[2] = lineArr[2].rstrip('.msg') + lineArr[2] = os.path.splitext(lineArr[2])[0] return { 'name': lineArr[2], 'pkg': lineArr[0], @@ -23,4 +23,4 @@ def msgDataGenerator(line): 'dependingFileNames': dependingFileNames, } else: - raise Exception('msg header file "' + line + '" not found.') \ No newline at end of file + raise Exception('msg header file "' + line + '" not found.')