def upload_graph_async(self, lease=None, graph=None, **kwargs): """Async version of upload_graph().""" request = self._build_upload_graph_request(lease, graph) return self.call_async(self._stub.UploadGraph, request, value_from_response=_get_response, error_from_response=handle_common_header_errors( common_lease_errors), **kwargs)
def clear_graph_async(self, lease=None, **kwargs): """Async version of clear_graph().""" request = self._build_clear_graph_request(lease) return self.call_async(self._stub.ClearGraph, request, value_from_response=None, error_from_response=handle_common_header_errors( common_lease_errors), **kwargs)
def clear_graph(self, lease=None, **kwargs): """Clears the local graph structure. Also erases any snapshots currently in RAM. Args: leases: Leases to show ownership of necessary resources. Will use the client's leases by default. Raises: RpcError: Problem communicating with the robot. LeaseUseError: Error using provided lease. """ request = self._build_clear_graph_request(lease) return self.call(self._stub.ClearGraph, request, value_from_response=None, error_from_response=handle_common_header_errors(common_lease_errors), **kwargs)
def upload_graph(self, lease=None, graph=None, **kwargs): """Uploads a graph to the server and appends to the existing graph. Args: leases: Leases to show ownership of necessary resources. Will use the client's leases by default. graph: Graph protobuf that represents the map with waypoints and edges. Returns: The response, which includes waypoint and edge id's sorted by whether it was cached. Raises: RpcError: Problem communicating with the robot. LeaseUseError: Error using provided lease. """ request = self._build_upload_graph_request(lease, graph) return self.call(self._stub.UploadGraph, request, value_from_response=_get_response, error_from_response=handle_common_header_errors(common_lease_errors), **kwargs)
def upload_edge_snapshot(self, edge_snapshot, lease=None, **kwargs): """Uploads large edge snapshot as a stream for a particular edge. Args: leases: Leases to show ownership of necessary resources. Will use the client's leases by default. edge_snapshot: EdgeSnapshot protobuf that will be stream uploaded to the robot. Returns: The status of the upload request. Raises: RpcError: Problem communicating with the robot. LeaseUseError: Error using provided leases. """ serialized = edge_snapshot.SerializeToString() self.call(self._stub.UploadEdgeSnapshot, GraphNavClient._data_chunk_iterator_upload_edge_snapshot( serialized, lease, self._data_chunk_size), value_from_response=None, error_from_response=handle_common_header_errors(common_lease_errors), **kwargs)