ProtectionZone¶
- class ProtectionZoneClient¶
- Canonical
kortex_api.autogen.client_stubs.ProtectionZoneClientRpc
- __init__(router, namespace=None)¶
Constructs a ProtectionZoneClient with an initialized
RouterClient
and an optional namespace.- Parameters
router (RouterClient) –
RouterClient
used for the communicationnamespace (string) – Optional namespace on which to initialize the ProtectionZoneClient (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
- CreateProtectionZone(protectionzoneconfig, deviceId=0, options=RouterClientSendOptions())¶
- The
SAFETIES
permission is necessary to call this RPC.Creates a new protection zone and returns a handle to the protection zone.The arm must be powered off and not be in an Unrecoverable Fault state to create a protection zone.The parameter orientation from the ZoneShape needs to be an orthonormal matrix, or else an error ERROR_DEVICE, METHOD_FAILED, is raised.If the shape dimensions are not greater than 0, an the error ERROR_DEVICE, METHOD_FAILED is raised.The shape dimensions are entered in meters and must be initialized according to the shape_type. The order is important and must be as followed:The dimensions must contain the radius it is a sphere, the x, y and z (length, width, height) dimensions if it is a rectangular prism, the radius and height if it is a cylinder.The shape origin needs to be a three dimensional vector that corresponds to the x,y,z coordinates.- Parameters
protectionzoneconfig (ProtectionZoneConfig) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- UpdateProtectionZone(protectionzoneconfig, deviceId=0, options=RouterClientSendOptions())¶
- The
SAFETIES
permission is necessary to call this RPC.Updates an existing protection zoneThe arm must be powered off and not be in an Unrecoverable Fault state to update a protection zone.Updates on the protection zone fields need to follow the same rules as the ones mentioned in CreateProtectionZone’s description.The handle.identifier of the protection zone to be updated needs to match the identifier from an existing protection zone, or else an ENTITY_NOT_FOUND exception is thrown.- Parameters
protectionzoneconfig (ProtectionZoneConfig) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- ReadProtectionZone(protectionzonehandle, deviceId=0, options=RouterClientSendOptions())¶
- The
READ_ONLY
permission is necessary to call this RPC.Retrieves an existing protection zone- Parameters
protectionzonehandle (ProtectionZoneHandle) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- DeleteProtectionZone(protectionzonehandle, deviceId=0, options=RouterClientSendOptions())¶
- The
SAFETIES
permission is necessary to call this RPC.Deletes an existing protection zoneThe arm must be powered off and not be in an Unrecoverable Fault state to delete a protection zone.The handle.identifier of the protection zone to be deleted needs to match the identifier from an existing protection zone, or else an ENTITY_NOT_FOUND exception is thrown.- Parameters
protectionzonehandle (ProtectionZoneHandle) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- ReadAllProtectionZones(deviceId = 0, options = RouterClientSendOptions())¶
- The
READ_ONLY
permission is necessary to call this RPC.Retrieves a list of all protection zones- Parameters
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- SetToolSphere(toolsphere, deviceId=0, options=RouterClientSendOptions())¶
- The
SAFETIES
permission is necessary to call this RPC.Sets the tool sphere.The arm must be powered off and not be in an Unrecoverable Fault state to set the tool sphere.- Parameters
toolsphere (ToolSphere) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- GetToolSphere(deviceId = 0, options = RouterClientSendOptions())¶
- The
READ_ONLY
permission is necessary to call this RPC.Gets the tool sphere- Parameters
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- OnNotificationProtectionZoneChangeTopic(callback, notificationoptions)¶
- The
READ_ONLY
permission is necessary to call this RPC.Subscribes to protection zone change topic for notifications- Parameters
callback (function) – Function callback taking a
ProtectionZoneChangeNotification
as only argument, and returningNone
.notificationoptions (NotificationOptions) – Notification options
- Return type
- OnNotificationToolSphereChangeTopic(callback, notificationoptions)¶
- The
READ_ONLY
permission is necessary to call this RPC.Subscribes to tool sphere change topic for notifications- Parameters
callback (function) – Function callback taking a
ToolSphereChangeNotification
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