Skip to content

Commit

Permalink
Sync submodule (#589)
Browse files Browse the repository at this point in the history
Co-authored-by: ad-daniel <[email protected]>
  • Loading branch information
github-actions[bot] and ad-daniel authored Jan 5, 2023
1 parent 3c1dd9a commit 06cffad
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ def __init__(self, name: Union[str, int], sampling_period: int = None):
self._enable = wb.wb_camera_enable
self._get_sampling_period = wb.wb_camera_get_sampling_period
super().__init__(name, sampling_period)
width = self.width
height = self.height
wb.wb_camera_get_image.restype = ctypes.POINTER(ctypes.c_ubyte * (4 * width * height))
wb.wb_camera_recognition_get_segmentation_image.restype = ctypes.POINTER(ctypes.c_ubyte * (4 * width * height))

def getExposure(self) -> float:
return self.exposure
Expand Down Expand Up @@ -161,10 +157,12 @@ def setFov(self, f: float):

@property
def image(self) -> bytes:
wb.wb_camera_get_image.restype = ctypes.POINTER(ctypes.c_ubyte * (4 * self.width * self.height))
return bytes(wb.wb_camera_get_image(self._tag).contents)

@property
def segmentation_image(self) -> bytes:
wb.wb_camera_recognition_get_segmentation_image.restype = ctypes.POINTER(ctypes.c_ubyte * (4 * self.width * self.height))
return bytes(wb.wb_camera_recognition_get_segmentation_image(self._tag).contents)

@property
Expand Down

0 comments on commit 06cffad

Please sign in to comment.