コード例 #1
0
 def update(self):
     with grpc.insecure_channel('localhost:50051',
                                options=options) as self.channel:
         stub = zense_pb2_grpc.ZenseServiceStub(self.channel)
         response = stub.SendRGBDImage(zense_pb2.ImageRequest())
         status = self.update_rgb(response)
         status &= self.update_depth(response)
     return status
コード例 #2
0
 def set_laser_intensity(self, intensity):
     with grpc.insecure_channel('localhost:50051',
                                options=options) as self.channel:
         stub = zense_pb2_grpc.ZenseServiceStub(self.channel)
         request = zense_pb2.SetLaserIntensityRequest()
         request.intensity = intensity
         response = stub.SetLaserIntensity(request)
     return response.is_success
コード例 #3
0
 def set_depth_range(self, given_depth_range):
     with grpc.insecure_channel('localhost:50051',
                                options=options) as self.channel:
         if len(given_depth_range) == 0:
             return True
         stub = zense_pb2_grpc.ZenseServiceStub(self.channel)
         request = zense_pb2.SetDepthRangeRequest()
         request.given_range = given_depth_range
         response = stub.SetDepthRange(request)
     return response.is_success
コード例 #4
0
        print(
            "Current camera setting is RGB disabled mode. This app can be executed under RGB enabled setting"
        )
        do_exit = True
    if do_exit:
        assert False


key = cv2.waitKey(10)
is_rgbd_enabled()
count = 0

while key & 0xFF != ord('q') or key & 0xFF != 27:

    with grpc.insecure_channel('localhost:50051', options=options) as channel:
        stub = zense_pb2_grpc.ZenseServiceStub(channel)
        _response = stub.SendRGBDImage(zense_pb2.ImageRequest())
        # serverが生きてるか死んでるか
        if _response.result().image_rgb.width == 0:
            print("no")
            pass
        else:
            print("OK1")
    with grpc.insecure_channel('localhost:50051', options=options) as channel:
        stub = zense_pb2_grpc.ZenseServiceStub(channel)
        _response = stub.SendRGBDIRImage.future(zense_pb2.ImageRequest())
        if _response.result().image_rgb.width == 0:
            print("no2")
            pass
        else:
            print("OK2")