Apollo  6.0
Open source self driving car software
autotuning_raw_feature_generator.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 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 
17 #pragma once
18 
19 #include <vector>
20 
21 #include "modules/common/proto/pnc_point.pb.h"
26 #include "modules/planning/proto/auto_tuning_raw_feature.pb.h"
27 
28 namespace apollo {
29 namespace planning {
30 
32  public:
33  // @brief class constructor
34  AutotuningRawFeatureGenerator(const double time_range,
35  const size_t num_points,
36  const ReferenceLineInfo& reference_line_info,
37  const Frame& frame,
38  const SpeedLimit& speed_limit);
39 
40  // @evaluation interface
49  const std::vector<common::TrajectoryPoint>& trajectory,
50  autotuning::TrajectoryRawFeature* const trajectory_feature) const;
51 
61  const common::TrajectoryPoint& trajectory_point,
62  autotuning::TrajectoryPointRawFeature* const trajectory_point_feature)
63  const;
64 
69  const std::vector<common::SpeedPoint>& speed_profile,
70  autotuning::TrajectoryRawFeature* const trajectory_feature) const;
71 
72  private:
73  void GenerateSTBoundaries(const ReferenceLineInfo& reference_line_info);
74 
78  void ConvertToDiscretizedBoundaries(const STBoundary& boundary,
79  const double speed);
80 
81  common::Status EvaluateSpeedPoint(const common::SpeedPoint& speed_point,
82  const size_t index,
83  autotuning::TrajectoryPointRawFeature* const
84  trajectory_point_feature) const;
85 
86  private:
87  std::vector<double> eval_time_;
88  const ReferenceLineInfo& reference_line_info_;
89  const Frame& frame_;
90  const SpeedLimit& speed_limit_;
91  std::vector<const STBoundary*> boundaries_;
92 
93  // covers the boundary info lower s upper s as well as the speed of obs
94  std::vector<std::vector<std::array<double, 3>>> obs_boundaries_;
95  std::vector<std::vector<std::array<double, 3>>> stop_boundaries_;
96  std::vector<std::vector<std::array<double, 3>>> nudge_boundaries_;
97  std::vector<std::vector<std::array<double, 3>>> side_pass_boundaries_;
98 };
99 
100 } // namespace planning
101 } // namespace apollo
common::Status EvaluateTrajectory(const std::vector< common::TrajectoryPoint > &trajectory, autotuning::TrajectoryRawFeature *const trajectory_feature) const
evaluate trajectory with environment, generate model trajectory features
AutotuningRawFeatureGenerator(const double time_range, const size_t num_points, const ReferenceLineInfo &reference_line_info, const Frame &frame, const SpeedLimit &speed_limit)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Planning module main class. It processes GPS and IMU as input, to generate planning info...
Frame holds all data for one planning cycle.
Definition: frame.h:61
ReferenceLineInfo holds all data for one reference line.
Definition: reference_line_info.h:54
Definition: st_boundary.h:38
common::Status EvaluateSpeedProfile(const std::vector< common::SpeedPoint > &speed_profile, autotuning::TrajectoryRawFeature *const trajectory_feature) const
Definition: autotuning_raw_feature_generator.h:31
Definition: speed_limit.h:29
common::Status EvaluateTrajectoryPoint(const common::TrajectoryPoint &trajectory_point, autotuning::TrajectoryPointRawFeature *const trajectory_point_feature) const
evaluate trajectory point with environment, generate model trajectory features
A general class to denote the return status of an API call. It can either be an OK status for success...
Definition: status.h:43