class documentation

Call one ROS2 service once, ad hoc, without creating any nodes.

The request and the response are JSON, keyed by the node path of each field joined with dots (Mode.Mode for the variable Mode/Mode), so {"Mode.Mode": 2, "Label": "wide"} is the request a declared Method's Parameters would have been. A field left out holds the type's own zero.

Async Method answer Send one request and answer with the response as JSON.
Async Method _built Build the request message with ~opensmi.ros2.server.method.default_request_from.
Method _context Return the Component's Projection context for one type, so ad-hoc calls render like declared ones.
Async Method _init Add the three arguments: which service, which type, and the request as JSON.
Async Method _request_values Return the typed request as field paths to values.

Inherited from ROS2MutatorMethod:

Method __init__ Register the Method at the deployment's mutator level, which has no default.
Class Variable bypasses_the_lock Undocumented

Inherited from ROS2ListingMethod (via ROS2MutatorMethod):

Async Method execute_method Answer the call, writing the count beside the lines.
Property component Return the introspection Component.
Property runtime Return the Machine's Runtime.
Async Method _add_argument Create one writable argument. A listing's is writable without the Lock, a mutator's is not.
Async Method _answered Await one ROS2 call, turning transport failures into UA status codes.
Async Method _condition_startup_completed Answer yes: nothing here commands the robot, and one asks most when startup failed.
Async Method _one_type_on Return the one ROS2 type a graph name carries, or refuse to guess between several.
Async Method _refreshed_graph Read the ROS2 graph once. No poll keeps running.
Async Method _refuse Log the reason on the Notification, then refuse with a status code.
Async Method _require_an_argument Refuse a call whose text argument was left empty.
Async Method _text_parameter Return one string Parameter, stripped.
Async Method _write_lines Write one answer into the two result variables.
@override
async def answer(self) -> Sequence[str]:

Send one request and answer with the response as JSON.

Raises
UaStatusCodeErrorBadInvalidArgument when the service or its type is missing or the request is not a JSON object this type can be built from; BadTypeMismatch when a value the request carries is not one the ROS2 type can hold; and the code ~opensmi.ros2.server.method.TRANSPORT_STATUS gives when the call did not happen.
async def _built(self, service_type: str, values: Mapping[str, object]) -> Message:

Build the request message with ~opensmi.ros2.server.method.default_request_from.

It also checks that the message can be sent, so a value ROS2 would abort the process over becomes a status code.

Raises
UaStatusCodeErrorBadInvalidArgument when the type cannot be resolved or the request cannot be built from what was given, and BadTypeMismatch when a value is not one the ROS2 type can hold.
def _context(self, message_type: type[Message]) -> ProjectionContext:

Return the Component's Projection context for one type, so ad-hoc calls render like declared ones.

@override
async def _init(self):

Add the three arguments: which service, which type, and the request as JSON.

async def _request_values(self, text: str) -> Mapping[str, object]:

Return the typed request as field paths to values.

Raises
UaStatusCodeErrorBadInvalidArgument when the text is not a JSON object.