Apollo  6.0
Open source self driving car software
extrapolation_predictor.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2019 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 
22 #pragma once
23 
24 #include <string>
25 
28 
29 namespace apollo {
30 namespace prediction {
31 
33  public:
38 
42  virtual ~ExtrapolationPredictor() = default;
43 
51  bool Predict(const ADCTrajectoryContainer* adc_trajectory_container,
52  Obstacle* obstacle,
53  ObstaclesContainer* obstacles_container) override;
54 
55  private:
56  struct LaneSearchResult {
57  bool found = false;
58  std::string lane_id = "";
59  int point_index = -1;
60  };
61 
62  void PostProcess(Trajectory* trajectory_ptr, ObstacleClusters* clusters_ptr);
63 
64  LaneSearchResult SearchExtrapolationLane(const Trajectory& trajectory,
65  const int num_tail_point);
66 
67  void ExtrapolateByLane(const LaneSearchResult& lane_search_result,
68  const double extrapolation_speed,
69  Trajectory* trajectory_ptr,
70  ObstacleClusters* clusters_ptr);
71 
72  void ExtrapolateByFreeMove(const int num_tail_point,
73  const double extrapolation_speed,
74  Trajectory* trajectory_ptr);
75 
76  double ComputeExtraplationSpeed(const int num_tail_point,
77  const Trajectory& trajectory);
78 };
79 
80 } // namespace prediction
81 } // namespace apollo
Prediction obstacle.
Definition: obstacle.h:52
Define the sequence predictor base class.
Definition: obstacles_container.h:39
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: sequence_predictor.h:35
Definition: extrapolation_predictor.h:32
Definition: obstacle_clusters.h:33
bool Predict(const ADCTrajectoryContainer *adc_trajectory_container, Obstacle *obstacle, ObstaclesContainer *obstacles_container) override
Make prediction.
virtual ~ExtrapolationPredictor()=default
Destructor.
Definition: adc_trajectory_container.h:37