Apollo 11.0
自动驾驶开放平台
navi_planner.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 <memory>
25#include <string>
26#include <vector>
27
28#include "modules/common_msgs/basic_msgs/pnc_point.pb.h"
29#include "modules/common_msgs/planning_msgs/planning.pb.h"
30#include "modules/planning/planners/navi/proto/navi_task_config.pb.h"
31#include "modules/planning/planners/navi/proto/planner_config.pb.h"
32
42
47namespace apollo {
48namespace planning {
49
60 public:
61 virtual ~NaviPlanner() = default;
62
63 std::string Name() override { return "NAVI"; }
64
65 common::Status Init(const std::shared_ptr<DependencyInjector>& injector,
66 const std::string& config_path = "") override;
67
74 common::Status Plan(const common::TrajectoryPoint& planning_init_point,
75 Frame* frame,
76 ADCTrajectory* ptr_computed_trajectory) override;
77
78 void Stop() override {}
79
88 const common::TrajectoryPoint& planning_init_point, Frame* frame,
89 ReferenceLineInfo* reference_line_info) override;
90
91 private:
92 void RegisterTasks();
93 std::vector<common::SpeedPoint> GenerateInitSpeedProfile(
94 const common::TrajectoryPoint& planning_init_point,
95 const ReferenceLineInfo* reference_line_info);
96
97 std::vector<common::SpeedPoint> DummyHotStart(
98 const common::TrajectoryPoint& planning_init_point);
99
100 std::vector<common::SpeedPoint> GenerateSpeedHotStart(
101 const common::TrajectoryPoint& planning_init_point);
102
103 void GenerateFallbackPathProfile(const ReferenceLineInfo* reference_line_info,
104 PathData* path_data);
105
106 void GenerateFallbackSpeedProfile(SpeedData* speed_data);
107
108 SpeedData GenerateStopProfile(const double init_speed,
109 const double init_acc) const;
110
111 SpeedData GenerateStopProfileFromPolynomial(const double init_speed,
112 const double init_acc) const;
113
114 bool IsValidProfile(const QuinticPolynomialCurve1d& curve) const;
115
116 void RecordObstacleDebugInfo(ReferenceLineInfo* reference_line_info);
117
118 void RecordDebugInfo(ReferenceLineInfo* reference_line_info,
119 const std::string& name, const double time_diff_ms);
120
121 private:
123 std::vector<std::unique_ptr<NaviTask>> tasks_;
124};
125
127
128} // namespace planning
129} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
Implements a Factory design pattern with Register and Create methods
Definition factory.h:60
Frame holds all data for one planning cycle.
Definition frame.h:62
NaviPlanner is a planner based on real-time relative maps.
common::Status Plan(const common::TrajectoryPoint &planning_init_point, Frame *frame, ADCTrajectory *ptr_computed_trajectory) override
Override function Plan in parent class Planner.
common::Status Init(const std::shared_ptr< DependencyInjector > &injector, const std::string &config_path="") override
std::string Name() override
virtual ~NaviPlanner()=default
common::Status PlanOnReferenceLine(const common::TrajectoryPoint &planning_init_point, Frame *frame, ReferenceLineInfo *reference_line_info) override
Override function Plan in parent class Planner.
ReferenceLineInfo holds all data for one reference line.
Planning module main class.
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
Defines the Factory class.
class register implement
Definition arena_queue.h:37