4 double large_height,
double out_distance_cap)
5 : small_width(small_width),
6 small_height(small_height),
7 large_width(large_width),
8 large_height(large_height),
9 out_distance_cap(out_distance_cap) {}
16 [[maybe_unused]]
Plane& plane)
const {
20 double out_distanceXY = 1.0;
21 double out_distanceZ = 1.0;
25 for (
size_t idx : indices) {
36 double distanceZ = std::abs(z - cone_cluster->
get_centroid().z());
42 out_distanceXY = std::min(out_distanceXY,
large_getRadius() / distanceXY);
43 out_distanceZ = std::min(out_distanceZ,
large_height / (2 * distanceZ));
47 out_distanceXY = std::min(out_distanceXY,
small_getRadius() / distanceXY);
48 out_distanceZ = std::min(out_distanceZ,
small_height / (2 * distanceZ));
67 return {out_distanceXY, out_distanceZ, 1.0 -
static_cast<double>(n_out_points) / indices.size()};
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.
Eigen::Vector4f get_centroid()
Get the centroid of the cluster.
bool get_is_large()
Get cluster's corresponding cone size.
std::vector< double > coneValidator(Cluster *cone_point_cloud, Plane &plane) const override
Validates a cluster using cylinder approximation.
double large_height
Height of the cylinder for a large cone.
double small_getRadius() const
Gets the radius of the cylinder for small cones.
double small_width
Width of the cylinder for a small cone.
double large_width
Width of the cylinder for a large cone.
CylinderValidator(double small_width, double small_height, double large_width, double large_height, double out_distance_cap)
Constructs a new CylinderValidator object with specified width and height.
double large_getRadius() const
Gets the radius of the cylinder for large cones.
double out_distance_cap
Minimum out_distance value for it to be 0.
double small_height
Height of the cylinder for a small cone.
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)