6 #include <vision_module/Tools/LineSegment.hpp>
7 #include <vision_module/Tools/LinearInterpolator.hpp>
20 inline bool checkValidity()
23 return !LLow.Intersect(LHigh, tmp);
27 LLow(_LLow), LHigh(_LHigh)
32 "Conflict in input for LinearBoundaryChecker");
37 double nearMax,
double farDistance,
double farMin,
double farMax)
39 LLow.P1 = Point2d(nearDistance, nearMin);
40 LLow.P2 = Point2d(farDistance, farMin);
42 LHigh.P1 = Point2d(nearDistance, nearMax);
43 LHigh.P2 = Point2d(farDistance, farMax);
47 "Conflict in input for LinearBoundaryChecker");
51 inline bool CheckExtrapolation(
double distance,
55 Point2d(distance, 10));
56 Point2d resLowerBand, resUpperBand;
57 if (LLow.IntersectLineForm(verLine, resLowerBand)
58 && LHigh.IntersectLineForm(verLine, resUpperBand))
60 if (value >= resLowerBand.y && value <= resUpperBand.y)
67 ROS_ERROR(
"Error in programming %f", distance);
74 inline bool GetExtrapolation(
double distance,
75 double &min,
double &max)
78 Point2d(distance, 10));
79 Point2d resLowerBand, resUpperBand;
81 if (LLow.IntersectLineForm(verLine, resLowerBand)
82 && LHigh.IntersectLineForm(verLine, resUpperBand))
84 if (resUpperBand.y > resLowerBand.y)
93 ROS_ERROR(
"Error in programming %f", distance);
98 inline bool CheckInside(
double distance,
double value)
101 double max_y = std::max(LLow.P1.y,
102 std::max(LLow.P2.y, std::max(LHigh.P1.y, LHigh.P2.y)));
103 LineSegment verLine(Point2d(distance, 0), Point2d(distance, max_y));
104 Point2d resLowerBand, resUpperBand;
105 if (LLow.Intersect(verLine, resLowerBand)
106 && LHigh.Intersect(verLine, resUpperBand))
108 if (value >= resLowerBand.y && value <= resUpperBand.y)
A class representing line segments.
Definition: LineSegment.hpp:17
A class for check if a point is between two given line segments.
Definition: LinearBoundaryChecker.hpp:15