Apollo  6.0
Open source self driving car software
Public Types | Public Member Functions | Protected Member Functions | List of all members
apollo::prediction::SequencePredictor Class Reference

#include <sequence_predictor.h>

Inheritance diagram for apollo::prediction::SequencePredictor:
Inheritance graph
Collaboration diagram for apollo::prediction::SequencePredictor:
Collaboration graph

Public Types

enum  LaneChangeType {
  LaneChangeType::LEFT, LaneChangeType::RIGHT, LaneChangeType::STRAIGHT, LaneChangeType::ONTO_LANE,
  LaneChangeType::INVALID
}
 

Public Member Functions

 SequencePredictor ()=default
 Constructor. More...
 
virtual ~SequencePredictor ()=default
 Destructor. More...
 
bool Predict (const ADCTrajectoryContainer *adc_trajectory_container, Obstacle *obstacle, ObstaclesContainer *obstacles_container) override
 Make prediction. More...
 
 FRIEND_TEST (SequencePredictorTest, General)
 
- Public Member Functions inherited from apollo::prediction::Predictor
 Predictor ()=default
 Constructor. More...
 
virtual ~Predictor ()=default
 Destructor. More...
 
int NumOfTrajectories (const Obstacle &obstacle)
 Get trajectory size. More...
 
void TrimTrajectories (const ADCTrajectoryContainer &adc_trajectory_container, Obstacle *obstacle)
 Trim prediction trajectories by adc trajectory. More...
 
const ObstacleConf::PredictorType & predictor_type ()
 get the predictor type More...
 

Protected Member Functions

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. More...
 
LaneChangeType GetLaneChangeType (const std::string &lane_id, const LaneSequence &lane_sequence)
 Get lane change type. More...
 
double GetLaneChangeDistanceWithADC (const LaneSequence &lane_sequence, const Obstacle *ego_vehicle_ptr, const ADCTrajectoryContainer *adc_trajectory_container)
 Get lane change distance with ADC. More...
 
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. More...
 
double GetLaneSequenceCurvatureByS (const LaneSequence &lane_sequence, const double s)
 Get lane sequence curvature by s. More...
 
void Clear ()
 Clear private members. More...
 
std::string ToString (const LaneSequence &sequence)
 Convert a lane sequence to string. More...
 
- Protected Member Functions inherited from apollo::prediction::Predictor
void SetEqualProbability (const double probability, const int start_index, Obstacle *obstacle_ptr)
 Set equal probability to prediction trajectories. More...
 
bool TrimTrajectory (const ADCTrajectoryContainer &adc_trajectory_container, Obstacle *obstacle, Trajectory *trajectory)
 Trim a single prediction trajectory, keep the portion that is not in junction. More...
 
bool SupposedToStop (const Feature &feature, const double stop_distance, double *acceleration)
 Determine if an obstacle is supposed to stop within a distance. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from apollo::prediction::Predictor
static Trajectory GenerateTrajectory (const std::vector< apollo::common::TrajectoryPoint > &points)
 Generate trajectory from trajectory points. More...
 
- Protected Attributes inherited from apollo::prediction::Predictor
ObstacleConf::PredictorType predictor_type_
 

Member Enumeration Documentation

◆ LaneChangeType

Enumerator
LEFT 
RIGHT 
STRAIGHT 
ONTO_LANE 
INVALID 

Constructor & Destructor Documentation

◆ SequencePredictor()

apollo::prediction::SequencePredictor::SequencePredictor ( )
default

Constructor.

◆ ~SequencePredictor()

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

Destructor.

Member Function Documentation

◆ Clear()

void apollo::prediction::SequencePredictor::Clear ( )
protectedvirtual

Clear private members.

Reimplemented from apollo::prediction::Predictor.

◆ DrawConstantAccelerationTrajectory()

void apollo::prediction::SequencePredictor::DrawConstantAccelerationTrajectory ( const Obstacle obstacle,
const LaneSequence &  lane_sequence,
const double  total_time,
const double  period,
const double  acceleration,
std::vector< apollo::common::TrajectoryPoint > *  points 
)
protected

Draw constant acceleration trajectory points.

Parameters
Obstacle
Lanesequence
Totalprediction time
Predictionperiod
acceleration
Avector of generated trajectory points

◆ FilterLaneSequences()

void apollo::prediction::SequencePredictor::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 
)
protected

Filter lane sequences.

Parameters
Lanegraph
Currentlane id
Egovehicle pointer
ADCtrajectory container
Vectorof boolean indicating if a lane sequence is disqualified

◆ FRIEND_TEST()

apollo::prediction::SequencePredictor::FRIEND_TEST ( SequencePredictorTest  ,
General   
)

◆ GetLaneChangeDistanceWithADC()

double apollo::prediction::SequencePredictor::GetLaneChangeDistanceWithADC ( const LaneSequence &  lane_sequence,
const Obstacle ego_vehicle_ptr,
const ADCTrajectoryContainer adc_trajectory_container 
)
protected

Get lane change distance with ADC.

Parameters
Targetlane sequence
Egovehicle pointer
ADCtrajectory container
Returns
Lane change distance with ADC

◆ GetLaneChangeType()

LaneChangeType apollo::prediction::SequencePredictor::GetLaneChangeType ( const std::string &  lane_id,
const LaneSequence &  lane_sequence 
)
protected

Get lane change type.

Parameters
Currentlane id
Lanesequence
Returns
Integer indicating lane change type:

◆ GetLaneSequenceCurvatureByS()

double apollo::prediction::SequencePredictor::GetLaneSequenceCurvatureByS ( const LaneSequence &  lane_sequence,
const double  s 
)
protected

Get lane sequence curvature by s.

Parameters
lanesequence
s
Returns
the curvature

◆ GetLateralPolynomial()

bool apollo::prediction::SequencePredictor::GetLateralPolynomial ( const Obstacle obstacle,
const LaneSequence &  lane_sequence,
const double  time_to_end_state,
std::array< double, 4 > *  coefficients 
)
protected

◆ GetLongitudinalPolynomial()

bool apollo::prediction::SequencePredictor::GetLongitudinalPolynomial ( const Obstacle obstacle,
const LaneSequence &  lane_sequence,
const std::pair< double, double > &  lon_end_state,
std::array< double, 5 > *  coefficients 
)
protected

◆ Predict()

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

Make prediction.

Parameters
ADCtrajectory container
Obstaclepointer
Obstaclescontainer
Returns
If predicted successfully

Implements apollo::prediction::Predictor.

Reimplemented in apollo::prediction::SingleLanePredictor.

◆ ToString()

std::string apollo::prediction::SequencePredictor::ToString ( const LaneSequence &  sequence)
protected

Convert a lane sequence to string.

Parameters
Lanesequence
Returns
String describing the lane sequence

The documentation for this class was generated from the following file: