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"
65 bool Init(
const std::vector<const Obstacle*>& obstacles,
double target_speed);
67 bool AddObstacles(
const std::vector<const Obstacle*>& obstacles);
86 double Cost()
const {
return cost_; }
87 void AddCost(
double cost) { cost_ += cost; }
88 void SetCost(
double cost) { cost_ = cost; }
97 cruise_speed_ = speed;
98 base_cruise_speed_ = speed;
115 double* ptr_lane_width)
const;
142 const double relative_time,
const double start_s,
149 const std::vector<common::TrajectoryPoint>&
trajectory,
185 const bool is_protected)
const;
195 return offset_to_other_reference_line_;
198 offset_to_other_reference_line_ = offset;
204 std::vector<PathBoundary>&& candidate_path_boundaries);
230 return trajectory_type_;
250 const std::vector<std::pair<OverlapType, hdmap::PathOverlap>>&
252 return first_encounter_overlaps_;
270 const std::string& overlap_id,
const OverlapType& overlap_type)
const;
273 std::size_t
key()
const {
return key_; }
276 std::size_t
index()
const {
return index_; }
279 std::string
id()
const {
return id_; }
282 double start_s,
double end_s);
290 void InitFirstOverlaps();
292 bool CheckChangeLane()
const;
294 void SetTurnSignalBasedOnLaneTurnType(
299 bool IsIrrelevantObstacle(
const Obstacle& obstacle);
301 void MakeDecision(DecisionResult* decision_result,
304 int MakeMainStopDecision(DecisionResult* decision_result)
const;
306 void MakeMainMissionCompleteDecision(DecisionResult* decision_result,
309 void MakeEStopDecision(DecisionResult* decision_result)
const;
311 void SetObjectDecisions(ObjectDecisions* object_decisions)
const;
313 bool AddObstacleHelper(
const std::shared_ptr<Obstacle>& obstacle);
315 bool GetFirstOverlap(
const std::vector<hdmap::PathOverlap>& path_overlaps,
318 bool IsEgoOnRoutingLane()
const;
321 static std::unordered_map<std::string, bool> junction_right_of_way_map_;
332 bool is_drivable_ =
true;
336 Obstacle* blocking_obstacle_ =
nullptr;
338 std::vector<PathBoundary> candidate_path_boundaries_;
339 std::vector<PathData> candidate_path_data_;
341 std::vector<double> reference_line_towing_l_;
363 bool is_on_reference_line_ =
false;
365 bool is_path_lane_borrow_ =
false;
369 double offset_to_other_reference_line_ = 0.0;
371 double priority_cost_ = 0.0;
381 std::vector<std::pair<OverlapType, hdmap::PathOverlap>>
382 first_encounter_overlaps_;
392 double cruise_speed_ = 0.0;
393 double base_cruise_speed_ = 0.0;
395 bool path_reusable_ =
false;
396 std::string id_ =
"";
397 std::size_t key_ = 0;
398 std::size_t index_ = 0;
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)
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
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