From 4609949bbb6e89d1795c38f2aef65582bcb28598 Mon Sep 17 00:00:00 2001 From: TSC21 Date: Sat, 17 Jul 2021 17:32:29 +0200 Subject: [PATCH] microRTPS: generate_microRTPS_bridge: only run the generator for the topics that are actually marked to be used --- msg/tools/generate_microRTPS_bridge.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/msg/tools/generate_microRTPS_bridge.py b/msg/tools/generate_microRTPS_bridge.py index ad3466960e..147989b684 100644 --- a/msg/tools/generate_microRTPS_bridge.py +++ b/msg/tools/generate_microRTPS_bridge.py @@ -358,11 +358,14 @@ def generate_agent(out_dir): gen_ros2_typename = "-typeros2 " for idl_file in glob.glob(os.path.join(idl_dir, "*.idl")): - try: - ret = subprocess.check_call(fastrtpsgen_path + " -d " + out_dir + - "/fastrtpsgen -example x64Linux2.6gcc " + gen_ros2_typename + fastrtpsgen_include + idl_file, shell=True) - except OSError: - raise + # 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: + ret = subprocess.check_call(fastrtpsgen_path + " -d " + out_dir + + "/fastrtpsgen -example x64Linux2.6gcc " + gen_ros2_typename + fastrtpsgen_include + idl_file, shell=True) + except OSError: + raise rm_wildcard(os.path.join(out_dir, "fastrtpsgen/*PubSubMain*")) rm_wildcard(os.path.join(out_dir, "fastrtpsgen/makefile*"))