28#include "gtest/gtest_prod.h"
30#include "modules/common_msgs/planning_msgs/planning.pb.h"
48 const std::vector<std::pair<STPoint, STPoint>>& point_pairs,
49 bool is_accurate_boundary =
false);
69 bool IsEmpty()
const {
return lower_points_.empty(); }
72 double* s_lower)
const;
75 double* s_lower)
const;
78 double* ds_lower)
const;
79 void PrintDebug(std::string suffix =
"")
const;
94 const std::string&
id()
const;
97 void set_id(
const std::string&
id);
101 double min_s()
const;
102 double min_t()
const;
103 double max_s()
const;
104 double max_t()
const;
129 obstacle_road_right_ending_t_ = road_right_ending_t;
132 return obstacle_road_right_ending_t_;
139 const std::vector<std::pair<STPoint, STPoint>>& point_pairs)
const;
153 void RemoveRedundantPoints(
154 std::vector<std::pair<STPoint, STPoint>>* point_pairs);
155 FRIEND_TEST(StBoundaryTest, remove_redundant_points);
161 bool GetIndexRange(
const std::vector<STPoint>&
points,
const double t,
162 size_t* left,
size_t* right)
const;
163 FRIEND_TEST(StBoundaryTest, get_index_range);
168 std::vector<STPoint> upper_points_;
169 std::vector<STPoint> lower_points_;
172 double characteristic_length_ = 1.0;
173 double min_s_ = std::numeric_limits<double>::max();
174 double max_s_ = std::numeric_limits<double>::lowest();
175 double min_t_ = std::numeric_limits<double>::max();
176 double max_t_ = std::numeric_limits<double>::lowest();
183 double obstacle_road_right_ending_t_;
Rectangular (undirected) bounding box in 2-D.
The class of polygon in 2-D.
const std::vector< Vec2d > & points() const
Get the vertices of the polygon.
Implements a class of 2-dimensional vectors.
void set_bottom_right_point(STPoint st_point)
bool GetUnblockSRange(const double curr_time, double *s_upper, double *s_lower) const
const std::string & id() const
static std::string TypeName(BoundaryType type)
bool GetBoundarySlopes(const double curr_time, double *ds_upper, double *ds_lower) const
void set_id(const std::string &id)
STBoundary()=default
Constructors: STBoundary must be initialized with a vector of ST-point pairs.
static STBoundary CreateInstance(const std::vector< STPoint > &lower_points, const std::vector< STPoint > &upper_points)
Wrapper of the constructor (old).
void set_bottom_left_point(STPoint st_point)
void SetCharacteristicLength(const double characteristic_length)
std::vector< STPoint > lower_points() const
STBoundary(const common::math::Box2d &box)=delete
std::vector< STPoint > upper_points() const
BoundaryType boundary_type() const
double obstacle_road_right_ending_t() const
STBoundary ExpandByT(const double t) const
void PrintDebug(std::string suffix="") const
~STBoundary()=default
Default destructor.
static STBoundary CreateInstanceAccurate(const std::vector< STPoint > &lower_points, const std::vector< STPoint > &upper_points)
Wrapper of the constructor.
STBoundary ExpandByS(const double s) const
void set_upper_right_point(STPoint st_point)
STPoint bottom_right_point() const
bool IsPointInBoundary(const STPoint &st_point) const
bool GetBoundarySRange(const double curr_time, double *s_upper, double *s_lower) const
STPoint bottom_left_point() const
STBoundary CutOffByT(const double t) const
STPoint upper_right_point() const
void SetBoundaryType(const BoundaryType &boundary_type)
void set_upper_left_point(STPoint st_point)
STPoint upper_left_point() const
double characteristic_length() const
void set_obstacle_road_right_ending_t(double road_right_ending_t)
STBoundary(std::vector< common::math::Vec2d > points)=delete
Planning module main class.
Define the Polygon2d class.