Apollo 11.0
自动驾驶开放平台
navi_path_decider.h
浏览该文件的文档.
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
22#pragma once
23
24#include <map>
25#include <string>
26#include <vector>
27
28#include "gtest/gtest_prod.h"
29
30#include "gflags/gflags.h"
31
32#include "modules/common_msgs/basic_msgs/pnc_point.pb.h"
33#include "modules/planning/planning_base/proto/planning_config.pb.h"
34
39
44namespace apollo {
45namespace planning {
46
55class NaviPathDecider : public NaviTask {
56 public:
58 virtual ~NaviPathDecider() = default;
59
60 bool Init(const PlannerNaviConfig &config) override;
61
70 Frame *frame, ReferenceLineInfo *reference_line_info) override;
71
72 private:
83 apollo::common::Status Process(const ReferenceLine &reference_line,
84 const common::TrajectoryPoint &init_point,
85 const std::vector<const Obstacle *> &obstacles,
86 PathDecision *const path_decision,
87 PathData *const path_data);
88
95 bool GetBasicPathData(const ReferenceLine &reference_line,
96 std::vector<common::PathPoint> *const path_points);
97
103 void MoveToDestLane(const double dest_ref_line_y,
104 std::vector<common::PathPoint> *const path_points);
105
111 void KeepLane(const double dest_ref_line_y,
112 std::vector<common::PathPoint> *const path_points);
113
114 void RecordDebugInfo(const PathData &path_data);
115
122 bool IsSafeChangeLane(const ReferenceLine &reference_line,
123 const PathDecision &path_decision);
124
134 double NudgeProcess(const ReferenceLine &reference_line,
135 const std::vector<common::PathPoint> &path_data_points,
136 const std::vector<const Obstacle *> &obstacles,
137 const PathDecision &path_decision,
138 const common::VehicleState &vehicle_state);
142 double CalculateDistanceToDestLane();
143
144 private:
145 double max_keep_lane_distance_ = 0.0;
146 double min_keep_lane_offset_ = 0.0;
147 double max_keep_lane_shift_y_ = 0.0;
148 double keep_lane_shift_compensation_ = 0.0;
149 double move_dest_lane_compensation_ = 0.0;
150 uint32_t start_plan_point_from_ = 0;
151 std::map<double, double> move_dest_lane_config_talbe_;
152 std::vector<double> max_speed_levels_;
153
154 double start_plan_v_ = 0.0;
155 double start_plan_a_ = 0.0;
156 apollo::common::PathPoint start_plan_point_;
157
158 std::string cur_reference_line_lane_id_;
159 std::map<std::string, bool> last_lane_id_to_nudge_flag_;
160 NaviObstacleDecider obstacle_decider_;
161 common::VehicleState vehicle_state_;
162 NaviPathDeciderConfig config_;
163
164 FRIEND_TEST(NaviPathDeciderTest, MoveToDestLane);
165 FRIEND_TEST(NaviPathDeciderTest, KeepLane);
166};
167
168} // namespace planning
169} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
Frame holds all data for one planning cycle.
Definition frame.h:62
NaviObstacleDecider is used to make appropriate decisions for obstacles around the vehicle in navigat...
NaviPathDecider is used to generate the local driving path of the
bool Init(const PlannerNaviConfig &config) override
virtual ~NaviPathDecider()=default
apollo::common::Status Execute(Frame *frame, ReferenceLineInfo *reference_line_info) override
Overrided implementation of the virtual function "Execute" in the base class "Task".
PathDecision represents all obstacle decisions on one path.
ReferenceLineInfo holds all data for one reference line.
Planning module main class.
class register implement
Definition arena_queue.h:37
This file provides the declaration of the class "NaviSpeedDecider".