Skip to content
Snippets Groups Projects
Commit c53c035e authored by TSC21's avatar TSC21 Committed by Beat Küng
Browse files

px_generate_uorb_topic_files: add check and throw error if no timestamp field exists

parent a1ac34d3
No related branches found
No related tags found
No related merge requests found
......@@ -118,6 +118,14 @@ def generate_output_from_file(format_idx, filename, outputdir, templatedir, incl
msg_context = genmsg.msg_loader.MsgContext.create_default()
full_type_name = genmsg.gentools.compute_full_type_name(PACKAGE, os.path.basename(filename))
spec = genmsg.msg_loader.load_msg_from_file(msg_context, filename, full_type_name)
field_name_list = []
for field in spec.parsed_fields():
field_name_list.append(field.name)
try:
assert 'timestamp' in field_name_list
except AssertionError:
print("[ERROR] uORB topic files generator:\n\tgenerate_output_from_file:\tNo 'timestamp' field found in " + spec.short_name + " msg definition!")
exit(1)
topics = get_multi_topics(filename)
if includepath:
search_path = genmsg.command_line.includepath_to_dict(includepath)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment