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: bosdyn.client.exceptions.ResponseError

General class of errors for PayloadRegistration service.

exception bosdyn.client.payload_registration.InvalidPayloadCredentialsError(response, error_message=None)[source]

Bases: bosdyn.client.payload_registration.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: bosdyn.client.payload_registration.PayloadRegistrationResponseError

The payload is not authorized.

exception bosdyn.client.payload_registration.PayloadAlreadyExistsError(response, error_message=None)[source]

Bases: bosdyn.client.payload_registration.PayloadRegistrationResponseError

A payload with this GUID is already registered on the robot.

exception bosdyn.client.payload_registration.PayloadDoesNotExistError(response, error_message=None)[source]

Bases: bosdyn.client.payload_registration.PayloadRegistrationResponseError

A payload with this GUID is not registered on the robot.

class bosdyn.client.payload_registration.PayloadRegistrationClient[source]

Bases: bosdyn.client.common.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
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
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
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
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
class bosdyn.client.payload_registration.PayloadRegistrationKeepAlive(pay_reg_client, payload, secret, registration_interval_secs=10, 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.

is_alive()[source]

Are we still periodically re-registering?

Returns

A bool stating if still alive

shutdown()[source]

Stop the background thread.