microRTPS bridge generation: improve fastrtpsgen verbosity

This commit is contained in:
TSC21
2019-05-19 16:59:03 +01:00
committed by Lorenz Meier
parent 3536c9dddc
commit 110a7931e4
+8 -3
View File
@@ -250,15 +250,15 @@ if agent and os.path.isdir(os.path.join(agent_out_dir, "idl")):
shutil.rmtree(os.path.join(agent_out_dir, "idl")) shutil.rmtree(os.path.join(agent_out_dir, "idl"))
# uORB templates path # uORB templates path
uorb_templates_dir = (args.uorb_templates if os.path.isabs(args.uorb_templates) \ uorb_templates_dir = (args.uorb_templates if os.path.isabs(args.uorb_templates)
else os.path.join(msg_dir, args.uorb_templates)) else os.path.join(msg_dir, args.uorb_templates))
# uRTPS templates path # uRTPS templates path
urtps_templates_dir = (args.urtps_templates if os.path.isabs(args.urtps_templates) \ urtps_templates_dir = (args.urtps_templates if os.path.isabs(args.urtps_templates)
else os.path.join(msg_dir, args.urtps_templates)) else os.path.join(msg_dir, args.urtps_templates))
# parse yaml file into a map of ids # parse yaml file into a map of ids
classifier = (Classifier(os.path.abspath(args.yaml_file), msg_dir) if os.path.isabs(args.yaml_file) \ classifier = (Classifier(os.path.abspath(args.yaml_file), msg_dir) if os.path.isabs(args.yaml_file)
else Classifier(os.path.join(msg_dir, args.yaml_file), msg_dir)) else Classifier(os.path.join(msg_dir, args.yaml_file), msg_dir))
# check if there are no ID's repeated # check if there are no ID's repeated
@@ -322,12 +322,17 @@ def generate_agent(out_dir):
os.chdir(os.path.join(out_dir, "fastrtpsgen")) os.chdir(os.path.join(out_dir, "fastrtpsgen"))
if not glob.glob(os.path.join(idl_dir, "*.idl")): if not glob.glob(os.path.join(idl_dir, "*.idl")):
raise Exception("No IDL files found in %s" % idl_dir) raise Exception("No IDL files found in %s" % idl_dir)
if(os.path.exists(fastrtpsgen_path)):
for idl_file in glob.glob(os.path.join(idl_dir, "*.idl")): for idl_file in glob.glob(os.path.join(idl_dir, "*.idl")):
ret = subprocess.call(fastrtpsgen_path + " -d " + out_dir + ret = subprocess.call(fastrtpsgen_path + " -d " + out_dir +
"/fastrtpsgen -example x64Linux2.6gcc " + fastrtpsgen_include + idl_file, shell=True) "/fastrtpsgen -example x64Linux2.6gcc " + fastrtpsgen_include + idl_file, shell=True)
if ret: if ret:
raise Exception(
"fastrtpsgen failed with code error %s" % ret)
else:
raise Exception( raise Exception(
"fastrtpsgen not found. Specify the location of fastrtpsgen with the -f flag") "fastrtpsgen not found. Specify the location of fastrtpsgen with the -f flag")
rm_wildcard(os.path.join(out_dir, "fastrtpsgen/*PubSubMain*")) rm_wildcard(os.path.join(out_dir, "fastrtpsgen/*PubSubMain*"))
rm_wildcard(os.path.join(out_dir, "fastrtpsgen/makefile*")) rm_wildcard(os.path.join(out_dir, "fastrtpsgen/makefile*"))
rm_wildcard(os.path.join(out_dir, "fastrtpsgen/*Publisher*")) rm_wildcard(os.path.join(out_dir, "fastrtpsgen/*Publisher*"))