Apollo 11.0
自动驾驶开放平台
path_optimizer_util.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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#include <utility>
18#include <vector>
19
20#include "modules/planning/planning_base/proto/piecewise_jerk_path_config.pb.h"
21
24
25namespace apollo {
26namespace planning {
27// SLSstate contains: (s ,s' ,s''), (l, l', l'')
28using SLState = std::pair<std::array<double, 3>, std::array<double, 3>>;
29
31 public:
35 static FrenetFramePath ToPiecewiseJerkPath(const std::vector<double>& x,
36 const std::vector<double>& dx,
37 const std::vector<double>& ddx,
38 const double delta_s,
39 const double start_s);
43 static double EstimateJerkBoundary(const double vehicle_speed);
44
45 static std::vector<common::PathPoint>
48 PathBound extra_path_bound, const PathBoundary& path_boundary,
49 ObsCornerConstraints* extra_constraints);
53 static bool OptimizePath(
54 const SLState& init_state, const std::array<double, 3>& end_state,
55 std::vector<double> l_ref, std::vector<double> l_ref_weight,
56 const PathBoundary& path_boundary,
57 const std::vector<std::pair<double, double>>& ddl_bounds,
58 double dddl_bound, const PiecewiseJerkPathConfig& config,
59 std::vector<double>* x, std::vector<double>* dx,
60 std::vector<double>* ddx);
61
63 const SLState& init_state, const std::array<double, 3>& end_state,
64 std::vector<double> l_ref, std::vector<double> l_ref_weight,
65 std::vector<double> towing_l_ref, std::vector<double> towing_l_ref_weight,
66 const PathBoundary& path_boundary,
67 const std::vector<std::pair<double, double>>& ddl_bounds,
68 double dddl_bound, const PiecewiseJerkPathConfig& config,
69 std::vector<double>* x, std::vector<double>* dx,
70 std::vector<double>* ddx);
71
76 static void UpdatePathRefWithBound(const PathBoundary& path_boundary,
77 double weight, std::vector<double>* ref_l,
78 std::vector<double>* weight_ref_l);
79
80 static void UpdatePathRefWithBound(const PathBoundary& path_boundary,
81 double weight,
82 const std::vector<double>& towing_ref_l,
83 std::vector<double>* ref_l,
84 std::vector<double>* weight_ref_l);
85
87 const PathBoundary& path_boundary, double weight,
88 std::vector<double>* ref_l, std::vector<double>* weight_ref_l,
89 bool is_left_side_pass);
90
94 static void CalculateAccBound(
95 const PathBoundary& path_boundary, const ReferenceLine& reference_line,
96 std::vector<std::pair<double, double>>* ddl_bounds);
97};
98
99} // namespace planning
100} // namespace apollo
static bool OptimizePathWithTowingPoints(const SLState &init_state, const std::array< double, 3 > &end_state, std::vector< double > l_ref, std::vector< double > l_ref_weight, std::vector< double > towing_l_ref, std::vector< double > towing_l_ref_weight, const PathBoundary &path_boundary, const std::vector< std::pair< double, double > > &ddl_bounds, double dddl_bound, const PiecewiseJerkPathConfig &config, std::vector< double > *x, std::vector< double > *dx, std::vector< double > *ddx)
static void UpdatePathRefWithBoundInSidePassDirection(const PathBoundary &path_boundary, double weight, std::vector< double > *ref_l, std::vector< double > *weight_ref_l, bool is_left_side_pass)
static std::vector< common::PathPoint > ConvertPathPointRefFromFrontAxeToRearAxe(const PathData &path_data)
static void CalculateAccBound(const PathBoundary &path_boundary, const ReferenceLine &reference_line, std::vector< std::pair< double, double > > *ddl_bounds)
calculate ddl bound by referenceline kappa and adc lat accleration
static FrenetFramePath ToPiecewiseJerkPath(const std::vector< double > &x, const std::vector< double > &dx, const std::vector< double > &ddx, const double delta_s, const double start_s)
Data format tramform from raw data to FrenetFramePath
static void FormulateExtraConstraints(PathBound extra_path_bound, const PathBoundary &path_boundary, ObsCornerConstraints *extra_constraints)
static double EstimateJerkBoundary(const double vehicle_speed)
Calculation of jerk boundary based on vehicle kinematics model.
static bool OptimizePath(const SLState &init_state, const std::array< double, 3 > &end_state, std::vector< double > l_ref, std::vector< double > l_ref_weight, const PathBoundary &path_boundary, const std::vector< std::pair< double, double > > &ddl_bounds, double dddl_bound, const PiecewiseJerkPathConfig &config, std::vector< double > *x, std::vector< double > *dx, std::vector< double > *ddx)
Piecewise jerk path optimizer.
static void UpdatePathRefWithBound(const PathBoundary &path_boundary, double weight, std::vector< double > *ref_l, std::vector< double > *weight_ref_l)
If ref_l is below or above path boundary, will update its values and weights
Planning module main class.
std::pair< std::array< double, 3 >, std::array< double, 3 > > SLState
std::vector< PathBoundPoint > PathBound
class register implement
Definition arena_queue.h:37