4 const sensor_msgs::msg::PointCloud2::SharedPtr& point_cloud,
5 const std::vector<int>& point_indices,
const Plane& plane)
const {
6 Eigen::Vector4f centroid;
11 const auto& cloud_data = point_cloud->data;
13 for (
int idx : point_indices) {
23 size_t n = point_indices.size();
24 centroid << sum_x / n, sum_y / n, sum_z / n, 1.0f;
Eigen::Vector4f calculate_center(const sensor_msgs::msg::PointCloud2::SharedPtr &point_cloud, const std::vector< int > &point_indices, const Plane &plane=Plane()) const override
Estimates the center position of a cone using centroid calculation.