Payload Registration
Client for the payload service.
This allows client code to write to the robot payload registry.
- exception bosdyn.client.payload_registration.PayloadRegistrationResponseError(response, error_message=None)[source]
Bases:
ResponseError
General class of errors for PayloadRegistration service.
- exception bosdyn.client.payload_registration.InvalidPayloadCredentialsError(response, error_message=None)[source]
Bases:
PayloadRegistrationResponseError
The payload credentials do not match any payload registered to the robot.
- exception bosdyn.client.payload_registration.PayloadNotAuthorizedError(response, error_message=None)[source]
Bases:
PayloadRegistrationResponseError
The payload is not authorized.
- exception bosdyn.client.payload_registration.PayloadAlreadyExistsError(response, error_message=None)[source]
Bases:
PayloadRegistrationResponseError
A payload with this GUID is already registered on the robot.
- exception bosdyn.client.payload_registration.PayloadDoesNotExistError(response, error_message=None)[source]
Bases:
PayloadRegistrationResponseError
A payload with this GUID is not registered on the robot.
- class bosdyn.client.payload_registration.PayloadRegistrationClient[source]
Bases:
BaseClient
A client registering payload configs onto the robot.
- default_service_name = 'payload-registration'
- service_type = 'bosdyn.api.PayloadRegistrationService'
- register_payload(payload, secret, **kw_args)[source]
Register a payload to the robot.
- Parameters:
payload – The payload protobuf message to register.
secret – Unique string to verify payload.
kw_args – Extra arguments to pass to grpc call invocation.
- Raises:
RpcError – Problem communicating with the robot.
PayloadAlreadyExistsError – A payload with the provided GUID already exists.
PayloadRegistrationResponseError – Something went wrong during the payload registration.
- register_payload_async(payload, secret, **kw_args)[source]
Register a payload to the robot.
- Parameters:
payload – The payload protobuf message to register.
secret – Unique string to verify payload.
kw_args – Extra arguments to pass to grpc call invocation.
- Raises:
RpcError – Problem communicating with the robot.
PayloadAlreadyExistsError – A payload with the provided GUID already exists.
PayloadRegistrationResponseError – Something went wrong during the payload registration.
- update_payload_version(guid, secret, updated_version, **kw_args)[source]
Update an existing payload’s version on the robot.
- Parameters:
guid – The GUID of the payload to update.
secret – Secret of the payload to update.
updated_version – The new version to set this payload to.
kw_args – Extra arguments to pass to grpc call invocation.
- Raises:
RpcError – Problem communicating with the robot.
PayloadDoesNotExistError – A payload with the provided GUID does not exist.
InvalidPayloadCredentialsError – The GUID + secret does not match an existing payload.
PayloadRegistrationResponseError – Something went wrong during the payload registration.
- update_payload_version_async(guid, secret, updated_version, **kw_args)[source]
Update an existing payload on the robot.
- Parameters:
guid – The GUID of the payload to update.
secret – Secret of the payload to update.
updated_version – The new version to set this payload to.
kw_args – Extra arguments to pass to grpc call invocation.
- Raises:
RpcError – Problem communicating with the robot.
PayloadDoesNotExistError – A payload with the provided GUID does not exist.
InvalidPayloadCredentialsError – The GUID + secret does not match an existing payload.
PayloadRegistrationResponseError – Something went wrong during the payload registration.
- get_payload_auth_token(guid, secret, **kw_args)[source]
Request a limited-access auth token for a payload.
Getting the auth token requires payload to be authorized via the web console.
- Parameters:
guid – The GUID of the registered payload requesting the token.
secret – The secret of the registered payload requesting the token.
kw_args – Extra arguments to pass to grpc call invocation.
- Returns:
A limited-access user token for the robot
- Raises:
RpcError – Problem communicating with the robot.
PayloadNotAuthorizedError – The payload with the provided GUID is not authorized and cannot request a token.
InvalidPayloadCredentialsError – The provided GUID + secret combo does not match any existing payload.
PayloadRegistrationResponseError – Something went wrong during the payload registration.
- attach_payload(guid, secret, **kw_args)[source]
Attach a payload to the robot.
- Parameters:
guid – The GUID of the payload to attach.
secret – Secret of the payload to attach.
kw_args – Extra arguments to pass to grpc call invocation.
- Raises:
RpcError – Problem communicating with the robot.
PayloadDoesNotExistError – A payload with the provided GUID does not exist.
InvalidPayloadCredentialsError – The GUID + secret does not match an existing payload.
PayloadNotAuthorizedError – The payload you’ve requested to change is not yet authorized.
PayloadRegistrationResponseError – Something went wrong during the payload registration.
- attach_payload_async(guid, secret, **kw_args)[source]
Attach a payload to the robot.
- Parameters:
guid – The GUID of the payload to attach.
secret – Secret of the payload to attach.
kw_args – Extra arguments to pass to grpc call invocation.
- Raises:
RpcError – Problem communicating with the robot.
PayloadDoesNotExistError – A payload with the provided GUID does not exist.
InvalidPayloadCredentialsError – The GUID + secret does not match an existing payload.
PayloadNotAuthorizedError – The payload you’ve requested to change is not yet authorized.
PayloadRegistrationResponseError – Something went wrong during the payload registration.
- detach_payload(guid, secret, **kw_args)[source]
Detach a payload from the robot.
- Parameters:
guid – The GUID of the payload to detach.
secret – Secret of the payload to detach.
kw_args – Extra arguments to pass to grpc call invocation.
- Raises:
RpcError – Problem communicating with the robot.
PayloadDoesNotExistError – A payload with the provided GUID does not exist.
InvalidPayloadCredentialsError – The GUID + secret does not match an existing payload.
PayloadNotAuthorizedError – The payload you’ve requested to change is not yet authorized.
PayloadRegistrationResponseError – Something went wrong during the payload registration.
- detach_payload_async(guid, secret, **kw_args)[source]
Detach a payload from the robot.
- Parameters:
guid – The GUID of the payload to detach.
secret – Secret of the payload to detach.
kw_args – Extra arguments to pass to grpc call invocation.
- Raises:
RpcError – Problem communicating with the robot.
PayloadDoesNotExistError – A payload with the provided GUID does not exist.
InvalidPayloadCredentialsError – The GUID + secret does not match an existing payload.
PayloadNotAuthorizedError – The payload you’ve requested to change is not yet authorized.
PayloadRegistrationResponseError – Something went wrong during the payload registration.
- class bosdyn.client.payload_registration.PayloadRegistrationKeepAlive(pay_reg_client, payload, secret, registration_interval_secs=30, logger=None, rpc_timeout_secs=None)[source]
Bases:
object
Helper class to keep a payload entry registered.
Using a payload keep alive will ensure that a payload automatically re-registers itself with the robot if it is ever forgotten. However, payload registrations on Spot are persistent across power cycles and updates, so in most cases there is no need to send a payload registration request after the first successful payload registration. The use of a payload registration keep alive should only be used when a payload is expected to be regularly reconfigured by forgetting & re-authorizing the payload in the web page.
- Parameters:
pay_reg_client – Client to the payload registration service.
payload – bosdyn.api.payload object that defines the payload to register.
secret – String secret for the payload.
registration_interval_secs – Number of seconds between payload registration requests.
logger – logging.Logger object to log with. Defaults to None, in which case one with the class name is acquired.
rpc_timeout_secs – Number of seconds to wait for a pay_reg_client RPC. Defaults to None, for no timeout.
- start()[source]
Register and then kick off thread.
Can not be restarted with this method after a shutdown.
- Raises:
RpcError – Problem communicating with the robot.
RuntimeError – The thread was attempted to start more than once.