27#include <unordered_map>
31#include "modules/common/vehicle_state/proto/vehicle_state.pb.h"
32#include "modules/common_msgs/basic_msgs/drive_state.pb.h"
33#include "modules/common_msgs/basic_msgs/pnc_point.pb.h"
34#include "modules/common_msgs/planning_msgs/planning.pb.h"
35#include "modules/planning/planning_base/proto/lattice_structure.pb.h"
66 bool Init(
const std::vector<const Obstacle*>& obstacles,
double target_speed);
68 bool AddObstacles(
const std::vector<const Obstacle*>& obstacles);
87 double Cost()
const {
return cost_; }
88 void AddCost(
double cost) { cost_ += cost; }
89 void SetCost(
double cost) { cost_ = cost; }
98 cruise_speed_ = speed;
99 base_cruise_speed_ = speed;
116 double* ptr_lane_width)
const;
143 const double relative_time,
const double start_s,
150 const std::vector<common::TrajectoryPoint>&
trajectory,
186 const bool is_protected)
const;
196 return offset_to_other_reference_line_;
199 offset_to_other_reference_line_ = offset;
205 std::vector<PathBoundary>&& candidate_path_boundaries);
231 return trajectory_type_;
251 const std::vector<std::pair<OverlapType, hdmap::PathOverlap>>&
253 return first_encounter_overlaps_;
271 const std::string& overlap_id,
const OverlapType& overlap_type)
const;
274 std::size_t
key()
const {
return key_; }
277 std::size_t
index()
const {
return index_; }
280 std::string
id()
const {
return id_; }
283 double start_s,
double end_s);
294 void InitFirstOverlaps();
296 bool CheckChangeLane()
const;
298 void SetTurnSignalBasedOnLaneTurnType(
303 bool IsIrrelevantObstacle(
const Obstacle& obstacle);
305 void MakeDecision(DecisionResult* decision_result,
308 int MakeMainStopDecision(DecisionResult* decision_result)
const;
310 void MakeMainMissionCompleteDecision(DecisionResult* decision_result,
313 void MakeEStopDecision(DecisionResult* decision_result)
const;
315 void SetObjectDecisions(ObjectDecisions* object_decisions)
const;
317 bool AddObstacleHelper(
const std::shared_ptr<Obstacle>& obstacle);
319 bool GetFirstOverlap(
const std::vector<hdmap::PathOverlap>& path_overlaps,
322 bool IsEgoOnRoutingLane()
const;
325 static std::unordered_map<std::string, bool> junction_right_of_way_map_;
336 bool is_drivable_ =
true;
340 Obstacle* blocking_obstacle_ =
nullptr;
342 std::vector<PathBoundary> candidate_path_boundaries_;
343 std::vector<PathData> candidate_path_data_;
345 std::vector<double> reference_line_towing_l_;
367 bool is_on_reference_line_ =
false;
369 bool is_path_lane_borrow_ =
false;
373 double offset_to_other_reference_line_ = 0.0;
375 double priority_cost_ = 0.0;
385 std::vector<std::pair<OverlapType, hdmap::PathOverlap>>
386 first_encounter_overlaps_;
396 double cruise_speed_ = 0.0;
397 double base_cruise_speed_ = 0.0;
399 bool path_reusable_ =
false;
400 std::string id_ =
"";
401 std::size_t key_ = 0;
402 std::size_t index_ = 0;
403 std::vector<SLPolygon> obs_sl_polygons_;
This is the class that associates an Obstacle with its path properties.
PathDecision represents all obstacle decisions on one path.
ReferenceLineInfo holds all data for one reference line.
void SetBlockingObstacle(const std::string &blocking_obstacle_id)
std::list< hdmap::Id > TargetLaneId() const
std::vector< double > * mutable_reference_line_towing_l()
void GetRangeOverlaps(std::vector< hdmap::PathOverlap > *path_overlaps, double start_s, double end_s)
const PathBoundary & reference_line_towing_path_boundary() const
bool path_reusable() const
LatencyStats * mutable_latency_stats()
PathDecision * path_decision()
void SetCandidatePathData(std::vector< PathData > &&candidate_path_data)
void SetTrajectory(const DiscretizedTrajectory &trajectory)
void AddCost(double cost)
const std::vector< SLPolygon > & obs_sl_polygons() const
void set_is_path_lane_borrow(const bool is_path_lane_borrow)
double SDistanceToRefEnd() const
void SetLatticeStopPoint(const StopPoint &stop_point)
void set_index(std::size_t index)
const common::VehicleState & vehicle_state() const
bool GetNeighborLaneInfo(const ReferenceLineInfo::LaneType lane_type, const double s, hdmap::Id *ptr_lane_id, double *ptr_lane_width) const
const LatencyStats & latency_stats() const
int GetJunction(const double s, hdmap::PathOverlap *junction_overlap) const
const std::vector< PathData > & GetCandidatePathData() const
StGraphData * mutable_st_graph_data()
void SetLatticeCruiseSpeed(double speed)
hdmap::Lane::LaneTurn GetPathTurnType(const double s) const
void set_trajectory_type(const ADCTrajectory::TrajectoryType trajectory_type)
void SetDrivable(bool drivable)
Set if the vehicle can drive following this reference line A planner need to set this value to true i...
const SpeedData & speed_data() const
void SetPriorityCost(double cost)
const std::vector< PathBoundary > & GetCandidatePathBoundaries() const
SpeedData * mutable_speed_data()
bool AddObstacles(const std::vector< const Obstacle * > &obstacles)
void set_key(std::size_t key)
bool CombinePathAndSpeedProfile(const double relative_time, const double start_s, DiscretizedTrajectory *discretized_trajectory)
void set_id(std::string id)
bool IsNeighborLanePath() const
Check if the current reference line is the neighbor of the vehicle current position
double GetCruiseSpeed() const
void ExportDecision(DecisionResult *decision_result, PlanningContext *planning_context) const
Obstacle * GetBlockingObstacle() const
const RSSInfo & rss_info() const
const std::vector< double > & reference_line_towing_l() const
bool GetIntersectionRightofWayStatus(const hdmap::PathOverlap &pnc_junction_overlap) const
std::vector< SLPolygon > * mutable_obs_sl_polygons()
const PlanningTarget & planning_target() const
uint32_t GetPriority() const
double PriorityCost() const
void LimitCruiseSpeed(double speed)
Limit the cruise speed based on the "base_cruise_speed_".
void SetTurnSignal(const common::VehicleSignal::TurnSignal &turn_signal)
PathBoundary * mutable_reference_line_towing_path_boundary()
RSSInfo * mutable_rss_info()
std::size_t index() const
void SetCruiseSpeed(double speed)
bool is_path_lane_borrow() const
void SetCost(double cost)
bool IsStartFrom(const ReferenceLineInfo &previous_reference_line_info) const
check if current reference line is started from another reference line info line.
void set_is_on_reference_line()
const planning_internal::Debug & debug() const
const hdmap::RouteSegments & Lanes() const
const StGraphData & st_graph_data()
bool Init(const std::vector< const Obstacle * > &obstacles, double target_speed)
ADCTrajectory::RightOfWayStatus GetRightOfWayStatus() const
const ReferenceLine & reference_line() const
std::vector< common::SLPoint > GetAllStopDecisionSLPoint() const
hdmap::PathOverlap * GetOverlapOnReferenceLine(const std::string &overlap_id, const OverlapType &overlap_type) const
const PathData & path_data() const
const PathData & fallback_path_data() const
void SetCandidatePathBoundaries(std::vector< PathBoundary > &&candidate_path_boundaries)
const std::vector< std::pair< OverlapType, hdmap::PathOverlap > > & FirstEncounteredOverlaps() const
void set_path_reusable(const bool path_reusable)
void ExportEngageAdvice(common::EngageAdvice *engage_advice, PlanningContext *planning_context) const
const DiscretizedTrajectory & trajectory() const
double GetBaseCruiseSpeed() const
PathData * mutable_fallback_path_data()
Obstacle * AddObstacle(const Obstacle *obstacle)
double SDistanceToDestination() const
planning_internal::Debug * mutable_debug()
double OffsetToOtherReferenceLine() const
hdmap::LaneInfoConstPtr LocateLaneInfo(const double s) const
std::vector< PathData > * MutableCandidatePathData()
const SLBoundary & AdcSlBoundary() const
int GetArea(const double s, hdmap::PathOverlap *area_overlap) const
void SetJunctionRightOfWay(const double junction_s, const bool is_protected) const
bool AdjustTrajectoryWhichStartsFromCurrentPos(const common::TrajectoryPoint &planning_start_point, const std::vector< common::TrajectoryPoint > &trajectory, DiscretizedTrajectory *adjusted_trajectory)
ADCTrajectory::TrajectoryType trajectory_type() const
void SetOffsetToOtherReferenceLine(const double offset)
bool IsChangeLanePath() const
Check if the current reference line is a change lane reference line, i.e., ADC's current position is ...
void SetPriority(uint32_t priority)
ReferenceLineInfo()=default
ReferenceLine * mutable_reference_line()
bool ReachedDestination() const
void PrintReferenceSegmentDebugString()
PathData * mutable_path_data()
int GetPnCJunction(const double s, hdmap::PathOverlap *pnc_junction_overlap) const
std::string PathSpeedDebugString() const
uint32_t GetPriority() const
void SetPriority(uint32_t priority)
Planning module main class.
#define DISALLOW_COPY_AND_ASSIGN(classname)
std::shared_ptr< const LaneInfo > LaneInfoConstPtr
: data with map info and obstacle info