Data Acquisition¶
General client implementation for the main, on-robot data-acquisition service.
-
exception
bosdyn.client.data_acquisition.
DataAcquisitionResponseError
(response, error_message=None)[source]¶ Bases:
bosdyn.client.exceptions.ResponseError
Error in Data Acquisition RPC
-
exception
bosdyn.client.data_acquisition.
RequestIdDoesNotExistError
(response, error_message=None)[source]¶ Bases:
bosdyn.client.data_acquisition.DataAcquisitionResponseError
The provided request id does not exist or is invalid.
-
exception
bosdyn.client.data_acquisition.
UnknownCaptureTypeError
(response, error_message=None)[source]¶ Bases:
bosdyn.client.data_acquisition.DataAcquisitionResponseError
The provided request contains unknown capture requests.
-
exception
bosdyn.client.data_acquisition.
CancellationFailedError
(response, error_message=None)[source]¶ Bases:
bosdyn.client.data_acquisition.DataAcquisitionResponseError
The data acquisition request was unable to be cancelled.
-
class
bosdyn.client.data_acquisition.
DataAcquisitionClient
[source]¶ Bases:
bosdyn.client.common.BaseClient
A client for triggering data acquisition and logging.
-
default_service_name
= 'data-acquisition'¶
-
service_type
= 'bosdyn.api.DataAcquisitionService'¶
-
acquire_data
(acquisition_requests, action_name, group_name, data_timestamp=None, metadata=None, **kwargs)[source]¶ Trigger a data acquisition to save data and metadata to the data buffer.
- Parameters
acquisition_requests (bosdyn.api.AcquisitionRequestList) – The different image sources and data sources to capture from and save to the data buffer with the same timestamp.
action_name (string) – The unique action name that all data will be saved with.
group_name (string) – The unique group name that all data will be saved with.
data_timestamp (google.protobuf.Timestamp) – The unique timestamp that all data will be saved with.
metadata (bosdyn.api.Metadata | dict) – The JSON structured metadata to be associated with the data returned by the DataAcquisitionService when logged in the data buffer service.
- Raises
RpcError – Problem communicating with the robot.
- Returns
If the RPC is successful, then it will return the acquire data request id, which can be used to check the status of the acquisition and get feedback.
-
acquire_data_async
(acquisition_requests, action_name, group_name, data_timestamp=None, metadata=None, **kwargs)[source]¶ Async version of the acquire_data() RPC.
-
get_status
(request_id, **kwargs)[source]¶ Check the status of a data acquisition based on the request id.
- Parameters
request_id (int) – The request id associated with an AcquireData request.
- Raises
RpcError – Problem communicating with the robot.
RequestIdDoesNotExistError – The request id provided is incorrect.
- Returns
If the RPC is successful, then it will return the full status response, which includes the status as well as other information about any possible errors.
-
get_service_info
(**kwargs)[source]¶ Get information from a DAQ service to list it’s capabilities - which data, metadata, or processing the DAQ service will perform.
- Raises
RpcError – Problem communicating with the robot.
- Returns
The GetServiceInfoResponse message, which contains all the different capabilities.
-
cancel_acquisition
(request_id, **kwargs)[source]¶ Cancel a data acquisition based on the request id. :param request_id: The request id associated with an AcquireData request. :type request_id: int
- Raises
RpcError – Problem communicating with the robot.
CancellationFailedError – The data acquisitions associated with the request id were unable to be cancelled.
RequestIdDoesNotExistError – The request id provided is incorrect.
- Returns
If the RPC is successful, then it will return the full status response, which includes the status as well as other information about any possible errors.
-
-
bosdyn.client.data_acquisition.
metadata_to_proto
(metadata)[source]¶ Checks the type to determine if a conversion is required to create a bosdyn.api.Metadata proto message.
- Parameters
metadata (bosdyn.api.Metadata or dict) – The JSON structured metadata to be associated with the data returned by the DataAcquisitionService when logged in the data buffer service.
- Returns
If metadata is provided, this will return a protobuf Metadata message. Otherwise it will return None.