microRTPS: generate_microRTPS_bridge: only run the generator for the topics that are actually marked to be used

This commit is contained in:
TSC21
2021-07-17 17:32:29 +02:00
committed by Nuno Marques
parent 695e1fa574
commit 4609949bbb
+3
View File
@@ -358,6 +358,9 @@ def generate_agent(out_dir):
gen_ros2_typename = "-typeros2 " gen_ros2_typename = "-typeros2 "
for idl_file in glob.glob(os.path.join(idl_dir, "*.idl")): for idl_file in glob.glob(os.path.join(idl_dir, "*.idl")):
# Only run the generator for the topics that are actually marked to be
# used by the bridge
if os.path.splitext(os.path.basename(idl_file))[0] in classifier.msg_id_map:
try: try:
ret = subprocess.check_call(fastrtpsgen_path + " -d " + out_dir + ret = subprocess.check_call(fastrtpsgen_path + " -d " + out_dir +
"/fastrtpsgen -example x64Linux2.6gcc " + gen_ros2_typename + fastrtpsgen_include + idl_file, shell=True) "/fastrtpsgen -example x64Linux2.6gcc " + gen_ros2_typename + fastrtpsgen_include + idl_file, shell=True)