robokudo.annotators.pointcloud_crop

Point cloud cropping and visualization.

This module provides an annotator for:

  • Cropping point clouds using axis-aligned bounding boxes

  • Supporting both sensor and world coordinate frames

  • Generating and visualizing point cloud masks

  • Combining masks with color images

Note

Cropping can be done in either sensor coordinates (default) or world coordinates.

Classes

PointcloudCropAnnotator

Point cloud cropping using axis-aligned bounding boxes.

Module Contents

class robokudo.annotators.pointcloud_crop.PointcloudCropAnnotator(name: str = 'PointcloudCropAnnotator', descriptor: PointcloudCropAnnotator = Descriptor())

Bases: robokudo.annotators.core.BaseAnnotator

Point cloud cropping using axis-aligned bounding boxes.

Crop a subset of points from a pointcloud data based on min/max X,Y,Z values. The crop is either done in sensor coordinates (default) or relative to the world frame.

Warning

When using world coordinates, requires valid camera-to-world transform in CAS.

class Descriptor

Bases: robokudo.annotators.core.BaseAnnotator.Descriptor

Configuration descriptor for point cloud cropping.

class Parameters

Parameters for configuring point cloud cropping.

min_x: float = -2.0

Minimum X coordinate

min_y: float = -2.0

Minimum Y coordinate

min_z: float = -9.0

Minimum Z coordinate

max_x: float = 2.0

Maximum X coordinate

max_y: float = 2.0

Maximum Y coordinate

max_z: float = 3.0

Maximum Z coordinate

relative_to_world: bool = False

Whether to crop the PC in camera/sensor coordinates or whether it shoudl be transformed to world coordinates beforehand.

parameters
color: typing_extensions.Optional[numpy.typing.NDArray] = None

A copy of the color image currently being worked with.

update() py_trees.common.Status

Process and crop point cloud data.

The method:

  • Loads point cloud and camera data from CAS

  • Optionally transforms to world coordinates

  • Crops using axis-aligned bounding box

  • Generates visualization mask

  • Updates CAS with cropped cloud

  • Creates combined visualization

Returns:

SUCCESS after processing

Raises:

Exception – If world transform not found when needed