Apollo 11.0
自动驾驶开放平台
adc_trajectory_container.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
22#pragma once
23
24#include <memory>
25#include <string>
26#include <unordered_set>
27#include <vector>
28
29#include "modules/common_msgs/planning_msgs/planning.pb.h"
32#include "modules/common_msgs/prediction_msgs/lane_graph.pb.h"
33
34namespace apollo {
35namespace prediction {
36
38 public:
43
47 virtual ~ADCTrajectoryContainer() = default;
48
53 void Insert(const ::google::protobuf::Message& message) override;
54
59 bool IsProtected() const;
60
66 bool IsPointInJunction(const common::PathPoint& point) const;
67
72 bool HasOverlap(const LaneSequence& lane_sequence) const;
73
77 void SetPosition(const common::math::Vec2d& position);
78
83 std::shared_ptr<const hdmap::JunctionInfo> ADCJunction() const;
84
89 double ADCDistanceToJunction() const;
90
96
101 bool IsLaneIdInReferenceLine(const std::string& lane_id) const;
102
103 bool IsLaneIdInTargetReferenceLine(const std::string& lane_id) const;
104
105 const std::vector<std::string>& GetADCLaneIDSequence() const;
106
107 const std::vector<std::string>& GetADCTargetLaneIDSequence() const;
108
109 void SetJunction(const std::string& junction_id, const double distance);
110
111 private:
112 void SetJunctionPolygon();
113
114 void SetLaneSequence();
115
116 void SetTargetLaneSequence();
117
118 std::string ToString(const std::unordered_set<std::string>& lane_ids);
119
120 std::string ToString(const std::vector<std::string>& lane_ids);
121
122 private:
123 planning::ADCTrajectory adc_trajectory_;
124 common::math::Polygon2d adc_junction_polygon_;
125 std::shared_ptr<const hdmap::JunctionInfo> adc_junction_info_ptr_;
126 double s_dist_to_junction_;
127 std::unordered_set<std::string> adc_lane_ids_;
128 std::vector<std::string> adc_lane_seq_;
129 std::unordered_set<std::string> adc_target_lane_ids_;
130 std::vector<std::string> adc_target_lane_seq_;
131};
132
133} // namespace prediction
134} // namespace apollo
The class of polygon in 2-D.
Definition polygon2d.h:42
Implements a class of 2-dimensional vectors.
Definition vec2d.h:42
bool IsLaneIdInReferenceLine(const std::string &lane_id) const
Determine if a lane ID is in the reference line
const std::vector< std::string > & GetADCTargetLaneIDSequence() const
void SetJunction(const std::string &junction_id, const double distance)
bool IsPointInJunction(const common::PathPoint &point) const
Check if a point is in the first junction of the adc trajectory
const planning::ADCTrajectory & adc_trajectory() const
Get ADC planning trajectory
bool IsLaneIdInTargetReferenceLine(const std::string &lane_id) const
virtual ~ADCTrajectoryContainer()=default
Destructor
void Insert(const ::google::protobuf::Message &message) override
Insert a data message into the container
bool IsProtected() const
Get the right-of-way status of ADC
bool HasOverlap(const LaneSequence &lane_sequence) const
Has overlap with ADC trajectory
double ADCDistanceToJunction() const
Compute ADC's distance to junction
void SetPosition(const common::math::Vec2d &position)
Set ADC position
std::shared_ptr< const hdmap::JunctionInfo > ADCJunction() const
Get ADC junction
const std::vector< std::string > & GetADCLaneIDSequence() const
Define the data container base class
class register implement
Definition arena_queue.h:37