Summary
Add topic-based component discovery to support systems like Isaac Sim that publish ROS 2 topics without creating standard ROS 2 nodes.
Currently, DiscoveryManager discovers components only through get_node_names_and_namespaces(). Systems like NVIDIA Isaac Sim publish topics (e.g., /carter1/odom, /carter2/cmd_vel) but don't create discoverable ROS 2 nodes, making their robots invisible to the gateway.
Proposed solution (optional)
Implement hybrid discovery that merges two sources:
- Node-based discovery (existing) - standard ROS 2 nodes
- Topic-based discovery (new) - extract unique namespace prefixes from topics and create "virtual" components
New methods:
- NativeTopicSampler::discover_topic_namespaces() - extract first segment from topic paths
- NativeTopicSampler::get_topics_for_namespace() - get all topics under a namespace
- NativeTopicSampler::is_system_topic() - filter /parameter_events, /rosout, /clock
- DiscoveryManager::discover_topic_components() - create components from topic namespaces
Add source field to Component struct ("node" or "topic") to distinguish discovery origin.
Additional context (optional)
Example API response after implementation:
[
{"id": "ros2_medkit_gateway", "source": "node", ...},
{"id": "carter1", "source": "topic", "topics": {"publishes": ["/carter1/odom", "/carter1/cmd_vel"]}},
{"id": "carter2", "source": "topic", "topics": {"publishes": ["/carter2/odom", "/carter2/cmd_vel"]}}
]