Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorlouisdg committed Jul 30, 2024
1 parent 4f41a90 commit 9652961
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,31 +379,31 @@ def _close_shared_memory(self) -> None:

if self.rgb_shm is not None:
self.rgb_shm.close()
self.rgb_shm = None # type: ignore
self.rgb_shm = None # type: ignore

if self.rgb_shape_shm is not None:
self.rgb_shape_shm.close()
self.rgb_shape_shm = None # type: ignore
self.rgb_shape_shm = None # type: ignore

if self.timestamp_shm is not None:
self.timestamp_shm.close()
self.timestamp_shm = None # type: ignore
self.timestamp_shm = None # type: ignore

if self.intrinsics_shm is not None:
self.intrinsics_shm.close()
self.intrinsics_shm = None # type: ignore
self.intrinsics_shm = None # type: ignore

if self.fps_shm is not None:
self.fps_shm.close()
self.fps_shm = None # type: ignore
self.fps_shm = None # type: ignore

if self.write_lock_shm is not None:
self.write_lock_shm.close()
self.write_lock_shm = None # type: ignore
self.write_lock_shm = None # type: ignore

if self.read_lock_shm is not None:
self.read_lock_shm.close()
self.read_lock_shm = None # type: ignore
self.read_lock_shm = None # type: ignore

def __del__(self) -> None:
self._close_shared_memory()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,43 +339,43 @@ def _close_shared_memory(self) -> None: # noqa C901

if self.depth_shm is not None:
self.depth_shm.close()
self.depth_shm = None # type: ignore
self.depth_shm = None # type: ignore

if self.depth_shape_shm is not None:
self.depth_shape_shm.close()
self.depth_shape_shm = None # type: ignore
self.depth_shape_shm = None # type: ignore

if self.depth_image_shm is not None:
self.depth_image_shm.close()
self.depth_image_shm = None # type: ignore
self.depth_image_shm = None # type: ignore

if self.depth_image_shape_shm is not None:
self.depth_image_shape_shm.close()
self.depth_image_shape_shm = None # type: ignore
self.depth_image_shape_shm = None # type: ignore

if self.confidence_map_shm is not None:
self.confidence_map_shm.close()
self.confidence_map_shm = None # type: ignore
self.confidence_map_shm = None # type: ignore

if self.confidence_map_shape_shm is not None:
self.confidence_map_shape_shm.close()
self.confidence_map_shape_shm = None # type: ignore
self.confidence_map_shape_shm = None # type: ignore

if self.point_cloud_positions_shm is not None:
self.point_cloud_positions_shm.close()
self.point_cloud_positions_shm = None # type: ignore
self.point_cloud_positions_shm = None # type: ignore

if self.point_cloud_positions_shape_shm is not None:
self.point_cloud_positions_shape_shm.close()
self.point_cloud_positions_shape_shm = None # type: ignore
self.point_cloud_positions_shape_shm = None # type: ignore

if self.point_cloud_colors_shm is not None:
self.point_cloud_colors_shm.close()
self.point_cloud_colors_shm = None # type: ignore
self.point_cloud_colors_shm = None # type: ignore

if self.point_cloud_colors_shape_shm is not None:
self.point_cloud_colors_shape_shm.close()
self.point_cloud_colors_shape_shm = None # type: ignore
self.point_cloud_colors_shape_shm = None # type: ignore

def __del__(self) -> None:
super().__del__()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ def __init__(self, shared_memory_namespace: str) -> None:

logger.info("Found stereo shared memory blocks.")

resource_tracker.unregister(self.rgb_right_shm._name, "shared_memory") # type: ignore[attr-defined]
resource_tracker.unregister(self.rgb_right_shape_shm._name, "shared_memory") # type: ignore[attr-defined]
resource_tracker.unregister(self.pose_right_in_left_shm._name, "shared_memory") # type: ignore[attr-defined]
resource_tracker.unregister(self.intrinsics_right_shm._name, "shared_memory") # type: ignore[attr-defined]
resource_tracker.unregister(self.rgb_right_shm._name, "shared_memory") # type: ignore[attr-defined]
resource_tracker.unregister(self.rgb_right_shape_shm._name, "shared_memory") # type: ignore[attr-defined]
resource_tracker.unregister(self.pose_right_in_left_shm._name, "shared_memory") # type: ignore[attr-defined]
resource_tracker.unregister(self.intrinsics_right_shm._name, "shared_memory") # type: ignore[attr-defined]

self.rgb_right_shape_shm_array: np.ndarray = np.ndarray(
(3,), dtype=np.int64, buffer=self.rgb_right_shape_shm.buf
Expand Down Expand Up @@ -255,19 +255,19 @@ def _close_shared_memory(self) -> None:

if self.rgb_right_shm is not None:
self.rgb_right_shm.close()
self.rgb_right_shm = None # type: ignore
self.rgb_right_shm = None # type: ignore

if self.rgb_right_shape_shm is not None:
self.rgb_right_shape_shm.close()
self.rgb_right_shape_shm = None # type: ignore
self.rgb_right_shape_shm = None # type: ignore

if self.pose_right_in_left_shm is not None:
self.pose_right_in_left_shm.close()
self.pose_right_in_left_shm = None # type: ignore
self.pose_right_in_left_shm = None # type: ignore

if self.intrinsics_right_shm is not None:
self.intrinsics_right_shm.close()
self.intrinsics_right_shm = None # type: ignore
self.intrinsics_right_shm = None # type: ignore

def __del__(self) -> None:
super().__del__()
Expand Down
2 changes: 1 addition & 1 deletion airo-camera-toolkit/airo_camera_toolkit/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def get_rgb_image_as_int(self, view: str = LEFT_RGB) -> NumpyIntImageType:
@abc.abstractmethod
def _retrieve_rgb_image(self, view: str = LEFT_RGB) -> NumpyFloatImageType:
raise NotImplementedError

@abc.abstractmethod
def _retrieve_rgb_image_as_int(self, view: str = LEFT_RGB) -> NumpyIntImageType:
raise NotImplementedError
Expand Down

0 comments on commit 9652961

Please sign in to comment.