Apollo 11.0
自动驾驶开放平台
predictor.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 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 <vector>
25
29#include "modules/common_msgs/prediction_msgs/prediction_obstacle.pb.h"
30
35namespace apollo {
36namespace prediction {
37
38class Predictor {
39 public:
43 Predictor() = default;
44
48 virtual ~Predictor() = default;
49
56 virtual bool Predict(const ADCTrajectoryContainer* adc_trajectory_container,
57 Obstacle* obstacle,
58 ObstaclesContainer* obstacles_container) = 0;
59
64 int NumOfTrajectories(const Obstacle& obstacle);
65
69 virtual void Clear();
70
76 void TrimTrajectories(const ADCTrajectoryContainer& adc_trajectory_container,
77 Obstacle* obstacle);
78
84
85 protected:
92 const std::vector<apollo::common::TrajectoryPoint>& points);
93
100 void SetEqualProbability(const double probability, const int start_index,
101 Obstacle* obstacle_ptr);
102
111 bool TrimTrajectory(const ADCTrajectoryContainer& adc_trajectory_container,
112 Obstacle* obstacle, Trajectory* trajectory);
113
121 bool SupposedToStop(const Feature& feature, const double stop_distance,
122 double* acceleration);
123
124 protected:
126};
127
128} // namespace prediction
129} // namespace apollo
ADC trajectory container
Prediction obstacle.
Definition obstacle.h:52
Predictor()=default
Constructor
const ObstacleConf::PredictorType & predictor_type()
get the predictor type
Definition predictor.cc:140
bool TrimTrajectory(const ADCTrajectoryContainer &adc_trajectory_container, Obstacle *obstacle, Trajectory *trajectory)
Trim a single prediction trajectory, keep the portion that is not in junction.
Definition predictor.cc:66
void TrimTrajectories(const ADCTrajectoryContainer &adc_trajectory_container, Obstacle *obstacle)
Trim prediction trajectories by adc trajectory
Definition predictor.cc:57
void SetEqualProbability(const double probability, const int start_index, Obstacle *obstacle_ptr)
Set equal probability to prediction trajectories
Definition predictor.cc:41
static Trajectory GenerateTrajectory(const std::vector< apollo::common::TrajectoryPoint > &points)
Generate trajectory from trajectory points
Definition predictor.cc:34
virtual bool Predict(const ADCTrajectoryContainer *adc_trajectory_container, Obstacle *obstacle, ObstaclesContainer *obstacles_container)=0
Make prediction
ObstacleConf::PredictorType predictor_type_
Definition predictor.h:125
bool SupposedToStop(const Feature &feature, const double stop_distance, double *acceleration)
Determine if an obstacle is supposed to stop within a distance
Definition predictor.cc:125
virtual void Clear()
Clear all trajectories
Definition predictor.cc:55
int NumOfTrajectories(const Obstacle &obstacle)
Get trajectory size
Definition predictor.cc:29
virtual ~Predictor()=default
Destructor
class register implement
Definition arena_queue.h:37
Obstacles container
Obstacle