Lidar Target Detection
The targets described on this page can be detected using scripts/detection/lidar_target.py.
However, the ground plane is detected using scripts/detection/lidar_plane.py.
The configuration classes listed below are provided to the detection scripts as yaml files.
Examples are located in the scripts/detection/configs directory.
Type |
Config |
|---|---|
|
|
|
The point clouds are provided as numpy files (npy) in a directory. Their filenames represent the timestamp in nanoseconds as integer.
For most detection algorithms, the point clouds must be structured; otherwise, an error is thrown.
This means that they must have the shape (rows, cols, dim), where rows is usually the number of layers and cols the number of points per layer.
The dimension must be at least 3 and the first three values represent the
,
, and
coordinates.
Invalid measurements can be represented by [0.0, 0.0, 0.0].
Example files, generated using the CARLA Simulator, are located in the test/detection directory.
Alternatively, a ROS2 bag can be used as input.
For this, the topic containing sensor_msgs/PointCloud2 messages must be provided.
Ground Plane
Detect the ground plane.
- class excalibur.targets.lidar.plane.LidarPlaneConfig(plane_niter: int = 1000, plane_dist_thresh: float = 0.1, min_dist: float = 1.0, max_dist: float | None = None)[source]
Configuration for lidar plane detection.
- plane_niter: int = 1000
number of RANSAC iterations
- plane_dist_thresh: float = 0.1
inlier threshold [m]
- min_dist: float = 1.0
cloud points closer than min_dist are ignored [m]
- max_dist: float | None = None
cloud points farther than max_dist are ignored [m]
Calibration Board
Detect and estimate the 3D pose of a specific lidar calibration board. The rectangular board must have at least three asymmetrically placed holes that enable a unique pose estimation.
- class excalibur.targets.lidar.board.LidarBoardConfig(ref_centers: ndarray, circle_radius: float, max_diagonal: float, circle_radius_thresh: float = 0.01, range_interpolation_threshold: float = 0.0, grad_thresh: float = 1.0, min_range: float | None = None, max_range: float | None = None, min_plateau_len: float | None = None, plane_niter: int = 100, plane_dist_thresh: float = 0.1, line_niter: int = 100, line_dist_thresh: float = 0.01, min_line_inliers: int = 15, enforce_circle_radius: bool = False, circle_niter: int = 100, circle_dist_thresh: float = 0.02, geom_consist_thresh: float = 0.06)[source]
Configuration for lidar board detection.
- ref_centers: ndarray
(n,2)-array with hole center positions in 2D board coordinates [m]
- circle_radius: float
hole/circle radius of all holes [m]
- max_diagonal: float
diagonal of the calibration baord [m]
- circle_radius_thresh: float = 0.01
radius threshold for a valid hole/circle [m]
- range_interpolation_threshold: float = 0.0
missing points with neighbors in between this threshold are interpolated
- grad_thresh: float = 1.0
minimum depth gradient for detecting foreground plateaus [m]
- min_range: float | None = None
cloud points closer than min_range are ignored [m]
- max_range: float | None = None
cloud points farther than max_range are ignored [m]
- min_plateau_len: float | None = None
minimum plateau length, e.g., for ignoring narrow posts [m]
- plane_niter: int = 100
number of RANSAC iterations for plane fitting
- plane_dist_thresh: float = 0.1
inlier threshold [m]
- line_niter: int = 100
number of RANSAC iterations for line fitting (used to remove edge points)
- line_dist_thresh: float = 0.01
inlier threshold [m]
- min_line_inliers: int = 15
minimum number of inliers for removing an edge line
- enforce_circle_radius: bool = False
enforce circle radius during fitting instead of checking it afterward [m]
- circle_niter: int = 100
number of RANSAC iterations for the circle fitting (hole detection)
- circle_dist_thresh: float = 0.02
inlier threshold [m]
- geom_consist_thresh: float = 0.06
geometric consistency for a valid group of hole/circle detections [m]
Sphere
Detect and estimate the center position of a sphere. The exported poses all have an identity rotation since the orientation of a sphere cannot be determined.
- class excalibur.targets.lidar.sphere.LidarSphereConfig(sphere_radius: float, sphere_radius_thresh: float = 0.02, grad_thresh: float = 1.0, min_range: float | None = None, max_range: float | None = None, min_plateau_len: float | None = None, ransac_niter: int = 1000, ransac_dist_thresh: float = 0.02)[source]
Configuration for lidar sphere detection.
- sphere_radius: float
radius of the detected sphere [m]
- sphere_radius_thresh: float = 0.02
radius threshold for a valid sphere [m]
- grad_thresh: float = 1.0
minimum depth gradient for detecting foreground plateaus [m]
- min_range: float | None = None
cloud points closer than min_range are ignored [m]
- max_range: float | None = None
cloud points farther than max_range are ignored [m]
- min_plateau_len: float | None = None
minimum plateau length, e.g., for ignoring narrow posts [m]
- ransac_niter: int = 1000
number of RANSAC iterations
- ransac_dist_thresh: float = 0.02
inlier threshold [m]