Class RuntimeLinker

Class Documentation

class RuntimeLinker

Links manifest Apps to runtime ROS 2 nodes.

RuntimeLinker performs the binding between manifest-declared Apps and actual ROS 2 nodes discovered at runtime. This enables:

  • Stable App IDs from manifest

  • Live data (topics, services, actions) from runtime nodes

  • Detection of offline apps and orphan nodes

Match priority:

  1. Exact match: node_name + namespace both match

  2. Wildcard namespace: node_name matches, namespace is “*”

  3. Topic namespace: topic_namespace prefix matches node’s topics

Public Functions

explicit RuntimeLinker(rclcpp::Node *node = nullptr)

Constructor.

Parameters:

node – ROS node for logging (can be nullptr for testing)

LinkingResult link(const std::vector<App> &manifest_apps, const std::vector<App> &runtime_apps, const ManifestConfig &config)

Link manifest apps to runtime apps (nodes)

Parameters:
  • manifest_apps – Apps from manifest

  • runtime_apps – Apps discovered from ROS graph (each node is an App)

  • configManifest config with orphan policy

Returns:

LinkingResult with linked apps and orphan info

bool is_app_online(const std::string &app_id) const

Check if a specific app is linked to a runtime node.

Parameters:

app_idApp identifier

Returns:

true if app is online (linked to a node)

std::optional<std::string> get_bound_node(const std::string &app_id) const

Get the node FQN bound to an app.

Parameters:

app_idApp identifier

Returns:

Node FQN if linked, nullopt otherwise

std::optional<std::string> get_app_for_node(const std::string &node_fqn) const

Get the app ID for a node FQN.

Parameters:

node_fqn – Fully qualified node name

Returns:

App ID if bound, nullopt otherwise

inline const LinkingResult &get_last_result() const

Get the last linking result.