Apollo 11.0
自动驾驶开放平台
radar_track_manager.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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 *****************************************************************************/
17
18namespace apollo {
19namespace perception {
20namespace radar {
21
23 size_t track_count = 0;
24 for (size_t i = 0; i < tracks_.size(); ++i) {
25 if (!tracks_[i]->IsDead()) {
26 if (i != track_count) {
27 tracks_[track_count] = tracks_[i];
28 }
29 ++track_count;
30 }
31 }
32 int removed_count = static_cast<int>(tracks_.size() - track_count);
33 ADEBUG << "Remove " << removed_count << " tracks";
34 tracks_.resize(track_count);
35 return static_cast<int>(track_count);
36}
37
39
40} // namespace radar
41} // namespace perception
42} // namespace apollo
void ClearTracks()
Clear radar tracked objects.
int RemoveLostTracks()
Remove already lost targets.
#define ADEBUG
Definition log.h:41
class register implement
Definition arena_queue.h:37