COM API Overview¶
Complete reference of all public classes, decorators, and helpers in vyra_base.com.
—
Decorators¶
Use these on component methods to expose them over the network.
Decorator |
Type |
Description |
|---|---|---|
|
Function |
Expose a method as a request/response service server |
|
Function |
Expose a method as a message publisher |
|
Function |
Register a method as a message subscriber callback |
|
Method on class |
Accept/reject incoming action goals |
|
Method on class |
Execute the action (main loop) |
|
Method on class |
Handle cancellation requests |
All decorators require your component class to call bind_decorated_callbacks()
during Phase 2 initialization.
Siehe auch
—
Abstract Handlers¶
Implement these interfaces in your component class.
Interface |
Description |
|---|---|
|
Marker interface for classes that expose |
|
Required base for classes using |
|
Passed to |
from vyra_base.com import IActionHandler, IGoalHandle
class MyComponent(IActionHandler):
@remote_actionServer.execute(name="task")
async def execute(self, goal_handle: IGoalHandle):
await goal_handle.publish_feedback({"progress": 50})
goal_handle.succeed()
return {"done": True}
—
InterfaceFactory¶
Creates live communication objects (servers, clients, publishers, subscribers, action objects).
Method |
Description |
|---|---|
|
Create a service server |
|
Create a service client |
|
Create a publisher |
|
Create a subscriber |
|
Create an action client |
|
Create interface from a Blueprint object |
|
Returns list of currently available |
Siehe auch
—
Blueprints¶
Blueprints describe an interface before it is created (Phase 1 of two-phase init). Created automatically by decorators; rarely needed manually.
Blueprint |
Description |
|---|---|
|
Describes a service server |
|
Describes a publisher |
|
Describes a subscriber |
|
Describes an action server (groups goal/execute/cancel blueprints) |
|
Global registry — stores and retrieves all blueprints by name |
—
Transport Layer¶
All four transports are fully implemented. Import from com.transport.t_*.
Protocol |
Module |
Key Classes |
Notes |
|---|---|---|---|
Zenoh (default) |
|
|
Requires |
ROS2 |
|
|
Requires ROS2 + |
Redis |
|
|
Requires |
UDS |
|
|
No extra dependencies |
Fallback chain: Zenoh → ROS2 → Redis → UDS
—
External Layer¶
Protocol |
Module |
Key Classes |
Notes |
|---|---|---|---|
gRPC |
|
|
Requires |
MQTT |
|
|
Requires |
REST |
|
|
Requires |
WebSocket |
|
|
Requires |
Shared Memory |
|
|
Linux only; no extra deps |
—
Industrial Layer¶
Protocol |
Module |
Key Classes |
Notes |
|---|---|---|---|
Modbus |
|
TCP + RTU sub-modules |
Requires |
OPC UA |
|
|
Requires |
—
Feeders¶
Class |
Description |
|---|---|
|
Abstract base for all feeders |
|
Publishes lifecycle + operational state changes |
|
Publishes informational messages |
|
Publishes error reports |
|
Publishes module availability (heartbeat/discovery) |
Use feeders via the entity:
entity.publish_news("Ready")
entity.publish_error("Storage unavailable")
—
Type System¶
Type / Enum |
Description |
|---|---|
|
All supported protocols ( |
|
Interface kinds: |
|
Security access control: |
|
Action result status: |
|
Type alias for a running service server |
|
Type alias for a service client |
|
Type alias for a publisher (has |
|
Type alias for a subscriber |
|
Type alias for an action server |
|
Type alias for an action client |
—
Topic Builder¶
Generates consistent topic / service names following VYRA naming conventions.
from vyra_base.com import build_topic, parse_topic, InterfaceType
# Build a topic name
name = build_topic(namespace="my_module", name="temperature", interface_type=InterfaceType.PUBLISHER)
# → "my_module/temperature"
# Parse an existing topic back to its components
components = parse_topic("my_module/temperature")
print(components.namespace, components.name)
—
Exceptions¶
All exceptions live in vyra_base.com.core.exceptions.
from vyra_base.com import (
CommunicationError, # Base
ProtocolUnavailableError, # Protocol not installed / unreachable
ProtocolNotInitializedError, # Protocol not set up yet
TransportError, # Low-level transport failure
InterfaceError, # Interface creation failed
TServerError, # Server runtime error
TSubscriberError, # Subscriber error
ActionServerError, # Action server error
)
—
Further Reading¶
Communication (com) — Transport, External, Industrial — full module reference
Interface Factory — InterfaceFactory API
Communication Decorators — Decorator API
Core Communication Types — Type system
Quickstart — Building a VYRA Module — Step-by-step module building guide