Data Buffer

Client for the data-buffer service.

This allows client code to log the following to the robot’s data buffer: text-messages, operator comments, blobs, signal ticks, and protobuf messages.

exception bosdyn.client.data_buffer.InvalidArgument[source]

Bases: bosdyn.client.exceptions.Error

A given argument could not be used.

class bosdyn.client.data_buffer.DataBufferClient[source]

Bases: bosdyn.client.common.BaseClient

A client for adding to robot data buffer.

default_service_name = 'data-buffer'
service_type = 'bosdyn.api.DataBufferService'
update_from(other)[source]

Adopt key objects like processors, logger, and wallet from other.

add_text_messages(text_messages, **kwargs)[source]

Log text messages to the robot.

Parameters

text_messages (List[TextMessage]) – Sequence of TextMessage protos.

Raises

RpcError – Problem communicating with the robot.

add_text_messages_async(text_messages, **kwargs)[source]

Async version of add_text_messages.

add_operator_comment(msg, robot_timestamp=None, **kwargs)[source]

Add an operator comment to the robot log.

Parameters
  • msg (string) – Text of user comment to log.

  • robot_timestamp (google.protobuf.Timestamp) – Time of messages, in robot time. If not set, timestamp will be when the robot receives the message.

Raises

RpcError – Problem communicating with the robot.

add_operator_comment_async(msg, robot_timestamp=None, **kwargs)[source]

Async version of add_operator_comment.

add_blob(data, type_id, channel=None, robot_timestamp=None, **kwargs)[source]

Log blob messages to the data buffer.

Parameters
  • data (bytes) – Binary data of one blob.

  • type_id (string) – Type of binary data of blob. For example, this could be the full name of a protobuf message type.

  • channel (string) – The name by which messages are typically queried: often the same as type_id, or of the form ‘{prefix}/{type_id}’.

  • robot_timestamp (google.protobuf.Timestamp) – Time of messages, in robot time.

Raises

RpcError – Problem communicating with the robot.

add_blob_async(data, type_id, channel=None, robot_timestamp=None, **kwargs)[source]

Async version of add_blob.

add_protobuf(proto, channel=None, robot_timestamp=None)[source]

Log protobuf messages to the data buffer.

Parameters
  • proto (Protobuf message) – Serializable protobuf to log.

  • channel (string) – Name of channel for data. If not set defaults to proto type name.

  • robot_timestamp (google.protobuf.Timestamp) – Time of proto, in robot time.

Raises

RpcError – Problem communicating with the robot.

add_protobuf_async(proto, channel=None, robot_timestamp=None)[source]

Async version of add_protobuf.

add_events(events, **kwargs)[source]

Log event messages to the robot.

Parameters

events (List[Event]) – Sequence of Event protos.

Raises

RpcError – Problem communicating with the robot.

add_events_async(events, **kwargs)[source]

Async version of add_events.

register_signal_schema(variables, schema_name, **kwargs)[source]

Log signal schema to the robot.

Parameters
  • variables (List[SignalSchema.Variable]) – List of SignalSchema variables defining what is in tick.

  • schema_name (string) – Name of schema (defined previously by client).

Raises

RpcError – Problem communicating with the robot.

register_signal_schema_async(variables, schema_name, **kwargs)[source]

Async version of register_signal_schema

add_signal_tick(data, schema_id, encoding=1, sequence_id=0, source='client', **kwargs)[source]

Log signal data to the robot data buffer.

Schema should be sent before any ticks.

Parameters
  • data (bytes) – Single hunk of binary data.

  • schema_id (int) – ID name of schema (obtained from a previous schema registration)

  • encoding (SignalTick.Encoding) – Encoding of the data

  • sequence_id (int) – Index of which sequence tick this is

  • source (string) – String name representing client

Raises
  • RpcError – Problem communicating with the robot.

  • LookupError – The schema_id is unknown (not previously registered by this client)

add_signal_tick_async(data, schema_id, encoding=1, sequence_id=0, source='client', **kwargs)[source]

Async version of add_signal_tick.