@@ -195,7 +195,7 @@ def check_rtps_id_uniqueness(classifier):
195
195
{msg_dir }, px_generate_uorb_topic_files .INCL_DEFAULT , package )
196
196
197
197
# Agent files output path
198
- agent_out_dir = os .path .abspath (args .agentdir )
198
+ agent_out_dir = os .path .abspath (args .agentdir )
199
199
200
200
# Client files output path
201
201
client_out_dir = os .path .abspath (args .clientdir )
@@ -250,15 +250,15 @@ def check_rtps_id_uniqueness(classifier):
250
250
shutil .rmtree (os .path .join (agent_out_dir , "idl" ))
251
251
252
252
# 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 )
254
254
else os .path .join (msg_dir , args .uorb_templates ))
255
255
256
256
# 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 )
258
258
else os .path .join (msg_dir , args .urtps_templates ))
259
259
260
260
# 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 )
262
262
else Classifier (os .path .join (msg_dir , args .yaml_file ), msg_dir ))
263
263
264
264
# check if there are no ID's repeated
@@ -322,12 +322,17 @@ def generate_agent(out_dir):
322
322
os .chdir (os .path .join (out_dir , "fastrtpsgen" ))
323
323
if not glob .glob (os .path .join (idl_dir , "*.idl" )):
324
324
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
+
331
336
rm_wildcard (os .path .join (out_dir , "fastrtpsgen/*PubSubMain*" ))
332
337
rm_wildcard (os .path .join (out_dir , "fastrtpsgen/makefile*" ))
333
338
rm_wildcard (os .path .join (out_dir , "fastrtpsgen/*Publisher*" ))
0 commit comments