Apollo  6.0
Open source self driving car software
piecewise_jerk_path_optimizer.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 
21 #pragma once
22 
23 #include <memory>
24 #include <utility>
25 #include <vector>
26 
28 
29 namespace apollo {
30 namespace planning {
31 
33  public:
35  const TaskConfig& config,
36  const std::shared_ptr<DependencyInjector>& injector);
37 
38  virtual ~PiecewiseJerkPathOptimizer() = default;
39 
40  private:
41  common::Status Process(const SpeedData& speed_data,
42  const ReferenceLine& reference_line,
43  const common::TrajectoryPoint& init_point,
44  const bool path_reusable,
45  PathData* const path_data) override;
46 
47  common::TrajectoryPoint InferFrontAxeCenterFromRearAxeCenter(
48  const common::TrajectoryPoint& traj_point);
49 
50  std::vector<common::PathPoint> ConvertPathPointRefFromFrontAxeToRearAxe(
51  const PathData& path_data);
52 
72  bool OptimizePath(
73  const std::array<double, 3>& init_state,
74  const std::array<double, 3>& end_state,
75  std::vector<double> path_reference_l_ref,
76  const size_t path_reference_size, const double delta_s,
77  const bool is_valid_path_reference,
78  const std::vector<std::pair<double, double>>& lat_boundaries,
79  const std::vector<std::pair<double, double>>& ddl_bounds,
80  const std::array<double, 5>& w, const int max_iter,
81  std::vector<double>* ptr_x, std::vector<double>* ptr_dx,
82  std::vector<double>* ptr_ddx);
83 
84  FrenetFramePath ToPiecewiseJerkPath(const std::vector<double>& l,
85  const std::vector<double>& dl,
86  const std::vector<double>& ddl,
87  const double delta_s,
88  const double start_s) const;
89 
90  double EstimateJerkBoundary(const double vehicle_speed,
91  const double axis_distance,
92  const double max_steering_rate) const;
93 
94  double GaussianWeighting(const double x, const double peak_weighting,
95  const double peak_weighting_x) const;
96 };
97 
98 } // namespace planning
99 } // namespace apollo
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...
Definition: frenet_frame_path.h:32
Definition: piecewise_jerk_path_optimizer.h:32
Definition: path_data.h:36
PiecewiseJerkPathOptimizer(const TaskConfig &config, const std::shared_ptr< DependencyInjector > &injector)
Definition: path_optimizer.h:33
Definition: reference_line.h:39
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
Definition: speed_data.h:30