Skip to content

Commit

Permalink
move _colored_point_cloud() to RGBDCamera
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorlouisdg committed Feb 12, 2024
1 parent 1d359f3 commit ead4abc
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions airo-camera-toolkit/airo_camera_toolkit/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ def get_depth_image(self) -> NumpyIntImageType:
self._grab_images()
return self._retrieve_depth_image()

@abc.abstractmethod
def _retrieve_depth_map(self) -> NumpyDepthMapType:
"""Returns the current depth map in the memory buffer."""
raise NotImplementedError

@abc.abstractmethod
def _retrieve_depth_image(self) -> NumpyIntImageType:
"""Returns the current depth image in the memory buffer."""
raise NotImplementedError


class RGBDCamera(RGBCamera, DepthCamera):
"""Base class for all RGBD cameras"""

def get_colored_point_cloud(self) -> PointCloud:
"""Get the latest point cloud of the camera.
The point cloud contains the estimated position in the camera frame of points on the image plane (pixels).
Expand All @@ -116,19 +130,6 @@ def get_colored_point_cloud(self) -> PointCloud:
self._grab_images()
return self._retrieve_colored_point_cloud()

# # TODO: offer a base implementation that uses the depth map and the rgb image to construct this pointcloud?
# raise NotImplementedError

@abc.abstractmethod
def _retrieve_depth_map(self) -> NumpyDepthMapType:
"""Returns the current depth map in the memory buffer."""
raise NotImplementedError

@abc.abstractmethod
def _retrieve_depth_image(self) -> NumpyIntImageType:
"""Returns the current depth image in the memory buffer."""
raise NotImplementedError

def _retrieve_colored_point_cloud(self) -> PointCloud:
"""Returns the current point cloud in the memory buffer.
Expand Down Expand Up @@ -157,10 +158,6 @@ def _retrieve_colored_point_cloud(self) -> PointCloud:
return point_cloud


class RGBDCamera(RGBCamera, DepthCamera):
"""Base class for all RGBD cameras"""


class StereoRGBDCamera(RGBDCamera):
"""Base class for all stereo RGBD cameras"""

Expand Down

0 comments on commit ead4abc

Please sign in to comment.