From f020c0502d5a61239a72f3c43f36142ea42c0537 Mon Sep 17 00:00:00 2001 From: Eshan Date: Thu, 16 Apr 2026 22:50:00 +0200 Subject: [PATCH 1/4] match updated .ros2 model def --- rossdl_cmake/rossdl_cmake/__init__.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/rossdl_cmake/rossdl_cmake/__init__.py b/rossdl_cmake/rossdl_cmake/__init__.py index 89525a6..aa61553 100644 --- a/rossdl_cmake/rossdl_cmake/__init__.py +++ b/rossdl_cmake/rossdl_cmake/__init__.py @@ -51,15 +51,15 @@ def get_publishers_name_type_from_node(package, arfifacts, node): def get_qos_from_data(data): ret = '' - if 'qos_history_depth' in data: - ret = 'rclcpp::QoS(' + str(data['qos_history_depth']) + ')' - if 'qos_profile' in data: - if data['qos_profile'] == 'sensor_qos': + if 'depth' in data: + ret = 'rclcpp::QoS(' + str(data['depth']) + ')' + if 'profile' in data: + if data['profile'] == 'sensor_qos': ret = 'rclcpp::SensorDataQoS()' - if 'qos_reliability' in data: - if data['qos_reliability'] == 'reliable': + if 'reliability' in data: + if data['reliability'] == 'reliable': ret = ret + '.reliable()' - elif data['qos_reliability'] == 'best effort': + elif data['reliability'] == 'best_effort': ret = ret + '.BestEffort()' # Here we need to comple all the options return ret @@ -133,10 +133,10 @@ def get_message_header_from_type(msg_type): def to_cpp_type(ptype): - if ptype == 'string': + if ptype == 'String': return 'std::string' - elif ptype == 'float': - return 'float' + elif ptype == 'Double': + return 'double' # Here we need to comple all the options From e4a4b3d902a4642293445bc3b3ef86c19d08d245 Mon Sep 17 00:00:00 2001 From: Eshan Date: Thu, 16 Apr 2026 22:53:01 +0200 Subject: [PATCH 2/4] update system gen to match new .rossystem model --- rossdl_cmake/resources/launcher.py.em | 2 +- rossdl_cmake/rossdl_cmake/__init__.py | 64 ++++++++++++++++----------- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/rossdl_cmake/resources/launcher.py.em b/rossdl_cmake/resources/launcher.py.em index ea2a484..f6fbaa4 100644 --- a/rossdl_cmake/resources/launcher.py.em +++ b/rossdl_cmake/resources/launcher.py.em @@ -14,7 +14,7 @@ package_name = locals()['package'] systems_data = locals()['systems_data'] arfifacts = locals()['artifacts'] -system_info = systems_data[package_name]['systems'][system_name] +system_info = systems_data[package_name] expand_subsystems(system_info, systems_data) diff --git a/rossdl_cmake/rossdl_cmake/__init__.py b/rossdl_cmake/rossdl_cmake/__init__.py index aa61553..894a194 100644 --- a/rossdl_cmake/rossdl_cmake/__init__.py +++ b/rossdl_cmake/rossdl_cmake/__init__.py @@ -244,30 +244,50 @@ def generate_file(package, artifacts_file, file_in, file_out): def get_system_remappings(system_info, arfifacts): - connections = system_info['connections'] + connections = system_info.get('connections', []) all_arfifacts = {} for system in arfifacts.keys(): all_arfifacts.update(arfifacts[system]['artifacts']) + + all_interfaces = {} + nodes_info = system_info.get('nodes', {}) + if isinstance(nodes_info, dict): + for node_data in nodes_info.values(): + if 'interfaces' in node_data: + for interface in node_data['interfaces']: + for alias, full_name in interface.items(): + if '->' not in full_name: + continue + _, full_topic = full_name.split('->', 1) + full_topic = full_topic.strip().strip('"') + + if '::' not in full_topic: + continue + node, topic = full_topic.split('::', 1) + all_interfaces[alias] = { + 'node': node, + 'topic': topic, + } remappings = {} for connection in connections: - origin = connection[0].split('/')[1] - destiny = connection[1].split('/')[1] + origin = all_interfaces[connection[0]]['node'] + destiny = all_interfaces[connection[1]]['node'] if origin in list(all_arfifacts.keys()): if origin not in remappings.keys(): remappings[origin] = [] - remappings[origin].append((connection[0], connection[1])) + remappings[origin].append((all_interfaces[connection[0]]['topic'], connection[0])) elif destiny in list(all_arfifacts.keys()): if destiny not in remappings.keys(): remappings[destiny] = [] - remappings[destiny].append((connection[1], connection[0])) + remappings[destiny].append((all_interfaces[connection[1]]['topic'], connection[1])) return remappings def get_system_parameters(system_info, arfifacts): - parameters = system_info['parameters'] + parameters = [node['parameters'] for node in system_info['nodes'].values() if 'parameters' in node] all_arfifacts = {} for system in arfifacts.keys(): @@ -275,17 +295,9 @@ def get_system_parameters(system_info, arfifacts): parameters_ret = {} for parameter in parameters: - parameter_name = parameter[0].split('/')[2] - node_name = parameter[0].split('/')[1] - value = parameter[1] - - if node_name == '*': - for node in list(all_arfifacts.keys()): - if node not in parameters_ret.keys(): - parameters_ret[node] = [] - if (parameter_name, value) not in parameters_ret[node]: - parameters_ret[node].append((parameter_name, value)) - else: + for parameter in parameters: + value = parameter[0].get("value") + node_name, parameter_name = list(parameter[0].values())[0].split("::") if node_name not in parameters_ret.keys(): parameters_ret[node_name] = [] parameters_ret[node_name].append((parameter_name, value)) @@ -296,10 +308,10 @@ def get_system_parameters(system_info, arfifacts): def get_system_nodes(system_info): node_names = system_info['nodes'] ret = [] - for node in node_names: - pkg = node.split('::')[0] - class_name = get_class_names_from_node(node.split('::')[1]) - ret.append((node.split('::')[1], pkg + '::' + class_name)) + for node in node_names.values(): + pkg = node['from'].strip('"').split('.')[0] + class_name = get_class_names_from_node(node['from'].strip('"').split('.')[1]) + ret.append((node['from'].split('.')[1], pkg + '::' + class_name)) return ret @@ -376,16 +388,16 @@ def expand_subsystems(system_info, systems_data): return for subsystem in system_info['subsystems']: - package = subsystem.split('::')[0] - system = subsystem.split('::')[1] + # package = subsystem.split('::')[0] + # system = subsystem.split('::')[1] - subsystem_info = systems_data[package]['systems'][system] + subsystem_info = systems_data[subsystem] if 'subsystems' in list(subsystem_info.keys()): expand_subsystems(subsystem_info, systems_data) - system_info['nodes'].extend(subsystem_info['nodes']) + system_info['nodes'].update(subsystem_info['nodes']) system_info['connections'].extend(subsystem_info['connections']) - system_info['parameters'].extend(subsystem_info['parameters']) + # system_info['parameters'].extend(subsystem_info['parameters']) def get_data_resource(ids, resource): From d2c126dcc9e02655bd3296bafab0af739ccc4927 Mon Sep 17 00:00:00 2001 From: Eshan Date: Tue, 19 May 2026 09:56:30 +0200 Subject: [PATCH 3/4] fix remapping bug --- rossdl_cmake/resources/launcher.py.em | 2 +- rossdl_cmake/rossdl_cmake/__init__.py | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/rossdl_cmake/resources/launcher.py.em b/rossdl_cmake/resources/launcher.py.em index f6fbaa4..789365a 100644 --- a/rossdl_cmake/resources/launcher.py.em +++ b/rossdl_cmake/resources/launcher.py.em @@ -18,7 +18,7 @@ system_info = systems_data[package_name] expand_subsystems(system_info, systems_data) -remappings = get_system_remappings(system_info, arfifacts) +remappings = get_system_remappings(system_info, arfifacts, systems_data) parameters = get_system_parameters(system_info, arfifacts) }@ diff --git a/rossdl_cmake/rossdl_cmake/__init__.py b/rossdl_cmake/rossdl_cmake/__init__.py index 894a194..a61987f 100644 --- a/rossdl_cmake/rossdl_cmake/__init__.py +++ b/rossdl_cmake/rossdl_cmake/__init__.py @@ -243,15 +243,19 @@ def generate_file(package, artifacts_file, file_in, file_out): h.write(content) -def get_system_remappings(system_info, arfifacts): +def get_system_remappings(system_info, arfifacts, systems_data): connections = system_info.get('connections', []) all_arfifacts = {} + all_systems = {} for system in arfifacts.keys(): all_arfifacts.update(arfifacts[system]['artifacts']) - + for system in systems_data.keys(): + if 'nodes' in systems_data[system]: + all_systems.update(systems_data[system]['nodes']) all_interfaces = {} nodes_info = system_info.get('nodes', {}) + nodes_info.update(all_systems) if isinstance(nodes_info, dict): for node_data in nodes_info.values(): if 'interfaces' in node_data: @@ -279,7 +283,7 @@ def get_system_remappings(system_info, arfifacts): if origin not in remappings.keys(): remappings[origin] = [] remappings[origin].append((all_interfaces[connection[0]]['topic'], connection[0])) - elif destiny in list(all_arfifacts.keys()): + if destiny in list(all_arfifacts.keys()): if destiny not in remappings.keys(): remappings[destiny] = [] remappings[destiny].append((all_interfaces[connection[1]]['topic'], connection[1])) @@ -287,7 +291,10 @@ def get_system_remappings(system_info, arfifacts): def get_system_parameters(system_info, arfifacts): - parameters = [node['parameters'] for node in system_info['nodes'].values() if 'parameters' in node] + if 'nodes' not in system_info: + return {} + parameters = [node['parameters'] for node in system_info['nodes'].values() if + 'parameters' in node] all_arfifacts = {} for system in arfifacts.keys(): @@ -306,7 +313,7 @@ def get_system_parameters(system_info, arfifacts): def get_system_nodes(system_info): - node_names = system_info['nodes'] + node_names = system_info['nodes'] if 'nodes' in system_info else {} ret = [] for node in node_names.values(): pkg = node['from'].strip('"').split('.')[0] From f3f2e3d95c57fe8a04489c219d4cef4782794ad2 Mon Sep 17 00:00:00 2001 From: Eshan Date: Tue, 19 May 2026 09:56:45 +0200 Subject: [PATCH 4/4] rework testing for new model type --- .../test_rossdl.cpython-310-pytest-6.2.5.pyc | Bin 7054 -> 8924 bytes rossdl_cmake/tests/description.ros2 | 23 ++- rossdl_cmake/tests/description.rossystem | 40 ++--- rossdl_cmake/tests/system_1.launch.py.test | 10 +- rossdl_cmake/tests/test_rossdl.py | 141 +++++------------- .../rossdl_simple_test/CMakeLists.txt | 3 +- .../rossdl_simple_test/description.ros2 | 23 ++- .../rossdl_simple_test/description.rossystem | 43 +++--- .../application_1/CMakeLists.txt | 2 +- .../application_1/app_1.rossystem | 44 +++--- .../application_2/CMakeLists.txt | 2 +- .../application_2/app_2.rossystem | 27 ++-- .../application_3/CMakeLists.txt | 2 +- .../application_3/app_3.rossystem | 10 +- .../system_a/description.ros2 | 17 +-- .../system_a/description.rossystem | 22 ++- .../system_a/tests/rossdl_generation_test.cpp | 3 + .../system_b/description.ros2 | 7 +- .../system_b/tests/rossdl_generation_test.cpp | 3 + rossdl_tests/test_msgs.ros | 29 ++++ 20 files changed, 210 insertions(+), 241 deletions(-) create mode 100644 rossdl_tests/test_msgs.ros diff --git a/rossdl_cmake/tests/__pycache__/test_rossdl.cpython-310-pytest-6.2.5.pyc b/rossdl_cmake/tests/__pycache__/test_rossdl.cpython-310-pytest-6.2.5.pyc index 77006cda655cbc5ddfde81c2eeb0a932d09f4b33..bf356c753653050d8edf8b8771aaa98369ddcb58 100644 GIT binary patch literal 8924 zcmb_iOK;@H5$0=VI1jzwD@E3>pJUjPcLC?2EDR&N&f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fcC%2uVAFR{Bj4ESqvc=SwW5zYm2Q-kIlM?P}Ok*1?BTgFk$Ew`WD9xcR`CXli5 EFXlG0<^TWy diff --git a/rossdl_cmake/tests/description.ros2 b/rossdl_cmake/tests/description.ros2 index 9eb9f88..f78f8ca 100644 --- a/rossdl_cmake/tests/description.ros2 +++ b/rossdl_cmake/tests/description.ros2 @@ -1,44 +1,43 @@ ---- rossdl_test: fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" artifacts: image_filter: - node: "image_filter" + node: image_filter publishers: image_out: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" - qos_reliability: "reliable" + profile: sensor_qos + reliability: reliable description_out: type: "std_msgs/msg/String" qos: - qos_history_depth: 100 + depth: 100 subscribers: image_in: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" + profile: sensor_qos laser_in: type: "sensor_msgs/msg/LaserScan" qos: - qos_profile: "sensor_qos" - qos_reliability: "reliable" + profile: sensor_qos + reliability: reliable parameters: description_label: - type: string + type: String default: "default image" consumer: - node: "consumer" + node: consumer subscribers: image_in: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" + profile: sensor_qos description_in: type: "std_msgs/msg/String" publishers: image_out: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" + profile: sensor_qos diff --git a/rossdl_cmake/tests/description.rossystem b/rossdl_cmake/tests/description.rossystem index 6777363..2e1ad18 100644 --- a/rossdl_cmake/tests/description.rossystem +++ b/rossdl_cmake/tests/description.rossystem @@ -1,22 +1,22 @@ ---- rossdl_test: - fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" - systems: - system_1: - nodes: [rossdl_test::image_filter, rossdl_test::consumer] - connections: - - [/image_filter/image_out, /consumer/image_in] - - [/image_filter/description_out, /consumer/description_in] - - [/camera/rgb/image_raw, /image_filter/image_in] - - [/consumer/image_out, /other_node/image_in] + nodes: + image_filter: + from: "rossdl_test.image_filter" + interfaces: + - image_out: pub-> "image_filter::image_out" + - description_out: pub-> "image_filter::description_out" parameters: - - [/image_filter/description_label, 'image raw'] - - [/*/use_sim_time, True] - system_2: - nodes: [rossdl_test::image_filter, rossdl_test::consumer] - connections: - - [/image_filter/image_out, /consumer/image_in] - - [/image_filter/description_out, /consumer/description_in] - parameters: - - [/image_filter/description_label, 'image compressed'] - - [/*/use_sim_time, False] + - DescriptionLabel: "image_filter::description_label" + value: "image_raw" + consumer: + from: "rossdl_test.consumer" + interfaces: + - image_in: sub-> "consumer::image_in" + - description_in: sub-> "consumer::description_in" + connections: + - [ image_out, image_in ] + - [ description_out, description_in ] + processes: + process1: + nodes: [ image_filter, consumer ] + threads: 2 diff --git a/rossdl_cmake/tests/system_1.launch.py.test b/rossdl_cmake/tests/system_1.launch.py.test index a4b68e5..34b2564 100644 --- a/rossdl_cmake/tests/system_1.launch.py.test +++ b/rossdl_cmake/tests/system_1.launch.py.test @@ -42,13 +42,11 @@ def generate_launch_description(): plugin = 'rossdl_test::ImageFilter', name = 'image_filter', remappings = [ - ('/image_filter/image_out', '/consumer/image_in'), - ('/image_filter/description_out', '/consumer/description_in'), - ('/image_filter/image_in', '/camera/rgb/image_raw'), + ('image_out', 'image_out'), + ('description_out', 'description_out'), ], parameters=[{ 'description_label': 'image raw', - 'use_sim_time': True, }], ), ComposableNode( @@ -56,10 +54,10 @@ def generate_launch_description(): plugin = 'rossdl_test::Consumer', name = 'consumer', remappings = [ - ('/consumer/image_out', '/other_node/image_in'), + ('image_in', 'image_in'), + ('description_in', 'description_in'), ], parameters=[{ - 'use_sim_time': True, }], ), ]) diff --git a/rossdl_cmake/tests/test_rossdl.py b/rossdl_cmake/tests/test_rossdl.py index 8540c1e..bd39fb4 100644 --- a/rossdl_cmake/tests/test_rossdl.py +++ b/rossdl_cmake/tests/test_rossdl.py @@ -77,39 +77,39 @@ def test_read_description(self): self.assertEqual(image_filter_pubs['image_out']['type'], 'sensor_msgs/msg/Image') self.assertEqual(list(image_filter_pubs['image_out']['qos'].keys()), - ['qos_profile', 'qos_reliability']) - self.assertEqual(image_filter_pubs['image_out']['qos']['qos_profile'], 'sensor_qos') - self.assertEqual(image_filter_pubs['image_out']['qos']['qos_reliability'], 'reliable') + ['profile', 'reliability']) + self.assertEqual(image_filter_pubs['image_out']['qos']['profile'], 'sensor_qos') + self.assertEqual(image_filter_pubs['image_out']['qos']['reliability'], 'reliable') self.assertEqual(image_filter_pubs['description_out']['type'], 'std_msgs/msg/String') self.assertEqual(list(image_filter_pubs['description_out']['qos'].keys()), - ['qos_history_depth']) - self.assertEqual(image_filter_pubs['description_out']['qos']['qos_history_depth'], 100) + ['depth']) + self.assertEqual(image_filter_pubs['description_out']['qos']['depth'], 100) self.assertEqual(image_filter_subs['image_in']['type'], 'sensor_msgs/msg/Image') - self.assertEqual(list(image_filter_subs['image_in']['qos'].keys()), ['qos_profile']) - self.assertEqual(image_filter_subs['image_in']['qos']['qos_profile'], 'sensor_qos') + self.assertEqual(list(image_filter_subs['image_in']['qos'].keys()), ['profile']) + self.assertEqual(image_filter_subs['image_in']['qos']['profile'], 'sensor_qos') self.assertEqual(image_filter_subs['laser_in']['type'], 'sensor_msgs/msg/LaserScan') self.assertEqual(list(image_filter_subs['laser_in']['qos'].keys()), - ['qos_profile', 'qos_reliability']) - self.assertEqual(image_filter_subs['laser_in']['qos']['qos_profile'], 'sensor_qos') - self.assertEqual(image_filter_subs['laser_in']['qos']['qos_reliability'], 'reliable') + ['profile', 'reliability']) + self.assertEqual(image_filter_subs['laser_in']['qos']['profile'], 'sensor_qos') + self.assertEqual(image_filter_subs['laser_in']['qos']['reliability'], 'reliable') self.assertEqual(list(image_filter_params['description_label'].keys()), ['type', 'default']) - self.assertEqual(image_filter_params['description_label']['type'], 'string') + self.assertEqual(image_filter_params['description_label']['type'], 'String') self.assertEqual(image_filter_params['description_label']['default'], 'default image') self.assertEqual(consumer_subs['image_in']['type'], 'sensor_msgs/msg/Image') - self.assertEqual(list(consumer_subs['image_in']['qos'].keys()), ['qos_profile']) - self.assertEqual(consumer_subs['image_in']['qos']['qos_profile'], 'sensor_qos') + self.assertEqual(list(consumer_subs['image_in']['qos'].keys()), ['profile']) + self.assertEqual(consumer_subs['image_in']['qos']['profile'], 'sensor_qos') self.assertEqual(consumer_subs['description_in']['type'], 'std_msgs/msg/String') self.assertEqual(consumer_pubs['image_out']['type'], 'sensor_msgs/msg/Image') - self.assertEqual(list(consumer_pubs['image_out']['qos'].keys()), ['qos_profile']) - self.assertEqual(consumer_pubs['image_out']['qos']['qos_profile'], 'sensor_qos') + self.assertEqual(list(consumer_pubs['image_out']['qos'].keys()), ['profile']) + self.assertEqual(consumer_pubs['image_out']['qos']['profile'], 'sensor_qos') def test_get_node_names(self): yaml_data = rossdl_cmake.read_description(self.filename_ros2) @@ -204,11 +204,11 @@ def test_get_message_header_from_type(self): def test_to_cpp_type(self): self.assertEqual( - rossdl_cmake.to_cpp_type('string'), + rossdl_cmake.to_cpp_type('String'), 'std::string') self.assertEqual( - rossdl_cmake.to_cpp_type('float'), - 'float') + rossdl_cmake.to_cpp_type('Double'), + 'double') def test_get_parameters_info(self): yaml_data = rossdl_cmake.read_description(self.filename_ros2) @@ -252,34 +252,18 @@ def test_get_system_remappings_1(self): yaml_data_ros2 = rossdl_cmake.read_description(self.filename_ros2) remappings = rossdl_cmake.get_system_remappings( - yaml_data_rossystem['rossdl_test']['systems']['system_1'], yaml_data_ros2) + yaml_data_rossystem['rossdl_test'], yaml_data_ros2, yaml_data_rossystem) self.assertEqual( remappings, { 'consumer': [ - ('/consumer/image_out', '/other_node/image_in'), + ('image_in', 'image_in'), + ('description_in', 'description_in'), ], 'image_filter': [ - ('/image_filter/image_out', '/consumer/image_in'), - ('/image_filter/description_out', '/consumer/description_in'), - ('/image_filter/image_in', '/camera/rgb/image_raw'), - ] - }) - - def test_get_system_remappings_2(self): - yaml_data_rossystem = rossdl_cmake.read_description(self.filename_rossystem) - yaml_data_ros2 = rossdl_cmake.read_description(self.filename_ros2) - - remappings = rossdl_cmake.get_system_remappings( - yaml_data_rossystem['rossdl_test']['systems']['system_2'], yaml_data_ros2) - - self.assertEqual( - remappings, - { - 'image_filter': [ - ('/image_filter/image_out', '/consumer/image_in'), - ('/image_filter/description_out', '/consumer/description_in'), + ('image_out', 'image_out'), + ('description_out', 'description_out'), ] }) @@ -292,37 +276,13 @@ def test_get_system_parameters_1(self): data_and_system['system'] = 'rossdl_test' parameters = rossdl_cmake.get_system_parameters( - yaml_data_rossystem['rossdl_test']['systems']['system_1'], yaml_data_ros2) + yaml_data_rossystem['rossdl_test'], yaml_data_ros2) self.assertEqual( parameters, ({ 'image_filter': [ - ('description_label', 'image raw'), - ('use_sim_time', True)], - 'consumer': [ - ('use_sim_time', True)] - })) - - def test_get_system_parameters_2(self): - yaml_data_rossystem = rossdl_cmake.read_description(self.filename_rossystem) - yaml_data_ros2 = rossdl_cmake.read_description(self.filename_ros2) - - data_and_system = {} - data_and_system['data'] = yaml_data_rossystem - data_and_system['system'] = 'rossdl_test' - - parameters = rossdl_cmake.get_system_parameters( - yaml_data_rossystem['rossdl_test']['systems']['system_2'], yaml_data_ros2) - - self.assertEqual( - parameters, - ({ - 'image_filter': [ - ('description_label', 'image compressed'), - ('use_sim_time', False)], - 'consumer': [ - ('use_sim_time', False)] + ('description_label', 'image_raw'), ], })) def test_get_system_nodes_1(self): @@ -332,24 +292,24 @@ def test_get_system_nodes_1(self): data_and_system['system'] = 'rossdl_test' self.assertEqual( - rossdl_cmake.get_system_nodes(yaml_data['rossdl_test']['systems']['system_1']), + rossdl_cmake.get_system_nodes(yaml_data['rossdl_test']), [ ('image_filter', 'rossdl_test::ImageFilter'), ('consumer', 'rossdl_test::Consumer') ]) - def test_get_system_nodes_2(self): - yaml_data = rossdl_cmake.read_description(self.filename_rossystem) - data_and_system = {} - data_and_system['data'] = yaml_data - data_and_system['system'] = 'rossdl_test' + # def test_get_system_nodes_2(self): + # yaml_data = rossdl_cmake.read_description(self.filename_rossystem) + # data_and_system = {} + # data_and_system['data'] = yaml_data + # data_and_system['system'] = 'rossdl_test' - self.assertEqual( - rossdl_cmake.get_system_nodes(yaml_data['rossdl_test']['systems']['system_2']), - [ - ('image_filter', 'rossdl_test::ImageFilter'), - ('consumer', 'rossdl_test::Consumer') - ]) + # self.assertEqual( + # rossdl_cmake.get_system_nodes(yaml_data['rossdl_test']['systems']['system_2']), + # [ + # ('image_filter', 'rossdl_test::ImageFilter'), + # ('consumer', 'rossdl_test::Consumer') + # ]) def test_generate_system_1(self): good_launch_content = '' @@ -378,33 +338,6 @@ def test_generate_system_1(self): self.assertEqual(len(good_launch_content), len(test_launch_content)) - def test_generate_system_2(self): - good_launch_content = '' - test_launch_content = '' - - good_launch_filename = os.path.join(get_package_share_directory( - 'rossdl_cmake'), 'system_2.launch.py.test') - test_launch_filename = '/tmp/system_2.launch.py' - - artifacts = [] - local_artifacts = [os.path.join(get_package_share_directory('rossdl_cmake'), - 'description.ros2')] - systems = [] - local_systems = [os.path.join(get_package_share_directory('rossdl_cmake'), - 'description.rossystem')] - - rossdl_cmake.generate_system( - 'rossdl_test', - self.filename_rossystem, test_launch_filename, 'system_2', - artifacts, local_artifacts, systems, local_systems) - - with open(good_launch_filename) as f: - good_launch_content = f.read() - with open(test_launch_filename) as f: - test_launch_content = f.read() - - self.assertEqual(len(good_launch_content), len(test_launch_content)) - if __name__ == '__main__': unittest.main() diff --git a/rossdl_tests/rossdl_simple_test/CMakeLists.txt b/rossdl_tests/rossdl_simple_test/CMakeLists.txt index cedf1a9..f3c4334 100644 --- a/rossdl_tests/rossdl_simple_test/CMakeLists.txt +++ b/rossdl_tests/rossdl_simple_test/CMakeLists.txt @@ -29,8 +29,7 @@ rossdl_generate_code( rossdl_generate_system( "description.rossystem" - "system_1" - "system_2" + "rossdl_simple_test" ) add_library(${PROJECT_NAME} SHARED diff --git a/rossdl_tests/rossdl_simple_test/description.ros2 b/rossdl_tests/rossdl_simple_test/description.ros2 index 5845e10..d11d559 100644 --- a/rossdl_tests/rossdl_simple_test/description.ros2 +++ b/rossdl_tests/rossdl_simple_test/description.ros2 @@ -1,44 +1,43 @@ ---- rossdl_simple_test: fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" artifacts: image_filter: - node: "image_filter" + node: image_filter publishers: image_out: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" - qos_reliability: "reliable" + profile: sensor_qos + reliability: reliable description_out: type: "std_msgs/msg/String" qos: - qos_history_depth: 100 + depth: 100 subscribers: image_in: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" + profile: sensor_qos laser_in: type: "sensor_msgs/msg/LaserScan" qos: - qos_profile: "sensor_qos" - qos_reliability: "reliable" + profile: sensor_qos + reliability: reliable parameters: description_label: - type: string + type: String default: "default image" consumer: - node: "consumer" + node: consumer subscribers: image_in: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" + profile: sensor_qos description_in: type: "std_msgs/msg/String" publishers: image_out: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" + profile: sensor_qos diff --git a/rossdl_tests/rossdl_simple_test/description.rossystem b/rossdl_tests/rossdl_simple_test/description.rossystem index 062b68b..555df63 100644 --- a/rossdl_tests/rossdl_simple_test/description.rossystem +++ b/rossdl_tests/rossdl_simple_test/description.rossystem @@ -1,22 +1,25 @@ ---- rossdl_simple_test: - fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" - systems: - system_1: - nodes: [rossdl_simple_test::image_filter, rossdl_simple_test::consumer] - connections: - - [/image_filter/image_out, /consumer/image_in] - - [/image_filter/description_out, /consumer/description_in] - - [/camera/rgb/image_raw, /image_filter/image_in] - - [/consumer/image_out, /other_node/image_in] + nodes: + node1: + from: "test_system.image_filter" + interfaces: + - filtered_image_pub: pub-> "image_filter::image_out" + - description_pub: pub-> "image_filter::description_out" + - image_sub: sub-> "image_filter::image_in" + - laser_sub: sub-> "image_filter::laser_in" parameters: - - [/image_filter/description_label, 'image raw'] - - [/*/use_sim_time, True] - system_2: - nodes: [rossdl_simple_test::image_filter, rossdl_simple_test::consumer] - connections: - - [/image_filter/image_out, /consumer/image_in] - - [/image_filter/description_out, /consumer/description_in] - parameters: - - [/image_filter/description_label, 'image compressed'] - - [/*/use_sim_time, False] + - ImageName: "image_filter::image_name" + value: "image_raw" + node2: + from: "test_system.consumer" + interfaces: + - filtered_image_sub: sub-> "consumer::image_in" + - description_sub: sub-> "consumer::description_in" + - inferenced_image_pub: pub-> "consumer::image_out" + connections: + - [ filtered_image_pub, filtered_image_sub ] + - [ description_pub, description_sub ] + processes: + process1: + nodes: [node1, node2] + threads: 2 diff --git a/rossdl_tests/rossdl_systems_test/application_1/CMakeLists.txt b/rossdl_tests/rossdl_systems_test/application_1/CMakeLists.txt index 6a7e814..0a6e0e3 100644 --- a/rossdl_tests/rossdl_systems_test/application_1/CMakeLists.txt +++ b/rossdl_tests/rossdl_systems_test/application_1/CMakeLists.txt @@ -13,7 +13,7 @@ set(dependencies rossdl_generate_system( "app_1.rossystem" - "app_1_system_1" + "application_1" ) # rossdl_generate_system( diff --git a/rossdl_tests/rossdl_systems_test/application_1/app_1.rossystem b/rossdl_tests/rossdl_systems_test/application_1/app_1.rossystem index 5283d25..70e145a 100644 --- a/rossdl_tests/rossdl_systems_test/application_1/app_1.rossystem +++ b/rossdl_tests/rossdl_systems_test/application_1/app_1.rossystem @@ -1,23 +1,25 @@ ---- application_1: - fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" - systems: - app_1_system_1: - nodes: [system_a::image_filter, system_b::consumer] - connections: - - [/image_filter/image_out, /consumer/image_in] - - [/image_filter/description_out, /consumer/description_in] - - [/camera/rgb/image_raw, /image_filter/image_in] - - [/consumer/image_out, /other_node/image_in] + nodes: + image_filter: + from: "system_a.image_filter" + interfaces: + - image_out: pub-> "image_filter::image_out" + - description_out: pub-> "image_filter::description_out" + - image_in: sub-> "image_filter::image_in" parameters: - - [/image_filter/description_label, 'image raw'] - - [/*/use_sim_time, False] - app_1_system_2: - nodes: [system_a::image_filter, system_b::consumer] - connections: - - [/image_filter/image_out, /consumer/image_in] - - [/image_filter/description_out, /consumer/description_in] - parameters: - - [/image_filter/description_label, 'image compressed'] - - [/*/use_sim_time, False] - + - DescriptionLabel: "image_filter::description_label" + value: "image_raw" + consumer: + from: "system_b.consumer" + interfaces: + - consumer_image_in: sub-> "consumer::image_in" + - description_in: sub-> "consumer::description_in" + - image_raw: pub-> "consumer::image_out" + connections: + - [ image_out, consumer_image_in ] + - [ description_out, description_in ] + - [ image_raw, image_in ] + processes: + main_process: + nodes: [ image_filter, consumer ] + threads: 2 \ No newline at end of file diff --git a/rossdl_tests/rossdl_systems_test/application_2/CMakeLists.txt b/rossdl_tests/rossdl_systems_test/application_2/CMakeLists.txt index edb4ae2..85c9ea4 100644 --- a/rossdl_tests/rossdl_systems_test/application_2/CMakeLists.txt +++ b/rossdl_tests/rossdl_systems_test/application_2/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(rossdl_cmake REQUIRED) rossdl_generate_system( "app_2.rossystem" - "app_2_system_1" + "application_2" ) ament_package() diff --git a/rossdl_tests/rossdl_systems_test/application_2/app_2.rossystem b/rossdl_tests/rossdl_systems_test/application_2/app_2.rossystem index 43acd0e..1226b85 100644 --- a/rossdl_tests/rossdl_systems_test/application_2/app_2.rossystem +++ b/rossdl_tests/rossdl_systems_test/application_2/app_2.rossystem @@ -1,13 +1,16 @@ ---- application_2: - fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" - systems: - app_2_system_1: - subsystems: [system_a::system_a_basic] - nodes: [system_b::consumer] - connections: - - [/image_filter/image_out, /consumer/image_in] - - [/image_filter/description_out, /consumer/description_in] - - [/consumer/image_out, /other_node/image_in] - parameters: - - [/*/use_sim_time, False] \ No newline at end of file + subSystems: + system_a + nodes: + system_b_consumer: + from: "system_b.consumer" + interfaces: + - consumer_image_in: sub-> "consumer::image_in" + - description_in: sub-> "consumer::description_in" + connections: + - [ image_raw, consumer_image_in ] + - [ description_out, description_in ] + processes: + main_process: + nodes: [system_b_consumer] + threads: 2 \ No newline at end of file diff --git a/rossdl_tests/rossdl_systems_test/application_3/CMakeLists.txt b/rossdl_tests/rossdl_systems_test/application_3/CMakeLists.txt index 1c68774..a5f3f63 100644 --- a/rossdl_tests/rossdl_systems_test/application_3/CMakeLists.txt +++ b/rossdl_tests/rossdl_systems_test/application_3/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(rossdl_cmake REQUIRED) rossdl_generate_system( "app_3.rossystem" - "app_3_system_1" + "application_3" ) ament_package() diff --git a/rossdl_tests/rossdl_systems_test/application_3/app_3.rossystem b/rossdl_tests/rossdl_systems_test/application_3/app_3.rossystem index 303f14c..5dfa6d8 100644 --- a/rossdl_tests/rossdl_systems_test/application_3/app_3.rossystem +++ b/rossdl_tests/rossdl_systems_test/application_3/app_3.rossystem @@ -1,9 +1,3 @@ ---- application_3: - fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" - systems: - app_3_system_1: - subsystems: [application_2::app_2_system_1] - nodes: [] - connections: [] - parameters: [] + subSystems: + application_2 \ No newline at end of file diff --git a/rossdl_tests/rossdl_systems_test/system_a/description.ros2 b/rossdl_tests/rossdl_systems_test/system_a/description.ros2 index d8be5ea..11d1d45 100644 --- a/rossdl_tests/rossdl_systems_test/system_a/description.ros2 +++ b/rossdl_tests/rossdl_systems_test/system_a/description.ros2 @@ -1,30 +1,29 @@ ---- system_a: fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" artifacts: image_filter: - node: "image_filter" + node: image_filter publishers: image_out: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" - qos_reliability: "reliable" + profile: sensor_qos + reliability: reliable description_out: type: "std_msgs/msg/String" qos: - qos_history_depth: 100 + depth: 100 subscribers: image_in: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" + profile: sensor_qos laser_in: type: "sensor_msgs/msg/LaserScan" qos: - qos_profile: "sensor_qos" - qos_reliability: "reliable" + profile: sensor_qos + reliability: reliable parameters: description_label: - type: string + type: String default: "default image" diff --git a/rossdl_tests/rossdl_systems_test/system_a/description.rossystem b/rossdl_tests/rossdl_systems_test/system_a/description.rossystem index 4e2840c..54731d9 100644 --- a/rossdl_tests/rossdl_systems_test/system_a/description.rossystem +++ b/rossdl_tests/rossdl_systems_test/system_a/description.rossystem @@ -1,11 +1,17 @@ ---- system_a: - fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" - systems: + nodes: system_a_basic: - nodes: [system_a::image_filter] - connections: - - [/camera/rgb/image_raw, /image_filter/image_in] + from: "system_a.image_filter" + interfaces: + - image_raw: pub-> "image_filter::image_out" + - image_in: sub-> "image_filter::image_in" + - description_out: pub-> "image_filter::description_out" parameters: - - [/image_filter/description_label, 'image raw'] - - [/*/use_sim_time, False] + - DescriptionLabel: "image_filter::description_label" + value: "image_raw" + connections: + - [ image_raw, image_in ] + processes: + main_process: + nodes: [ system_a_basic ] + threads: 1 diff --git a/rossdl_tests/rossdl_systems_test/system_a/tests/rossdl_generation_test.cpp b/rossdl_tests/rossdl_systems_test/system_a/tests/rossdl_generation_test.cpp index e9ef378..bb1b8a9 100644 --- a/rossdl_tests/rossdl_systems_test/system_a/tests/rossdl_generation_test.cpp +++ b/rossdl_tests/rossdl_systems_test/system_a/tests/rossdl_generation_test.cpp @@ -55,6 +55,9 @@ TEST(rossdl_generation_test, image_filter_unit) { auto info = image_filter->get_subscriptions_info_by_topic("/image_filter/image_in"); + for (const auto & i : info) { + std::cerr << i.node_name() << std::endl; + } ASSERT_EQ(info.size(), 1u); ASSERT_EQ(info[0].qos_profile().reliability(), rclcpp::ReliabilityPolicy::BestEffort); ASSERT_EQ(info[0].qos_profile().liveliness(), rclcpp::LivelinessPolicy::Automatic); diff --git a/rossdl_tests/rossdl_systems_test/system_b/description.ros2 b/rossdl_tests/rossdl_systems_test/system_b/description.ros2 index 9d920b4..43b20e9 100644 --- a/rossdl_tests/rossdl_systems_test/system_b/description.ros2 +++ b/rossdl_tests/rossdl_systems_test/system_b/description.ros2 @@ -1,18 +1,17 @@ ---- system_b: fromGitRepo: "https://github.com/jane-doe/project_example.git:branch" artifacts: consumer: - node: "consumer" + node: consumer subscribers: image_in: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" + profile: sensor_qos description_in: type: "std_msgs/msg/String" publishers: image_out: type: "sensor_msgs/msg/Image" qos: - qos_profile: "sensor_qos" + profile: sensor_qos diff --git a/rossdl_tests/rossdl_systems_test/system_b/tests/rossdl_generation_test.cpp b/rossdl_tests/rossdl_systems_test/system_b/tests/rossdl_generation_test.cpp index a9f0fd3..9282604 100644 --- a/rossdl_tests/rossdl_systems_test/system_b/tests/rossdl_generation_test.cpp +++ b/rossdl_tests/rossdl_systems_test/system_b/tests/rossdl_generation_test.cpp @@ -49,6 +49,9 @@ TEST(rossdl_generation_test, consumer_unit) { auto info = consumer->get_subscriptions_info_by_topic("/consumer/image_in"); + for (const auto & i : info) { + std::cerr << i.node_name() << std::endl; + } ASSERT_EQ(info.size(), 1u); ASSERT_EQ(info[0].qos_profile().reliability(), rclcpp::ReliabilityPolicy::BestEffort); ASSERT_EQ(info[0].qos_profile().liveliness(), rclcpp::LivelinessPolicy::Automatic); diff --git a/rossdl_tests/test_msgs.ros b/rossdl_tests/test_msgs.ros new file mode 100644 index 0000000..2aa390d --- /dev/null +++ b/rossdl_tests/test_msgs.ros @@ -0,0 +1,29 @@ +sensor_msgs: + msgs: + Image + message + Header header + uint32 height + uint32 width + string encoding + uint8 is_bigendian + uint32 step + uint8[] data + LaserScan + message + Header header + float32 angle_min + float32 angle_max + float32 angle_increment + float32 time_increment + float32 scan_time + float32 range_min + float32 range_max + float32[] ranges + float32[] intensities + +std_msgs: + msgs: + String + message + string data