Struct Component

Struct Documentation

struct Component

SOVD Component entity - represents a software/hardware component (ROS 2 node)

Components are derived from ROS 2 nodes or defined in manifests. They expose operations (services/actions), data (topics), and configurations (parameters).

Public Functions

inline json to_json() const

Convert to JSON representation.

SOVD EntityReference fields: id, name, href, translation_id, tags ROS 2 extensions in x-medkit: namespace, fqn, entityType, area, source, variant, etc.

Returns:

JSON object with component data

inline json to_entity_reference(const std::string &base_url) const

Create SOVD EntityReference format (strictly compliant)

Parameters:

base_url – Base URL for self links

Returns:

JSON object in EntityReference format: id, name, href, [translationId, tags]

inline json to_capabilities(const std::string &base_url) const

Create SOVD Entity Capabilities format (strictly compliant)

Parameters:

base_url – Base URL for capability links

Returns:

JSON object listing available sub-resources

Public Members

std::string id

Unique identifier (node name)

std::string name

Human-readable name.

std::string namespace_path

ROS 2 namespace path.

std::string fqn

Fully qualified name (namespace + id)

std::string type = "Component"

Entity type (always “Component”)

std::string area

Parent area ID.

std::string source = "node"

Discovery source: “node”, “topic”, or “manifest”.

std::string translation_id

Internationalization key.

std::string description

Human-readable description.

std::string variant

Hardware variant identifier.

std::vector<std::string> tags

Tags for filtering.

std::string parent_component_id

Parent component ID for sub-components.

std::vector<std::string> depends_on

Component IDs this component depends on.

std::vector<ServiceInfo> services

Services exposed by this component.

std::vector<ActionInfo> actions

Actions exposed by this component.

ComponentTopics topics

Topics this component publishes/subscribes.

std::optional<json> host_metadata

Host system metadata (for runtime default component)