Apollo 11.0
自动驾驶开放平台
nudge_calculation.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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 <algorithm>
24#include <memory>
25#include <string>
26#include <vector>
27
28#include "modules/planning/tasks/obstacle_nudge_decider/proto/obstacle_nudge_decider.pb.h"
29
38
39namespace apollo {
40namespace planning {
41
43 double width = 0.0;
44 double length = 0.0;
46};
47
49public:
50 explicit NudgeCalculation(const ObstacleNudgeDeciderConfig& cross_line_nudge_config);
52 Frame* const current_frame,
53 const Frame* last_frame,
54 ReferenceLineInfo* const reference_line_info);
55 void set_in_nudge_state(bool state);
56
58 ReferenceLineInfo* const reference_line_info,
59 const Obstacle& obstacle,
60 NudgeInfo* const nudge_info);
62 ReferenceLineInfo* const reference_line_info,
63 const Obstacle& obstacle,
64 RemainNudgeSpace* remain_space);
65
67 const Obstacle& obstacle,
68 NudgeInfo* const nudge_info,
69 bool is_passable,
70 RemainNudgeSpace remain_nudge_space,
71 bool is_all_on_lane);
72
73 bool MergeObsPolygon(ReferenceLineInfo* const reference_line_info, NudgeInfo* const nudge_info);
74 void EraseObsInNudgeinfo(NudgeInfo* const nudge_info, std::string id);
75
76 bool IsProbEnoughToNudge(NudgeInfo* const nudge_info, bool is_merge_obs = false);
77 void CalcNudgeExtraSpace(ReferenceLineInfo* const reference_line_info, NudgeInfo* const nudge_info);
78
79private:
80 bool IsWithinNudgeScopeObstacle(ReferenceLineInfo* const reference_line_info, const Obstacle& obstacle);
81 void UpdateTrackingObsInfo(
82 NudgeObstacleInfo* const track_obs_info,
83 const Obstacle& obstacle,
84 bool is_passable,
85 RemainNudgeSpace remain_nudge_space,
86 bool is_all_on_lane);
87 void GetRefLineLaneWidth(
88 const ReferenceLine& reference_line,
89 const double adc_s,
90 const double search_s,
91 double* const lane_left_width,
92 double* const lane_right_width);
93
94private:
96 VehicleConfig veh_config_;
97 SLBoundary adc_boundary_;
98 bool is_in_nudge_state_ = false;
99 double check_forward_dis_ = 0;
100 double dis2end_ = std::numeric_limits<double>::max();
101};
102
103} // namespace planning
104} // namespace apollo
Frame holds all data for one planning cycle.
Definition frame.h:62
bool MatchTrackingObsInfo(const Obstacle &obstacle, NudgeInfo *const nudge_info, bool is_passable, RemainNudgeSpace remain_nudge_space, bool is_all_on_lane)
bool MergeObsPolygon(ReferenceLineInfo *const reference_line_info, NudgeInfo *const nudge_info)
bool IsProbEnoughToNudge(NudgeInfo *const nudge_info, bool is_merge_obs=false)
void CalcNudgeExtraSpace(ReferenceLineInfo *const reference_line_info, NudgeInfo *const nudge_info)
void BuildNudgeDecisionWithObs(Frame *const current_frame, const Frame *last_frame, ReferenceLineInfo *const reference_line_info)
void EraseObsInNudgeinfo(NudgeInfo *const nudge_info, std::string id)
bool CalcObsRemainSpace(ReferenceLineInfo *const reference_line_info, const Obstacle &obstacle, RemainNudgeSpace *remain_space)
void BuildStaticTrackingObs(ReferenceLineInfo *const reference_line_info, const Obstacle &obstacle, NudgeInfo *const nudge_info)
This is the class that associates an Obstacle with its path properties.
Definition obstacle.h:62
ReferenceLineInfo holds all data for one reference line.
Planning module main class.
Math-related util functions.
class register implement
Definition arena_queue.h:37
Defines the Vec2d class.