Ejemplo n.º 1
0
 def ListImageSources(self, request, context):
     """Implement the ListImageSources function of the service.
     
     This is simply implemented as a mock version, rather than full version.
     """
     resp = image_protos.ListImageSourcesResponse()
     helpers.add_common_header(resp, request)
     if self._image_sources:
         resp.image_sources.MergeFrom(self._image_sources)
     time.sleep(self._rpc_delay)
     return resp
Ejemplo n.º 2
0
    def ListImageSources(self, request, context):
        """Obtain the list of ImageSources for this given service.

        Args:
            request (image_pb2.ListImageSourcesRequest): The list images request.
            context (GRPC ClientContext): tracks internal grpc statuses and information.

        Returns:
            A list of all image sources known to this image service. Note, there could be multiple image
            services registered with the robot's directory service that can have different image sources.
        """
        response = image_pb2.ListImageSourcesResponse()
        for source in self.image_sources_mapped.values():
            response.image_sources.add().CopyFrom(source.image_source_proto)
        populate_response_header(response, request)
        return response
Ejemplo n.º 3
0
    def ListImageSources(self, request, context):
        """Obtain the list of ImageSources for this image source.

        Args:
            request (image_pb2.ListImageSourcesRequest): The list images request.
            context (GRPC ClientContext): tracks internal grpc statuses and information.

        Returns:
            A list of all image sources known to this image service. Note, this service is setup to run a
            single client connection to a Ricoh Theta camera, so that will be the only returned source.
        """
        response = image_pb2.ListImageSourcesResponse()
        add_source = response.image_sources.add()
        add_source.CopyFrom(self.ricoh_image_src_proto)
        populate_response_header(response, request)
        return response