Apollo 11.0
自动驾驶开放平台
filter.cc
浏览该文件的文档.
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
25
30namespace apollo {
31namespace third_party_perception {
32namespace filter {
33
34bool IsPreserved(const RadarObstacle& radar_obstacle) {
35 if (!radar_obstacle.movable()) {
36 return false;
37 }
38 double nearest_l =
40 if (std::abs(nearest_l) > FLAGS_filter_y_distance) {
41 return false;
42 }
43 if (radar_obstacle.count() < FLAGS_keep_radar_frames) {
44 return false;
45 }
46 return true;
47}
48
50 RadarObstacles filtered_radar_obstacles;
51 for (const auto& iter : radar_obstacles.radar_obstacle()) {
52 if (IsPreserved(iter.second)) {
53 filtered_radar_obstacles.mutable_radar_obstacle()->insert(iter);
54 }
55 }
56 filtered_radar_obstacles.mutable_header()->CopyFrom(radar_obstacles.header());
57 return filtered_radar_obstacles;
58}
59
60} // namespace filter
61} // namespace third_party_perception
62} // namespace apollo
bool IsPreserved(const RadarObstacle &radar_obstacle)
Definition filter.cc:34
RadarObstacles FilterRadarObstacles(const RadarObstacles &radar_obstacles)
Definition filter.cc:49
double GetLateralDistanceToNearestLane(const Point &point)
class register implement
Definition arena_queue.h:37
optional apollo::common::Point3D absolute_position