5 : _min_distance_x_(min_distance_x),
6 _min_distance_y_(min_distance_y),
7 _min_distance_z_(min_distance_z) {}
10 [[maybe_unused]]
Plane& plane)
const {
15 float minX = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointX(indices[0])]);
17 float minY = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointY(indices[0])]);
19 float minZ = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointZ(indices[0])]);
23 for (
size_t i = 1; i < indices.size(); ++i) {
24 float x = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointX(indices[i])]);
25 float y = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointY(indices[i])]);
26 float z = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointZ(indices[i])]);
28 minX = std::min(minX, x);
29 maxX = std::max(maxX, x);
31 minY = std::min(minY, y);
32 maxY = std::max(maxY, y);
34 minZ = std::min(minZ, z);
35 maxZ = std::max(maxZ, z);
Represents a cluster of 3D points using PCL (Point Cloud Library).
const std::vector< int > & get_point_indices()
Get the Point Cloud data of the cluster.
const sensor_msgs::msg::PointCloud2::SharedPtr & get_point_cloud()
Get the Point Cloud data of the cluster.
DisplacementValidator(double min_distance_x, double min_distance_y, double min_distance_z)
Constructs a new DisplacementValidator object with the specified distance threshold for all axis.
std::vector< double > coneValidator(Cluster *cone_point_cloud, Plane &plane) const override
Validates a cone based on the maximum distance between its points in all axis.
The Plane class represents a 3D plane defined by its equation ax + by + cz + d = 0.
constexpr size_t PointZ(size_t idx)
constexpr size_t PointX(size_t idx)
constexpr size_t PointY(size_t idx)