Data Acquisition Helpers

bosdyn.client.data_acquisition_helpers.issue_acquire_data_request(data_acq_client, acquisition_requests, group_name, action_name, metadata=None, data_timestamp=None)[source]

Sends the data acquisition request without blocking until the acquisition completes.

Parameters:
  • data_acq_client – DataAcquisition client for send the acquisition requests.

  • acquisition_requests – Acquisition requests to include in request message.

  • group_name – Group name for the acquisitions.

  • action_name – Action name for the acquisitions.

  • metadata – Metadata to include in the request message.

  • data_timestamp – Timestamp to use for the acquisitions. If None the timestamp will be generated by the data acquisition client.

Returns:

The request id (int) and the action id (CaptureActionId). A request id set as None indicates the AcquireData rpc failed.

bosdyn.client.data_acquisition_helpers.acquire_and_process_request(data_acquisition_client, acquisition_requests, group_name, action_name, metadata=None, block_until_complete=True, data_timestamp=None)[source]

Send acquisition request and optionally block until the acquisition completes.

If blocking, the GetStatus RPC is used to monitor the status of the acquisition request.

Parameters:
  • data_acquisition_client (DataAcquisitionClient) – The client for send the acquisition requests.

  • acquisition_requests (data_acquisition_pb2.AcquisitionRequestList) – Acquisition requests to include in request message.

  • group_name (string) – Group name for the acquisitions.

  • action_name (string) – Action name for the acquisitions.

  • metadata (data_acquisition_pb2.Metadata) – Metadata to include in the request message.

  • block_until_complete (Boolean) – If true, don’t return until the GetStatus completes.

  • data_timestamp – Timestamp to use for the acquisitions. If None the timestamp will be generated by the data acquisition client.

Returns:

Boolean indicating if the acquisition completed successfully or not.

bosdyn.client.data_acquisition_helpers.cancel_acquisition_request(data_acq_client, request_id)[source]

Cancels an acquisition request based on the request id

Parameters:
  • data_acq_client – DataAcquisition client for send the acquisition requests.

  • request_id – The id number for the AcquireData request to cancel.

Returns:

None.

bosdyn.client.data_acquisition_helpers.clean_filename(filename)[source]

Removes bad characters in a filename.

Parameters:

filename (string) – Original filename to clean.

Returns:

*?<>|

Return type:

Valid filename with removed characters

bosdyn.client.data_acquisition_helpers.make_time_query_params(start_time_secs, end_time_secs, robot)[source]

Create time-based query params for the download request.

Parameters:
  • start_time_secs (float) – The start time for the download data range.

  • end_time_secs (float) – The end time for the download range.

  • robot (Robot) – The robot object, used to acquire timesync and convert the times to robot time.

Returns:

The query params (data_acquisition_store_pb2.DataQueryParams) for the time-range download.

bosdyn.client.data_acquisition_helpers.make_time_query_params_from_group_name(group_name, data_store_client)[source]

Create time-based query params for the download request using the group name.

Parameters:
  • group_name (string) – The group name for the data to be downloaded.

  • data_store_client (DataAcquisitionStoreClient) – The data store client, used to get the action ids for the group name.

Returns:

The query params (data_acquisition_store_pb2.DataQueryParams) for the time-range download.

bosdyn.client.data_acquisition_helpers.download_data_REST(query_params, hostname, token, destination_folder='.', additional_params=None)[source]

Retrieve all data for a query from the DataBuffer REST API and write it to files.

Parameters:
  • query_params (bosdyn.api.DataQueryParams) – Query parameters to use to retrieve metadata from the DataStore service. Must be time-based query parameters only.

  • hostname (string) – Hostname to specify in URL where the DataBuffer service is running.

  • token (string) – User token to specify in https GET request for authentication.

  • destination_folder (string) – Folder where to download the data.

  • additional_params (dict) – Additional GET parameters to append to the URL.

Returns:

Boolean indicating if the data was downloaded successfully or not.