Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
npoints_validator.cpp
Go to the documentation of this file.
2
3NPointsValidator::NPointsValidator(long unsigned int min_n_points) : _min_n_points_(min_n_points) {}
4
5std::vector<double> NPointsValidator::coneValidator(Cluster* cone_point_cloud,
6 [[maybe_unused]] Plane& plane) const {
7 // index 0 = if below minimum number of points, else 1. No confidence implemented to further
8 // punish small clusters.
9 if (cone_point_cloud->get_point_indices().size() >= _min_n_points_) {
10 return {1.0};
11 } else {
12 return {0.0};
13 }
14}
Represents a cluster of 3D points using PCL (Point Cloud Library).
Definition cluster.hpp:14
const std::vector< int > & get_point_indices()
Get the Point Cloud data of the cluster.
Definition cluster.cpp:44
std::vector< double > coneValidator(Cluster *cone_point_cloud, Plane &plane) const override
Validates a cone based on its number of points.
NPointsValidator(long unsigned int min_n_points)
Constructs a new HeightValidator object with the specified height threshold.
long unsigned int _min_n_points_
The Plane class represents a 3D plane defined by its equation ax + by + cz + d = 0.
Definition plane.hpp:12