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 communicationnamespace (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 beforetimeoutMs
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
- 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
variablehandle (VariableHandle) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- 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
variablehandle (VariableHandle) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- GetAllVariables(namespacehandle, deviceId=0, options=RouterClientSendOptions())¶
- The
READ_ONLY
permission is necessary to call this RPC.Get all variables from namespace.- Parameters
namespacehandle (NamespaceHandle) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- 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
namespacehandle (NamespaceHandle) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- DeleteNamespace(deletenamespacehandle, deviceId=0, options=RouterClientSendOptions())¶
- The
CONFIGURE
permission is necessary to call this RPC.Deletes a namespace and its sub namespaces.- Parameters
deletenamespacehandle (DeleteNamespaceHandle) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- 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
- 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 returningNone
.notificationoptions (NotificationOptions) – Notification options
- Return type
- 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
notificationhandle (NotificationHandle) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- 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
interpolatestring (InterpolateString) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- 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 returningNone
.notificationoptions (NotificationOptions) – Notification options
- Return type