VariableManager

class VariableManagerClient
Canonical

kortex_api.autogen.client_stubs.VariableManagerClientRpc

__init__(router, namespace=None)

Constructs a VariableManagerClient with an initialized RouterClient and an optional namespace.

Parameters
  • router (RouterClient) – RouterClient used for the communication

  • namespace (string) – Optional namespace on which to initialize the VariableManagerClient (defaults to None)

IsAlive(timeoutMs: int = 1000)

Returns True if the Service Server is detected online before timeoutMs is expired, False otherwise.

Parameters

timeoutMs (unsigned int) – The maximum time to wait for an answer from the server

Return type

bool

SetVariable(variable, deviceId=0, options=RouterClientSendOptions())
The CONFIGURE permission is necessary to call this RPC.

Modifies or adds a variable.

An INVALID_PARAM exception is thrown if the variable or namespace identifiers contain anything else than a-Z, 0-9 and _.
A METHOD_FAILED exception is thrown if the variable to set is a system variable.

Parameters
  • variable (Variable) –

  • deviceId (int) – Device’s Id called by rpc (optional)

  • options (RouterClientSendOptions) – Router options for sending the message

Return type

VariableHandle

GetVariable(variablehandle, deviceId=0, options=RouterClientSendOptions())
The READ_ONLY permission is necessary to call this RPC.

Gets a variable.

An ENTITY_NOT_FOUND exception is thrown if the variable does not exist.

Parameters
Return type

Variable

DeleteVariable(variablehandle, deviceId=0, options=RouterClientSendOptions())
The CONFIGURE permission is necessary to call this RPC.

Deletes a variable.
To be deleted, the variable must exist and not contain flags.

An ENTITY_NOT_FOUND exception is thrown if the variable does not exist.
A METHOD_FAILED exception is thrown if the variable to set is a system variable.

Parameters
GetAllVariables(namespacehandle, deviceId=0, options=RouterClientSendOptions())
The READ_ONLY permission is necessary to call this RPC.

Get all variables from namespace.
Parameters
Return type

NamespaceVariables

GetAllNamespaces(namespacehandle, deviceId=0, options=RouterClientSendOptions())
The READ_ONLY permission is necessary to call this RPC.

Get all sub namespaces from a specific namespace.
Parameters
Return type

Namespaces

DeleteNamespace(deletenamespacehandle, deviceId=0, options=RouterClientSendOptions())
The CONFIGURE permission is necessary to call this RPC.

Deletes a namespace and its sub namespaces.
Parameters
GetAllVariableJsonSchemas(deviceId = 0, options = RouterClientSendOptions())
The READ_ONLY permission is necessary to call this RPC.

Get all variable JSON schemas available on robot (base & plugin schemas).
Parameters
  • deviceId (int) – Device’s Id called by rpc (optional)

  • options (RouterClientSendOptions) – Router options for sending the message

Return type

VariableJsonSchemaList

OnNotificationVariableChangeTopic(callback, notificationoptions)
The READ_ONLY permission is necessary to call this RPC.

Subscribes to Configuration change topic on variables
Parameters
  • callback (function) – Function callback taking a Kinova.Api.VariableManager.ConfigurationChangeNotification as only argument, and returning None.

  • notificationoptions (NotificationOptions) – Notification options

Return type

NotificationHandle

Unsubscribe(notificationhandle, deviceId=0, options=RouterClientSendOptions())
The READ_ONLY permission is necessary to call this RPC.

Unsubscribes client from receiving notifications for the specified topic
Parameters
Interpolate(interpolatestring, deviceId=0, options=RouterClientSendOptions())
The OPERATE permission is necessary to call this RPC.

Interpolate variables in a string.

An INVALID_PARAM exception is thrown if the input is not json-parsable.
An ERROR_DEVICE exception is thrown if the interpolation fails (ex. a variable does not exist).

Parameters
Return type

InterpolateString

OnNotificationVariableJsonSchemasChangedTopic(callback, notificationoptions)
The READ_ONLY permission is necessary to call this RPC.

Subscribes to variable JSON schemas changes notification
Parameters
  • callback (function) – Function callback taking a Kinova.Api.VariableManager.VariableJsonSchemasChangeNotification as only argument, and returning None.

  • notificationoptions (NotificationOptions) – Notification options

Return type

NotificationHandle