Apollo 10.0
自动驾驶开放平台
path_data.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 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 <list>
24#include <string>
25#include <tuple>
26#include <utility>
27#include <vector>
28
32
33namespace apollo {
34namespace planning {
35
36class PathData {
37 public:
45
46 PathData() = default;
47
49
50 bool SetFrenetPath(FrenetFramePath frenet_path);
51
52 void SetReferenceLine(const ReferenceLine *reference_line);
53
55 std::vector<std::tuple<double, PathPointType, double>>
57
58 const DiscretizedPath &discretized_path() const;
59
61
62 const std::vector<std::tuple<double, PathPointType, double>>
64
65 common::PathPoint GetPathPointWithPathS(const double s) const;
66
67 /*
68 * brief: this function will find the path_point in discretized_path whose
69 * projection to reference line has s value closest to ref_s.
70 */
71 bool GetPathPointWithRefS(const double ref_s,
72 common::PathPoint *const path_point) const;
73
74 bool LeftTrimWithRefS(const common::FrenetFramePoint &frenet_point);
75
76 bool UpdateFrenetFramePath(const ReferenceLine *reference_line);
77
78 void Clear();
79
80 bool Empty() const;
81
82 std::string DebugString() const;
83
84 void set_path_label(const std::string &label);
85
86 const std::string &path_label() const;
87
88 void set_blocking_obstacle_id(const std::string &obs_id) {
89 blocking_obstacle_id_ = obs_id;
90 }
91 const std::string &blocking_obstacle_id() const {
92 return blocking_obstacle_id_;
93 }
94
95 const bool is_valid_path_reference() const {
96 return is_valid_path_reference_;
97 }
99 is_valid_path_reference_ = is_valid_path_reference;
100 }
101
103 return is_optimized_towards_trajectory_reference_;
104 }
110
111 const std::vector<common::PathPoint> &path_reference() const;
112 void set_path_reference(const std::vector<common::PathPoint> &path_reference);
113 bool is_reverse_path() const { return is_reverse_path_; }
115 is_reverse_path_ = is_reverse_path;
116 }
117
118 private:
119 /*
120 * convert frenet path to cartesian path by reference line
121 */
122 bool SLToXY(const FrenetFramePath &frenet_path,
124 bool XYToSL(const DiscretizedPath &discretized_path,
125 FrenetFramePath *const frenet_path);
126 const ReferenceLine *reference_line_ = nullptr;
127 DiscretizedPath discretized_path_;
128 FrenetFramePath frenet_path_;
135 std::vector<std::tuple<double, PathPointType, double>>
136 path_point_decision_guide_;
137
138 std::string path_label_ = "";
139 std::string blocking_obstacle_id_;
140
145 // wheter this PathData is a path reference serving as an optimization target
146 // for later modules
147 bool is_valid_path_reference_ = false;
148
155 bool is_optimized_towards_trajectory_reference_ = false;
156 bool is_reverse_path_ = false;
157
158 // path reference
159 std::vector<common::PathPoint> path_reference_;
160};
161
162} // namespace planning
163} // namespace apollo
const std::vector< common::PathPoint > & path_reference() const
Definition path_data.cc:266
bool is_reverse_path() const
Definition path_data.h:113
const std::string & path_label() const
Definition path_data.cc:264
bool LeftTrimWithRefS(const common::FrenetFramePoint &frenet_point)
Definition path_data.cc:240
void SetReferenceLine(const ReferenceLine *reference_line)
Definition path_data.cc:107
common::PathPoint GetPathPointWithPathS(const double s) const
Definition path_data.cc:112
const FrenetFramePath & frenet_frame_path() const
Definition path_data.cc:94
bool SetPathPointDecisionGuide(std::vector< std::tuple< double, PathPointType, double > > path_point_decision_guide)
Definition path_data.cc:73
bool GetPathPointWithRefS(const double ref_s, common::PathPoint *const path_point) const
Definition path_data.cc:116
bool SetDiscretizedPath(DiscretizedPath path)
Definition path_data.cc:43
void set_is_reverse_path(bool is_reverse_path)
Definition path_data.h:114
void set_is_optimized_towards_trajectory_reference(bool is_optimized_towards_trajectory_reference)
Definition path_data.h:105
const bool is_valid_path_reference() const
Definition path_data.h:95
bool UpdateFrenetFramePath(const ReferenceLine *reference_line)
Definition path_data.cc:257
void set_blocking_obstacle_id(const std::string &obs_id)
Definition path_data.h:88
std::string DebugString() const
Definition path_data.cc:161
void set_is_valid_path_reference(bool is_valid_path_reference)
Definition path_data.h:98
const DiscretizedPath & discretized_path() const
Definition path_data.cc:90
const std::vector< std::tuple< double, PathPointType, double > > & path_point_decision_guide() const
Definition path_data.cc:99
void set_path_label(const std::string &label)
Definition path_data.cc:262
bool SetFrenetPath(FrenetFramePath frenet_path)
Definition path_data.cc:58
const bool is_optimized_towards_trajectory_reference() const
Definition path_data.h:102
const std::string & blocking_obstacle_id() const
Definition path_data.h:91
void set_path_reference(const std::vector< common::PathPoint > &path_reference)
Definition path_data.cc:270
Planning module main class.
class register implement
Definition arena_queue.h:37