Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
HeightValidator Class Reference

The HeightValidator class is responsible for validating cones based on their height. More...

#include <height_validator.hpp>

Inheritance diagram for HeightValidator:
Inheritance graph
Collaboration diagram for HeightValidator:
Collaboration graph

Public Member Functions

 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.
 
std::vector< double > coneValidator (Cluster *cone_point_cloud, Plane &plane) const override
 Validates a cone based on its height relative to a plane.
 
virtual ~HeightValidator ()=default
 Virtual destructor for HeightValidator.
 

Private Attributes

double _min_height_
 Min Height threshold for cone validation *‍/.
 
double _large_max_height_
 Max Height threshold for large cones *‍/.
 
double _small_max_height_
 Max Height treshhold for small cones *‍/.
 
double _height_cap_
 Minimum ratio result needed for return values to not be 0. *‍/.
 

Detailed Description

The HeightValidator class is responsible for validating cones based on their height.

This class inherits from the ConeValidator class and overrides the coneValidator method to provide height-based validation logic.

Definition at line 11 of file height_validator.hpp.

Constructor & Destructor Documentation

◆ HeightValidator()

HeightValidator::HeightValidator ( double  min_height,
double  large_max_height,
double  small_max_height,
double  height_cap 
)
explicit

Constructs a new HeightValidator object with the specified height threshold.

Parameters
min_heightMin Height threshold for cone validation
max_heightMax Height threshold for cone validation
small_max_heightMax Height treshhold for small cones
height_capMinimum ratio result needed for return values to not be 0

Definition at line 3 of file height_validator.cpp.

◆ ~HeightValidator()

virtual HeightValidator::~HeightValidator ( )
virtualdefault

Virtual destructor for HeightValidator.

Member Function Documentation

◆ coneValidator()

std::vector< double > HeightValidator::coneValidator ( Cluster cone_point_cloud,
Plane plane 
) const
overridevirtual

Validates a cone based on its height relative to a plane.

This method overrides the coneValidator method of the base class ConeValidator. It validates whether the given cone, represented by a point cloud cluster, meets the height criteria with respect to the provided plane.

Parameters
cone_point_cloudPointer to a Cluster object representing the point cloud of the cone.
planeThe plane against which the cone's height is evaluated.
Returns
vector containing: Index 0 -> the ratio between the clusters height and the limit, 1 if inside. Index 1 -> if in height interval, how close is it to the maximum height, else 0.

Implements ConeValidator.

Definition at line 10 of file height_validator.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _height_cap_

double HeightValidator::_height_cap_
private

Minimum ratio result needed for return values to not be 0. *‍/.

Definition at line 49 of file height_validator.hpp.

◆ _large_max_height_

double HeightValidator::_large_max_height_
private

Max Height threshold for large cones *‍/.

Definition at line 47 of file height_validator.hpp.

◆ _min_height_

double HeightValidator::_min_height_
private

Min Height threshold for cone validation *‍/.

Definition at line 46 of file height_validator.hpp.

◆ _small_max_height_

double HeightValidator::_small_max_height_
private

Max Height treshhold for small cones *‍/.

Definition at line 48 of file height_validator.hpp.


The documentation for this class was generated from the following files: