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:
ResponseError
Error in Data Acquisition RPC
- exception bosdyn.client.data_acquisition.RequestIdDoesNotExistError(response, error_message=None)[source]
Bases:
DataAcquisitionResponseError
The provided request id does not exist or is invalid.
- exception bosdyn.client.data_acquisition.UnknownCaptureTypeError(response, error_message=None)[source]
Bases:
DataAcquisitionResponseError
The provided request contains unknown capture requests.
- exception bosdyn.client.data_acquisition.CancellationFailedError(response, error_message=None)[source]
Bases:
DataAcquisitionResponseError
The data acquisition request was unable to be cancelled.
- class bosdyn.client.data_acquisition.DataAcquisitionClient[source]
Bases:
BaseClient
A client for triggering data acquisition and logging.
- default_service_name = 'data-acquisition'
- service_type = 'bosdyn.api.DataAcquisitionService'
- make_acquire_data_request(acquisition_requests, action_name, group_name, data_timestamp=None, metadata=None, min_timeout=None)[source]
Helper utility to generate an AcquireDataRequest.
- 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.
ValueError – Metadata is not in the right format.
- 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.
- acquire_data_from_request(request, **kwargs)[source]
Alternate version of acquire_data() that takes an AcquireDataRequest directly.
- Returns:
If the RPC is successful, then it will return the AcquireDataResponse.
- acquire_data_from_request_async(request, **kwargs)[source]
Async version of acquire_data_from_request().
- 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.
bosdyn.client.data_acquisition.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 Data Acquisition service to list its capabilities - which data, metadata,or processing the Data Acquisition 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.
- Parameters:
request_id (int) – The request id associated with an AcquireData request.
- Raises:
RpcError – Problem communicating with the robot.
CancellationFailedError – The data acquisitions associated with the request id were unable to be cancelled.
bosdyn.client.data_acquisition.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.
- Raises:
ValueError – Metadata is not in the right format.
- Returns:
If metadata is provided, this will return a protobuf Metadata message. Otherwise it will return None.