Skip to content

[BUG] Hybrid discovery merge pipeline does not suppress runtime entities linked to manifest entities #307

@bburda

Description

@bburda

Bug report

Steps to reproduce

  1. Configure gateway in hybrid mode with a manifest that defines entities with hyphenated IDs (e.g., lidar-sim, fault-manager)
  2. Ensure create_synthetic_components: false in config (though the bug occurs regardless of this setting)
  3. Start the gateway with ROS 2 nodes whose names match manifest ros_binding entries
  4. Query entity collection endpoints (GET /areas, /components, /apps)

Reproducible with any selfpatch_demos demo (sensor_diagnostics, moveit_pick_place, turtlebot3_integration).

Expected behavior

After runtime linking matches runtime nodes to manifest entities via ros_binding, the merge pipeline should emit only the manifest-defined entities. Linked runtime entities should be suppressed/merged into their manifest counterparts.

For sensor_diagnostics demo:

  • Areas: 4 (sensors, processing, diagnostics, bridge)
  • Components: 8 (lidar-unit, imu-unit, gps-unit, camera-unit, compute-unit, gateway, fault-manager, diagnostic-bridge-unit)
  • Apps: 8 (lidar-sim, imu-sim, gps-sim, camera-sim, anomaly-detector, medkit-gateway, medkit-fault-manager, diagnostic-bridge)

Actual behavior

Both manifest entities AND linked runtime entities appear in API responses, creating duplicates:

Areas: 6 instead of 4

sensors, processing, diagnostics, bridge, fault_manager, root

Extra: fault_manager (synthetic area from runtime), root (synthetic area)

Components: 17 instead of 8

lidar-unit, imu-unit, gps-unit, camera-unit, compute-unit, gateway, fault-manager, diagnostic-bridge-unit,
lidar_sim, camera_sim, imu_sim, gps_sim, anomaly_detector, diagnostic_bridge, ros2_medkit_gateway, _param_client_node, fault_manager

The bottom 9 are runtime-created synthetic entities with underscored IDs that should have been merged.

Apps: 17 instead of 8
Same pattern - every manifest app has a corresponding unmerged runtime duplicate.

Gateway logs show linking succeeds but duplicates still appear:

Runtime linking: 8 linked, 9 unlinked, 1 orphan nodes
MergePipeline: 43 entities from 4 layers, 4 enriched, 0 conflicts

The merge pipeline likely compares entity IDs directly (underscored != hyphenated) instead of using the ros_binding linkage to identify duplicates.

Environment

  • ros2_medkit version: main (v0.4.0)
  • ROS 2 distro: Jazzy
  • OS: Ubuntu 24.04 (Docker)

Additional information

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions