Apollo 11.0
自动驾驶开放平台
object_sequence.h
浏览该文件的文档.
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 *****************************************************************************/
16#pragma once
17
18#include <map>
19#include <memory>
20#include <mutex>
21#include <vector>
22
23#include "gtest/gtest_prod.h"
24
27
28namespace apollo {
29namespace perception {
30namespace lidar {
31
33 public:
34 typedef int TrackIdKey;
35 typedef double TimeStampKey;
36 typedef std::map<TimeStampKey,
37 std::shared_ptr<apollo::perception::base::Object>>
39
40 public:
41 ObjectSequence() = default;
42 ~ObjectSequence() = default;
43
45 const std::vector<std::shared_ptr<perception::base::Object>>& objects,
46 TimeStampKey timestamp);
47
49 TimeStampKey window_time);
50
51 protected:
52 FRIEND_TEST(FusedClassifierTest, test_one_sequence_fusion);
53 FRIEND_TEST(FusedClassifierTest, test_one_sequence_fusion_bad_timestamp);
54 void RemoveStaleTracks(TimeStampKey current_stamp);
55
57 std::map<TrackIdKey, TrackedObjects> sequence_;
58 std::mutex mutex_;
59 static constexpr TimeStampKey kMaxTimeOut = 5.0; // 5 second
60};
61
62} // namespace lidar
63} // namespace perception
64} // namespace apollo
FRIEND_TEST(FusedClassifierTest, test_one_sequence_fusion)
static constexpr TimeStampKey kMaxTimeOut
bool GetTrackInTemporalWindow(TrackIdKey track_id, TrackedObjects *track, TimeStampKey window_time)
std::map< TrackIdKey, TrackedObjects > sequence_
bool AddTrackedFrameObjects(const std::vector< std::shared_ptr< perception::base::Object > > &objects, TimeStampKey timestamp)
FRIEND_TEST(FusedClassifierTest, test_one_sequence_fusion_bad_timestamp)
std::map< TimeStampKey, std::shared_ptr< apollo::perception::base::Object > > TrackedObjects
void RemoveStaleTracks(TimeStampKey current_stamp)
class register implement
Definition arena_queue.h:37