class documentation

class MethodBinding(AwaitedBinding):

View In Hierarchy

A ROS2 service exposed as a Method on the declaring Component.

The request becomes the Method's Parameters (written before Call) and the response its FinalResultData. There is no Monitoring, since a service has no feedback. opensmi's Call takes no input arguments and returns a bare status code, so anything richer than a status is in FinalResultData when the call returns.

Two failures reach a client differently. A transport failure (nobody serving the path, or a server that went quiet) means the call did not happen and returns a real UA status code. An application failure (the service answered no) is Good plus the response in FinalResultData, unless success_field names the field carrying the verdict.

Method __post_init__ Refuse a custom implementation class that is not a subclass of the stock one.
Class Variable kind Undocumented
Instance Variable call_timeout Seconds to wait for the answer once the request has gone. Separate from server_timeout because "nothing is there" and "it is stuck" reach a client as different status codes.
Instance Variable exclude Field patterns removing request fields, after include has narrowed. A selection that leaves the request unbuildable is refused at init instead of filled from a default.
Instance Variable include Field patterns narrowing the request; empty means every field.
Instance Variable method_type A subclass of opensmi.ros2.server.method.ROS2ServiceMethod, or None for the stock one. Python-only; refused when the Binding is constructed if it is not a subclass.
Instance Variable name The Binding's name, also the Method's name. Its variables are named for the field path alone.
Instance Variable path The ROS2 service.
Instance Variable rename New browse names by field path, as on MonitoringBinding.
Instance Variable request_from Builds the request from the Parameters, or None for the default. Python-only.
Instance Variable required Whether the StartupSkill waits for the service server to be discovered before Running.
Instance Variable response_exclude Field patterns removing response fields.
Instance Variable response_include Field patterns narrowing the response.
Instance Variable response_rename New browse names for response fields, as rename does.
Instance Variable response_to Turns the response into FinalResultData values, or None for the default. Python-only.
Instance Variable server_timeout Seconds Call waits for a service server before giving up.
Instance Variable service_type The ROS2 service type, package/srv/Name. Required, so the address space does not depend on start-up timing. A type whose package is not installed is fatal at init.
Instance Variable startup_timeout Seconds that wait lasts, or None for the deployment's default. Refused when the Binding is constructed without required.
Instance Variable success_field The name of a bool response field carrying the service's own verdict, or None. Never auto-detected: ROS2 has no standard success field. A field the response lacks, or one that is not a bool, is fatal at init.
Property needs_the_graph Return False: the declaration carries its type.
Property response_selection Return the response's field selection.
Property selection Return the request's field selection.
def __post_init__(self):

Refuse a custom implementation class that is not a subclass of the stock one.

Raises
ImplementationClassErrorWhen method_type does not derive from opensmi.ros2.server.method.ROS2ServiceMethod.
RequiredDeclarationErrorWhen startup_timeout is declared without required, or is not positive.
kind: ClassVar[str] =

Undocumented

call_timeout: float =

Seconds to wait for the answer once the request has gone. Separate from server_timeout because "nothing is there" and "it is stuck" reach a client as different status codes.

exclude: tuple[str, ...] =

Field patterns removing request fields, after include has narrowed. A selection that leaves the request unbuildable is refused at init instead of filled from a default.

include: tuple[str, ...] =

Field patterns narrowing the request; empty means every field.

method_type: type | None =

A subclass of opensmi.ros2.server.method.ROS2ServiceMethod, or None for the stock one. Python-only; refused when the Binding is constructed if it is not a subclass.

name =

The Binding's name, also the Method's name. Its variables are named for the field path alone.

path: str =

The ROS2 service.

rename: dict[str, str] =

New browse names by field path, as on MonitoringBinding.

request_from: RequestFunction | None =

Builds the request from the Parameters, or None for the default. Python-only.

required =

Whether the StartupSkill waits for the service server to be discovered before Running.

response_exclude: tuple[str, ...] =

Field patterns removing response fields.

response_include: tuple[str, ...] =

Field patterns narrowing the response.

response_rename: dict[str, str] =

New browse names for response fields, as rename does.

response_to: ResponseFunction | None =

Turns the response into FinalResultData values, or None for the default. Python-only.

server_timeout: float =

Seconds Call waits for a service server before giving up.

service_type: str =

The ROS2 service type, package/srv/Name. Required, so the address space does not depend on start-up timing. A type whose package is not installed is fatal at init.

startup_timeout =

Seconds that wait lasts, or None for the deployment's default. Refused when the Binding is constructed without required.

success_field: str | None =

The name of a bool response field carrying the service's own verdict, or None. Never auto-detected: ROS2 has no standard success field. A field the response lacks, or one that is not a bool, is fatal at init.

@property
needs_the_graph: bool =

Return False: the declaration carries its type.

@property
response_selection: FieldSelection =

Return the response's field selection.

@property
selection: FieldSelection =

Return the request's field selection.