class CallService(ROS2MutatorMethod):
Constructor: CallService(name, minimum_access_level, **kwargs)
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 |
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 |
Undocumented |
Inherited from ROS2ListingMethod (via ROS2MutatorMethod):
| Async Method | execute |
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 |
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 |
Answer yes: nothing here commands the robot, and one asks most when startup failed. |
| Async Method | _one |
Return the one ROS2 type a graph name carries, or refuse to guess between several. |
| Async Method | _refreshed |
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 |
Refuse a call whose text argument was left empty. |
| Async Method | _text |
Return one string Parameter, stripped. |
| Async Method | _write |
Write one answer into the two result variables. |
Send one request and answer with the response as JSON.
| Raises | |
UaStatusCodeError | BadInvalidArgument 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. |
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 | |
UaStatusCodeError | BadInvalidArgument 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. |