28 #include "modules/common/proto/pnc_point.pb.h" 30 #include "modules/map/proto/map.pb.h" 31 #include "modules/map/proto/map_geometry.pb.h" 32 #include "modules/planning/proto/sl_boundary.pb.h" 34 #include "modules/routing/proto/routing.pb.h" 43 template <
typename Iterator>
45 : reference_points_(begin, end),
46 map_path_(
std::move(
std::vector<hdmap::MapPathPoint>(begin, end))) {}
75 const double distance_forward);
77 bool Segment(
const double s,
const double distance_backward,
78 const double distance_forward);
86 const common::PathPoint& path_point)
const;
88 std::pair<std::array<double, 3>, std::array<double, 3>>
ToFrenetFrame(
89 const common::TrajectoryPoint& traj_point)
const;
99 const double end_s)
const;
106 const double start_s,
const double end_s,
107 SLBoundary*
const sl_boundary)
const;
109 SLBoundary*
const sl_boundary)
const;
111 SLBoundary*
const sl_boundary)
const;
113 bool SLToXY(
const common::SLPoint& sl_point,
116 common::SLPoint*
const sl_point)
const;
117 template <
class XYPo
int>
118 bool XYToSL(
const XYPoint& xy, common::SLPoint*
const sl_point)
const {
122 bool GetLaneWidth(
const double s,
double*
const lane_left_width,
123 double*
const lane_right_width)
const;
127 bool GetRoadWidth(
const double s,
double*
const road_left_width,
128 double*
const road_right_width)
const;
130 hdmap::Road::Type
GetRoadType(
const double s)
const;
133 std::vector<hdmap::LaneInfoConstPtr>* lanes)
const;
140 bool IsOnLane(
const common::SLPoint& sl_point)
const;
142 template <
class XYPo
int>
146 bool IsOnLane(
const SLBoundary& sl_boundary)
const;
152 bool IsOnRoad(
const common::SLPoint& sl_point)
const;
154 bool IsOnRoad(
const SLBoundary& sl_boundary)
const;
177 void AddSpeedLimit(
double start_s,
double end_s,
double speed_limit);
211 static double FindMinDistancePoint(
const ReferencePoint& p0,
const double s0,
213 const double x,
const double y);
217 double start_s = 0.0;
219 double speed_limit = 0.0;
220 SpeedLimit() =
default;
221 SpeedLimit(
double _start_s,
double _end_s,
double _speed_limit)
222 : start_s(_start_s), end_s(_end_s), speed_limit(_speed_limit) {}
227 std::vector<SpeedLimit> speed_limit_;
228 std::vector<ReferencePoint> reference_points_;
230 uint32_t priority_ = 0;
double Length() const
Definition: reference_line.h:171
size_t GetNearestReferenceIndex(const double s) const
void GetLaneFromS(const double s, std::vector< hdmap::LaneInfoConstPtr > *lanes) const
bool Segment(const common::math::Vec2d &point, const double distance_backward, const double distance_forward)
ReferencePoint GetReferencePoint(const double s) const
bool IsOnRoad(const common::SLPoint &sl_point) const
: check if a box/point is on road (not on sideways/medians) along reference line
bool GetSLBoundary(const common::math::Box2d &box, SLBoundary *const sl_boundary) const
bool XYToSL(const common::math::Vec2d &xy_point, common::SLPoint *const sl_point) const
double GetSpeedLimitFromS(const double s) const
hdmap::Road::Type GetRoadType(const double s) const
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Planning module main class. It processes GPS and IMU as input, to generate planning info...
ReferenceLine(const Iterator begin, const Iterator end)
Definition: reference_line.h:44
std::string DebugString() const
Definition: reference_point.h:32
const hdmap::Path & map_path() const
bool GetRoadWidth(const double s, double *const road_left_width, double *const road_right_width) const
std::vector< ReferencePoint > GetReferencePoints(double start_s, double end_s) const
double GetDrivingWidth(const SLBoundary &sl_boundary) const
Rectangular (undirected) bounding box in 2-D.
Definition: box2d.h:52
bool GetApproximateSLBoundary(const common::math::Box2d &box, const double start_s, const double end_s, SLBoundary *const sl_boundary) const
const std::vector< ReferencePoint > & reference_points() const
bool SLToXY(const common::SLPoint &sl_point, common::math::Vec2d *const xy_point) const
Implements a class of 2-dimensional vectors.
Definition: vec2d.h:42
bool IsOnLane(const common::SLPoint &sl_point) const
: check if a box/point is on lane along reference line
void AddSpeedLimit(double start_s, double end_s, double speed_limit)
const hdmap::Path & GetMapPath() const
Definition: reference_line.h:183
ReferencePoint GetNearestReferencePoint(const common::math::Vec2d &xy) const
uint32_t GetPriority() const
Definition: reference_line.h:179
std::pair< std::array< double, 3 >, std::array< double, 3 > > ToFrenetFrame(const common::TrajectoryPoint &traj_point) const
bool Stitch(const ReferenceLine &other)
Definition: reference_line.h:39
double length() const
Definition: path.h:284
bool GetLaneWidth(const double s, double *const lane_left_width, double *const lane_right_width) const
bool GetOffsetToMap(const double s, double *l_offset) const
bool HasOverlap(const common::math::Box2d &box) const
check if any part of the box has overlap with the road.
common::FrenetFramePoint GetFrenetPoint(const common::PathPoint &path_point) const
void SetPriority(uint32_t priority)
Definition: reference_line.h:181
bool IsOnLane(const XYPoint &xy) const
Definition: reference_line.h:143
std::vector< hdmap::LaneSegment > GetLaneSegments(const double start_s, const double end_s) const
bool XYToSL(const XYPoint &xy, common::SLPoint *const sl_point) const
Definition: reference_line.h:118
bool IsBlockRoad(const common::math::Box2d &box2d, double gap) const
Check if a box is blocking the road surface. The criteria is to check whether the remaining space on ...