Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 110a793

Browse files
TSC21LorenzMeier
authored andcommitted
microRTPS bridge generation: improve fastrtpsgen verbosity
1 parent 3536c9d commit 110a793

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

msg/tools/generate_microRTPS_bridge.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def check_rtps_id_uniqueness(classifier):
195195
{msg_dir}, px_generate_uorb_topic_files.INCL_DEFAULT, package)
196196

197197
# Agent files output path
198-
agent_out_dir = os.path.abspath(args.agentdir)
198+
agent_out_dir = os.path.abspath(args.agentdir)
199199

200200
# Client files output path
201201
client_out_dir = os.path.abspath(args.clientdir)
@@ -250,15 +250,15 @@ def check_rtps_id_uniqueness(classifier):
250250
shutil.rmtree(os.path.join(agent_out_dir, "idl"))
251251

252252
# uORB templates path
253-
uorb_templates_dir = (args.uorb_templates if os.path.isabs(args.uorb_templates) \
253+
uorb_templates_dir = (args.uorb_templates if os.path.isabs(args.uorb_templates)
254254
else os.path.join(msg_dir, args.uorb_templates))
255255

256256
# uRTPS templates path
257-
urtps_templates_dir = (args.urtps_templates if os.path.isabs(args.urtps_templates) \
257+
urtps_templates_dir = (args.urtps_templates if os.path.isabs(args.urtps_templates)
258258
else os.path.join(msg_dir, args.urtps_templates))
259259

260260
# parse yaml file into a map of ids
261-
classifier = (Classifier(os.path.abspath(args.yaml_file), msg_dir) if os.path.isabs(args.yaml_file) \
261+
classifier = (Classifier(os.path.abspath(args.yaml_file), msg_dir) if os.path.isabs(args.yaml_file)
262262
else Classifier(os.path.join(msg_dir, args.yaml_file), msg_dir))
263263

264264
# check if there are no ID's repeated
@@ -322,12 +322,17 @@ def generate_agent(out_dir):
322322
os.chdir(os.path.join(out_dir, "fastrtpsgen"))
323323
if not glob.glob(os.path.join(idl_dir, "*.idl")):
324324
raise Exception("No IDL files found in %s" % idl_dir)
325-
for idl_file in glob.glob(os.path.join(idl_dir, "*.idl")):
326-
ret = subprocess.call(fastrtpsgen_path + " -d " + out_dir +
327-
"/fastrtpsgen -example x64Linux2.6gcc " + fastrtpsgen_include + idl_file, shell=True)
328-
if ret:
329-
raise Exception(
330-
"fastrtpsgen not found. Specify the location of fastrtpsgen with the -f flag")
325+
if(os.path.exists(fastrtpsgen_path)):
326+
for idl_file in glob.glob(os.path.join(idl_dir, "*.idl")):
327+
ret = subprocess.call(fastrtpsgen_path + " -d " + out_dir +
328+
"/fastrtpsgen -example x64Linux2.6gcc " + fastrtpsgen_include + idl_file, shell=True)
329+
if ret:
330+
raise Exception(
331+
"fastrtpsgen failed with code error %s" % ret)
332+
else:
333+
raise Exception(
334+
"fastrtpsgen not found. Specify the location of fastrtpsgen with the -f flag")
335+
331336
rm_wildcard(os.path.join(out_dir, "fastrtpsgen/*PubSubMain*"))
332337
rm_wildcard(os.path.join(out_dir, "fastrtpsgen/makefile*"))
333338
rm_wildcard(os.path.join(out_dir, "fastrtpsgen/*Publisher*"))

0 commit comments

Comments
 (0)