Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
cone_evaluator.hpp
Go to the documentation of this file.
1#pragma once
2#include <gtest/gtest_prod.h>
3
5#include <limits>
6#include <rclcpp/rclcpp.hpp>
7#include <utils/cluster.hpp>
10
18public:
23 ConeEvaluator(std::shared_ptr<EvaluatorParameters> params);
24
32 bool evaluateCluster(Cluster& cluster, const GroundGrid& ground_grid);
33
34private:
35 std::shared_ptr<EvaluatorParameters> params_;
36
43 bool close_to_ground(Cluster& cluster, const GroundGrid& ground_grid) const;
44
49 bool cylinder_fits_cone(Cluster& cluster) const;
50
55 bool npoints_valid(Cluster& cluster) const;
56
57 FRIEND_TEST(ConeEvaluatorTest, CloseToGroundTrue);
58 FRIEND_TEST(ConeEvaluatorTest, CloseToGroundFalse);
59 FRIEND_TEST(ConeEvaluatorTest, CylinderFitsConeTrue);
60 FRIEND_TEST(ConeEvaluatorTest, CylinderFitsConeFalse);
61 FRIEND_TEST(ConeEvaluatorTest, NPointsValidTrue);
62 FRIEND_TEST(ConeEvaluatorTest, NPointsValidFalse);
63};
Represents a cluster of 3D points using PCL (Point Cloud Library).
Definition cluster.hpp:14
class that evaluates the cluster as a cone or not
FRIEND_TEST(ConeEvaluatorTest, CloseToGroundTrue)
bool evaluateCluster(Cluster &cluster, const GroundGrid &ground_grid)
Perform the cluster evaluation, guaranteeing they pass all validators.
FRIEND_TEST(ConeEvaluatorTest, CloseToGroundFalse)
FRIEND_TEST(ConeEvaluatorTest, CylinderFitsConeFalse)
std::shared_ptr< EvaluatorParameters > params_
bool npoints_valid(Cluster &cluster) const
Check if the number of points in the cluster is valid, according to the distance.
bool close_to_ground(Cluster &cluster, const GroundGrid &ground_grid) const
Check if the cluster is close to the ground.
FRIEND_TEST(ConeEvaluatorTest, NPointsValidTrue)
bool cylinder_fits_cone(Cluster &cluster) const
Check if a cylinder fits the cone dimensions.
FRIEND_TEST(ConeEvaluatorTest, CylinderFitsConeTrue)
FRIEND_TEST(ConeEvaluatorTest, NPointsValidFalse)
Class to represent a ground height grid for ground proximity checks.