Skip to content

entity

Entity models aligned with rmw_zenoh_cpp / ros-z concepts.

This module intentionally keeps formatting and keyexpr construction out of the publisher/subscriber implementations so that: - all liveliness tokens are consistent (NN/MP/MS/SS/SC) - all topic/service key expressions are constructed in one place

EntityKind

Bases: str, Enum

Matches rmw_zenoh_cpp / ros-z entity kind strings.

Source code in zenoh_ros2_sdk/entity.py
18
19
20
21
22
23
24
25
class EntityKind(str, Enum):
    """Matches rmw_zenoh_cpp / ros-z entity kind strings."""

    NODE = "NN"
    PUBLISHER = "MP"
    SUBSCRIPTION = "MS"
    SERVICE = "SS"
    CLIENT = "SC"

EndpointEntity

Represents a ROS graph endpoint (pub/sub/service/client) attached to a node.

  • For topics: name is the ROS topic name (e.g. "/chatter")
  • For services: name is the ROS service name (e.g. "/add_two_ints")
Source code in zenoh_ros2_sdk/entity.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@slotted_dataclass(frozen=True)
class EndpointEntity:
    """
    Represents a ROS graph endpoint (pub/sub/service/client) attached to a node.

    - For topics: `name` is the ROS topic name (e.g. "/chatter")
    - For services: `name` is the ROS service name (e.g. "/add_two_ints")
    """

    node: NodeEntity
    entity_id: int
    kind: EntityKind
    name: str
    dds_type_name: str
    type_hash: str
    qos: str
    gid: Optional[bytes] = None