28 #include "gtest/gtest_prod.h" 33 #include "modules/planning/proto/planning.pb.h" 46 const std::vector<std::pair<STPoint, STPoint>>& point_pairs,
47 bool is_accurate_boundary =
false);
60 const std::vector<STPoint>& lower_points,
61 const std::vector<STPoint>& upper_points);
67 bool IsEmpty()
const {
return lower_points_.empty(); }
70 double* s_lower)
const;
73 double* s_lower)
const;
76 double* ds_lower)
const;
92 const std::string&
id()
const;
95 void set_id(
const std::string&
id);
100 double min_t()
const;
101 double max_s()
const;
102 double max_t()
const;
127 obstacle_road_right_ending_t_ = road_right_ending_t;
130 return obstacle_road_right_ending_t_;
137 const std::vector<std::pair<STPoint, STPoint>>& point_pairs)
const;
151 void RemoveRedundantPoints(
152 std::vector<std::pair<STPoint, STPoint>>* point_pairs);
153 FRIEND_TEST(StBoundaryTest, remove_redundant_points);
159 bool GetIndexRange(
const std::vector<STPoint>& points,
const double t,
160 size_t* left,
size_t* right)
const;
161 FRIEND_TEST(StBoundaryTest, get_index_range);
166 std::vector<STPoint> upper_points_;
167 std::vector<STPoint> lower_points_;
170 double characteristic_length_ = 1.0;
171 double min_s_ = std::numeric_limits<double>::max();
172 double max_s_ = std::numeric_limits<double>::lowest();
173 double min_t_ = std::numeric_limits<double>::max();
174 double max_t_ = std::numeric_limits<double>::lowest();
181 double obstacle_road_right_ending_t_;
const std::string & id() const
void set_bottom_left_point(STPoint st_point)
STBoundary ExpandByT(const double t) const
static STBoundary CreateInstanceAccurate(const std::vector< STPoint > &lower_points, const std::vector< STPoint > &upper_points)
Wrapper of the constructor. It doesn't use RemoveRedundantPoints and generates an accurate ST-boundar...
void SetCharacteristicLength(const double characteristic_length)
std::vector< STPoint > lower_points() const
Definition: st_boundary.h:105
STPoint upper_right_point() const
void set_obstacle_road_right_ending_t(double road_right_ending_t)
Definition: st_boundary.h:126
bool IsEmpty() const
Definition: st_boundary.h:67
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
void set_upper_right_point(STPoint st_point)
Planning module main class. It processes GPS and IMU as input, to generate planning info...
The class of polygon in 2-D.
Definition: polygon2d.h:43
void set_bottom_right_point(STPoint st_point)
bool GetBoundarySRange(const double curr_time, double *s_upper, double *s_lower) const
BoundaryType boundary_type() const
void SetBoundaryType(const BoundaryType &boundary_type)
Rectangular (undirected) bounding box in 2-D.
Definition: box2d.h:52
bool GetUnblockSRange(const double curr_time, double *s_upper, double *s_lower) const
Definition: st_boundary.h:38
double characteristic_length() const
Line segment in 2-D.
Definition: line_segment2d.h:40
Definition: st_point.h:30
Implements a class of 2-dimensional vectors.
Definition: vec2d.h:42
std::vector< STPoint > upper_points() const
Definition: st_boundary.h:104
bool IsPointInBoundary(const STPoint &st_point) const
STBoundary CutOffByT(const double t) const
~STBoundary()=default
Default destructor.
The class of Box2d. Here, the x/y axes are respectively Forward/Left, as opposed to what happens in e...
STPoint upper_left_point() const
STPoint bottom_right_point() const
void set_id(const std::string &id)
void set_upper_left_point(STPoint st_point)
Define the Polygon2d class.
STPoint bottom_left_point() const
BoundaryType
Definition: st_boundary.h:80
static STBoundary CreateInstance(const std::vector< STPoint > &lower_points, const std::vector< STPoint > &upper_points)
Wrapper of the constructor (old).
STBoundary ExpandByS(const double s) const
static std::string TypeName(BoundaryType type)
double obstacle_road_right_ending_t() const
Definition: st_boundary.h:129
const std::vector< Vec2d > & points() const
Get the vertices of the polygon.
Definition: polygon2d.h:66
bool GetBoundarySlopes(const double curr_time, double *ds_upper, double *ds_lower) const