4 double small_max_height,
double height_cap)
5 : _min_height_(min_height),
6 _large_max_height_(large_max_height),
7 _small_max_height_(small_max_height),
8 _height_cap_(height_cap) {}
15 float x0 = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointX(indices[0])]);
16 float y0 = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointY(indices[0])]);
17 float z0 = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointZ(indices[0])]);
22 Eigen::Vector3f maxPoint(x0, y0, z0);
24 for (
size_t i = 1; i < indices.size(); ++i) {
25 float x = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointX(indices[i])]);
26 float y = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointY(indices[i])]);
27 float z = *
reinterpret_cast<const float*
>(&cloud_data[
LidarPoint::PointZ(indices[i])]);
30 if (distance > maxZ) {
32 maxPoint = Eigen::Vector3f(x, y, z);
36 std::vector<double> res;
37 double r1 = 0, r2 = 0;
Represents a cluster of 3D points using PCL (Point Cloud Library).
void set_is_large()
Set cluster as a contender for a large cone.
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.
double _small_max_height_
Max Height treshhold for small cones */.
HeightValidator(double min_height, double large_max_height, double small_max_height, double height_cap)
Constructs a new HeightValidator object with the specified height threshold.
double _height_cap_
Minimum ratio result needed for return values to not be 0. */.
double _min_height_
Min Height threshold for cone validation */.
std::vector< double > coneValidator(Cluster *cone_point_cloud, Plane &plane) const override
Validates a cone based on its height relative to a plane.
double _large_max_height_
Max Height threshold for large cones */.
The Plane class represents a 3D plane defined by its equation ax + by + cz + d = 0.
double get_distance_to_point(float x, float y, float z) const
Calculates the distance from a point to the plane.
constexpr size_t PointZ(size_t idx)
constexpr size_t PointX(size_t idx)
constexpr size_t PointY(size_t idx)