Apollo 10.0
自动驾驶开放平台
piecewise_jerk_speed_nonlinear_optimizer.h
浏览该文件的文档.
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 <algorithm>
24#include <memory>
25#include <string>
26#include <utility>
27#include <vector>
28
29#include "modules/planning/tasks/piecewise_jerk_speed_nonlinear/proto/piecewise_jerk_speed_nonlinear.pb.h"
33
34namespace apollo {
35namespace planning {
36
38 public:
40
41 bool Init(const std::string& config_dir, const std::string& name,
42 const std::shared_ptr<DependencyInjector>& injector) override;
43
45
46 private:
47 common::Status Process(const PathData& path_data,
48 const common::TrajectoryPoint& init_point,
49 SpeedData* const speed_data) override;
50
51 common::Status SetUpStatesAndBounds(const PathData& path_data,
52 const SpeedData& speed_data);
53
54 bool CheckSpeedLimitFeasibility();
55
56 common::Status SmoothSpeedLimit();
57
58 common::Status SmoothPathCurvature(const PathData& path_data);
59
60 common::Status OptimizeByQP(SpeedData* const speed_data,
61 std::vector<double>* distance,
62 std::vector<double>* velocity,
63 std::vector<double>* acceleration);
64
65 common::Status OptimizeByNLP(std::vector<double>* distance,
66 std::vector<double>* velocity,
67 std::vector<double>* acceleration);
68
69 // st problem dimensions
70 double delta_t_ = 0.0;
71 double total_length_ = 0.0;
72 double total_time_ = 0.0;
73 int num_of_knots_ = 0;
74
75 // st initial values
76 double s_init_ = 0.0;
77 double s_dot_init_ = 0.0;
78 double s_ddot_init_ = 0.0;
79
80 // st states dynamically feasibility bounds
81 double s_dot_max_ = 0.0;
82 double s_ddot_min_ = 0.0;
83 double s_ddot_max_ = 0.0;
84 double s_dddot_min_ = 0.0;
85 double s_dddot_max_ = 0.0;
86
87 // st safety bounds
88 std::vector<std::pair<double, double>> s_bounds_;
89 std::vector<std::pair<double, double>> s_soft_bounds_;
90
91 // speed limits
92 SpeedLimit speed_limit_;
93 PiecewiseJerkTrajectory1d smoothed_speed_limit_;
94
95 // smoothed path curvature profile as a function of traversal distance
96 PiecewiseJerkTrajectory1d smoothed_path_curvature_;
97
98 // reference speed profile
99 SpeedData reference_speed_data_;
100
101 // reference cruise speed
102 double cruise_speed_;
104};
105
108
109} // namespace planning
110} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
bool Init(const std::string &config_dir, const std::string &name, const std::shared_ptr< DependencyInjector > &injector) override
Planning module main class.
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
class register implement
Definition arena_queue.h:37