2#include <sensor_msgs/msg/point_cloud2.hpp>
19 explicit Cluster(
const sensor_msgs::msg::PointCloud2::SharedPtr& point_cloud,
20 const std::vector<int>& point_indices);
45 void set_color(
const std::string& new_color);
87 void set_z_score(
double mean_x,
double std_dev_x,
double mean_y,
double std_dev_y);
111 std::vector<Cluster>& clusters);
118 static void set_z_scores(std::vector<Cluster>& clusters);
132 const sensor_msgs::msg::PointCloud2::SharedPtr
Concrete Class representing a centroid-based method for estimating the center position of a cone.
Concrete class representing a circumference-based method for estimating the center position of a cone...
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.
void set_confidence(double newConfidence)
Set the Confidence of the cluster to be or not to be a cone.
double get_z_score_y() const
Get the z score on y-axis of an object.
void set_z_score(double mean_x, double std_dev_x, double mean_y, double std_dev_y)
Set the z score object on the x and y axis.
std::string _color_
Color associated with the cluster.
double _confidence_
Confidence on the cluster to be (or not) a cone.
const sensor_msgs::msg::PointCloud2::SharedPtr & get_point_cloud()
Get the Point Cloud data of the cluster.
double get_z_score_x() const
Get the z score on x-axis of an object.
bool _center_is_defined_
Flag indicating whether the center is defined or not.
std::vector< int > _point_indices_
Indices of points in the cluster.
Eigen::Vector4f _center_
Center of the cone's cluster.
double get_confidence()
Get the Confidence of the cluster to be (or not to be) a cone.
static void set_z_scores(std::vector< Cluster > &clusters)
Set the z scores object on every cluster of the vector.
Eigen::Vector4f _centroid_
Centroid of the cluster.
std::string get_color()
Get the color associated with the cluster.
Eigen::Vector4f get_center(Plane &plane)
Get the Center of the cone's cluster.
Eigen::Vector4f get_centroid()
Get the centroid of the cluster.
bool get_is_large()
Get cluster's corresponding cone size.
const sensor_msgs::msg::PointCloud2::SharedPtr _point_cloud_
Point cloud data for the cluster.
void set_color(const std::string &new_color)
Set the color for the cluster.
bool _is_large_
Flag indicating the size of the cluster :
static constexpr auto center_calculator
Calculates the center of the cone.
bool _centroid_is_defined_
Flag indicating whether the centroid is defined or not.
static std::tuple< double, double, double, double > calculate_mean_and_std_dev(std::vector< Cluster > &clusters)
Calculates the mean and standard deviation on x and y axis.
void set_point_indices(const std::vector< int > &new_point_indices)
Set the Point Cloud data for the cluster.
static constexpr auto centroid_calculator
Calculates the centroid of the cluster.
The Plane class represents a 3D plane defined by its equation ax + by + cz + d = 0.