コード例 #1
0
    def acquire_plugin_data(self, acquisition_requests, action_id, data_identifiers=None,
                            metadata=None, **kwargs):
        """Trigger a data acquisition to save data and metadata to the data acquisition store service.

        Args:
          acquisition_requests (bosdyn.api.AcquisitionRequestList): The different image sources and
                data sources to capture from and save to the data acquisition store service with
                the same timestamp.
          action_id (bosdyn.api.CaptureActionId): The unique action that all data should be saved
                with.
          data_identifiers (bosdyn.api.DataIdentifier) : List of data identifiers to associate with
                metadata.
          metadata (bosdyn.api.Metadata | dict): The JSON structured metadata to be associated with
                the data returned by the DataAcquisitionService when logged in the data acquisition
                store service.

        Raises:
          RpcError: Problem communicating with the robot.

        Returns:
            If the RPC is successful, then it will return the acquire data response, which can be
            used to check the status of the acquisition and get feedback.
        """

        metadata_proto = metadata_to_proto(metadata)
        request = data_acquisition.AcquirePluginDataRequest(
            metadata=metadata_proto, acquisition_requests=acquisition_requests,
            data_id=data_identifiers, action_id=action_id)
        return self.call(self._stub.AcquirePluginData, request,
                         error_from_response=acquire_data_error, **kwargs)
コード例 #2
0
    def acquire_plugin_data_async(self, acquisition_requests, action_id, data_identifiers=None,
        metadata=None, **kwargs):
        """Async version of the acquire_plugin_data() RPC."""

        metadata_proto = metadata_to_proto(metadata)
        request = data_acquisition.AcquirePluginDataRequest(
            metadata=metadata_proto, acquisition_requests=acquisition_requests,
            data_id=data_identifiers, action_id=action_id)
        return self.call_async(self._stub.AcquirePluginData, request,
                               error_from_response=acquire_data_error, **kwargs)
コード例 #3
0
ファイル: test_plugin_service.py プロジェクト: wau/spot-sdk
def make_single_request(action_name):
    request = data_acquisition_pb2.AcquirePluginDataRequest()
    request.action_id.group_name = 'test_group'
    request.action_id.action_name = action_name
    request.acquisition_requests.data_captures.add().name = 'test'
    return request