Apollo 10.0
自动驾驶开放平台
navi_planning.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
17#pragma once
18
19#include <memory>
20#include <string>
21#include <utility>
22#include <vector>
23
24#include "modules/common_msgs/planning_msgs/pad_msg.pb.h"
25
28
33namespace apollo {
34namespace planning {
35
42class NaviPlanning : public PlanningBase {
43 public:
44 explicit NaviPlanning(const std::shared_ptr<DependencyInjector>& injector)
45 : PlanningBase(injector) {}
46
47 virtual ~NaviPlanning();
48
52 std::string Name() const override;
53
58 apollo::common::Status Init(const PlanningConfig& config) override;
59
64 void RunOnce(const LocalView& local_view,
65 ADCTrajectory* const trajectory_pb) override;
66
68 const double current_time_stamp,
69 const std::vector<common::TrajectoryPoint>& stitching_trajectory,
70 ADCTrajectory* const trajectory) override;
71
72 private:
73 common::Status InitFrame(const uint32_t sequence_num,
74 const common::TrajectoryPoint& planning_start_point,
75 const common::VehicleState& vehicle_state);
76
77 bool CheckPlanningConfig(const PlanningConfig& config);
78
82 void ProcessPadMsg(PadMessage::DrivingAction drvie_action);
83
87 std::string GetCurrentLaneId();
88
95 void GetLeftNeighborLanesInfo(
96 std::vector<std::pair<std::string, double>>* const lane_info_group);
97
104 void GetRightNeighborLanesInfo(
105 std::vector<std::pair<std::string, double>>* const lane_info_group);
106
107 void ExportReferenceLineDebug(planning_internal::Debug* debug);
108
109 class VehicleConfig {
110 public:
111 double x_ = 0.0;
112 double y_ = 0.0;
113 double theta_ = 0.0;
114 bool is_valid_ = false;
115 };
116 VehicleConfig last_vehicle_config_;
117
118 VehicleConfig ComputeVehicleConfigFromLocalization(
119 const localization::LocalizationEstimate& localization) const;
120
121 std::string target_lane_id_;
122
123 std::unique_ptr<ReferenceLineProvider> reference_line_provider_;
124};
125
126} // namespace planning
127} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
apollo::common::Status Init(const PlanningConfig &config) override
module initialization function
NaviPlanning(const std::shared_ptr< DependencyInjector > &injector)
std::string Name() const override
Planning algorithm name.
void RunOnce(const LocalView &local_view, ADCTrajectory *const trajectory_pb) override
main logic of the planning module, runs periodically triggered by timer.
apollo::common::Status Plan(const double current_time_stamp, const std::vector< common::TrajectoryPoint > &stitching_trajectory, ADCTrajectory *const trajectory) override
Plan the trajectory given current vehicle state
Planning module main class.
class register implement
Definition arena_queue.h:37
LocalView contains all necessary data as planning input