Apollo 10.0
自动驾驶开放平台
apollo::prediction::ExtrapolationPredictor类 参考

#include <extrapolation_predictor.h>

类 apollo::prediction::ExtrapolationPredictor 继承关系图:
apollo::prediction::ExtrapolationPredictor 的协作图:

Public 成员函数

 ExtrapolationPredictor ()
 Constructor
 
virtual ~ExtrapolationPredictor ()=default
 Destructor
 
bool Predict (const ADCTrajectoryContainer *adc_trajectory_container, Obstacle *obstacle, ObstaclesContainer *obstacles_container) override
 Make prediction
 
- Public 成员函数 继承自 apollo::prediction::SequencePredictor
 SequencePredictor ()=default
 Constructor
 
virtual ~SequencePredictor ()=default
 Destructor
 
bool Predict (const ADCTrajectoryContainer *adc_trajectory_container, Obstacle *obstacle, ObstaclesContainer *obstacles_container) override
 Make prediction
 
 FRIEND_TEST (SequencePredictorTest, General)
 
- Public 成员函数 继承自 apollo::prediction::Predictor
 Predictor ()=default
 Constructor
 
virtual ~Predictor ()=default
 Destructor
 
int NumOfTrajectories (const Obstacle &obstacle)
 Get trajectory size
 
void TrimTrajectories (const ADCTrajectoryContainer &adc_trajectory_container, Obstacle *obstacle)
 Trim prediction trajectories by adc trajectory
 
const ObstacleConf::PredictorTypepredictor_type ()
 get the predictor type
 

额外继承的成员函数

- Public 类型 继承自 apollo::prediction::SequencePredictor
enum class  LaneChangeType {
  LEFT , RIGHT , STRAIGHT , ONTO_LANE ,
  INVALID
}
 
- Protected 成员函数 继承自 apollo::prediction::SequencePredictor
bool GetLongitudinalPolynomial (const Obstacle &obstacle, const LaneSequence &lane_sequence, const std::pair< double, double > &lon_end_state, std::array< double, 5 > *coefficients)
 
bool GetLateralPolynomial (const Obstacle &obstacle, const LaneSequence &lane_sequence, const double time_to_end_state, std::array< double, 4 > *coefficients)
 
void FilterLaneSequences (const Feature &feature, const std::string &lane_id, const Obstacle *ego_vehicle_ptr, const ADCTrajectoryContainer *adc_trajectory_container, std::vector< bool > *enable_lane_sequence)
 Filter lane sequences
 
LaneChangeType GetLaneChangeType (const std::string &lane_id, const LaneSequence &lane_sequence)
 Get lane change type
 
double GetLaneChangeDistanceWithADC (const LaneSequence &lane_sequence, const Obstacle *ego_vehicle_ptr, const ADCTrajectoryContainer *adc_trajectory_container)
 Get lane change distance with ADC
 
void DrawConstantAccelerationTrajectory (const Obstacle &obstacle, const LaneSequence &lane_sequence, const double total_time, const double period, const double acceleration, std::vector< apollo::common::TrajectoryPoint > *points)
 Draw constant acceleration trajectory points
 
double GetLaneSequenceCurvatureByS (const LaneSequence &lane_sequence, const double s)
 Get lane sequence curvature by s
 
void Clear ()
 Clear private members
 
std::string ToString (const LaneSequence &sequence)
 Convert a lane sequence to string
 
- Protected 成员函数 继承自 apollo::prediction::Predictor
void SetEqualProbability (const double probability, const int start_index, Obstacle *obstacle_ptr)
 Set equal probability to prediction trajectories
 
bool TrimTrajectory (const ADCTrajectoryContainer &adc_trajectory_container, Obstacle *obstacle, Trajectory *trajectory)
 Trim a single prediction trajectory, keep the portion that is not in junction.
 
bool SupposedToStop (const Feature &feature, const double stop_distance, double *acceleration)
 Determine if an obstacle is supposed to stop within a distance
 
- 静态 Protected 成员函数 继承自 apollo::prediction::Predictor
static Trajectory GenerateTrajectory (const std::vector< apollo::common::TrajectoryPoint > &points)
 Generate trajectory from trajectory points
 
- Protected 属性 继承自 apollo::prediction::Predictor
ObstacleConf::PredictorType predictor_type_
 

详细描述

在文件 extrapolation_predictor.h32 行定义.

构造及析构函数说明

◆ ExtrapolationPredictor()

apollo::prediction::ExtrapolationPredictor::ExtrapolationPredictor ( )

Constructor

在文件 extrapolation_predictor.cc30 行定义.

◆ ~ExtrapolationPredictor()

virtual apollo::prediction::ExtrapolationPredictor::~ExtrapolationPredictor ( )
virtualdefault

Destructor

成员函数说明

◆ Predict()

bool apollo::prediction::ExtrapolationPredictor::Predict ( const ADCTrajectoryContainer adc_trajectory_container,
Obstacle obstacle,
ObstaclesContainer obstacles_container 
)
overridevirtual

Make prediction

参数
ADCtrajectory container
Obstaclepointer
Obstaclescontainer
返回
If predicted successfully

实现了 apollo::prediction::Predictor.

在文件 extrapolation_predictor.cc34 行定义.

36 {
37 Clear();
38
39 CHECK_NOTNULL(obstacle);
40 CHECK_GT(obstacle->history_size(), 0U);
41
42 obstacle->SetPredictorType(predictor_type_);
43
44 Feature* feature_ptr = obstacle->mutable_latest_feature();
45
46 if (!feature_ptr->lane().has_lane_graph()) {
47 AERROR << "Obstacle [" << obstacle->id() << "] has no lane graph.";
48 return false;
49 }
50 if (feature_ptr->predicted_trajectory().empty()) {
51 AERROR << "Obstacle [" << obstacle->id()
52 << "] has no short-term trajectories.";
53 return false;
54 }
55 auto* cluster_ptr = obstacles_container->GetClustersPtr();
56 for (int i = 0; i < feature_ptr->predicted_trajectory_size(); ++i) {
57 Trajectory* trajectory_ptr = feature_ptr->mutable_predicted_trajectory(i);
58 PostProcess(trajectory_ptr, cluster_ptr);
59 }
60 return true;
61}
#define AERROR
Definition log.h:44

该类的文档由以下文件生成: