Apollo 11.0
自动驾驶开放平台
pnc_map_base.cc
浏览该文件的文档.
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
22
24
25namespace apollo {
26namespace planning {
27
29 look_backward_distance, 50,
30 "look backward this distance when creating reference line from routing");
31
32DEFINE_double(look_forward_short_distance, 180,
33 "short look forward this distance when creating reference line "
34 "from routing when ADC is slow");
36 look_forward_long_distance, 250,
37 "look forward this distance when creating reference line from routing");
38
40 const planning::PlanningCommand &command) {
41 if (!IsValid(command)) {
42 AERROR << "Input command is not valid!" << command.DebugString();
43 return false;
44 }
45 last_command_ = command;
46 return true;
47}
48
49double PncMapBase::LookForwardDistance(const double velocity) {
50 auto forward_distance = velocity * FLAGS_look_forward_time_sec;
51
52 return forward_distance > FLAGS_look_forward_short_distance
53 ? FLAGS_look_forward_long_distance
54 : FLAGS_look_forward_short_distance;
55}
56
58 const planning::PlanningCommand &command) const {
59 return IsNewPlanningCommand(last_command_, command);
60}
61
63 const planning::PlanningCommand &prev_command,
64 const planning::PlanningCommand &new_command) {
65 if (!new_command.is_motion_command()) {
66 return false;
67 }
68 return !common::util::IsProtoEqual(prev_command, new_command);
69}
70
71} // namespace planning
72} // namespace apollo
static double LookForwardDistance(const double velocity)
virtual bool UpdatePlanningCommand(const planning::PlanningCommand &command)
planning::PlanningCommand last_command_
bool IsNewPlanningCommand(const planning::PlanningCommand &command) const
Check if the routing is the same as existing one in Map
Planning module main class.
#define AERROR
Definition log.h:44
Some util functions.
bool IsProtoEqual(const ProtoA &a, const ProtoB &b)
Definition util.h:47
DEFINE_double(look_backward_distance, 50, "look backward this distance when creating reference line from routing")
class register implement
Definition arena_queue.h:37