Apollo 11.0
自动驾驶开放平台
sensor_data_manager.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
17#pragma once
18
19#include <memory>
20#include <string>
21#include <unordered_map>
22#include <vector>
23
24#include "gtest/gtest_prod.h"
25
26#include "cyber/common/macros.h"
31
32namespace apollo {
33namespace perception {
34namespace fusion {
35
37 public:
44 bool Init();
45
50 void Reset();
51
58 void AddSensorMeasurements(const base::FrameConstPtr& frame_ptr);
59
67 bool IsLidar(const base::FrameConstPtr& frame_ptr);
68
76 bool IsRadar(const base::FrameConstPtr& frame_ptr);
77
85 bool IsCamera(const base::FrameConstPtr& frame_ptr);
86
94 void GetLatestSensorFrames(double timestamp, const std::string& sensor_id,
95 std::vector<SensorFramePtr>* frames) const;
96
103 void GetLatestFrames(double timestamp,
104 std::vector<SensorFramePtr>* frames) const;
105
115 bool GetPose(const std::string& sensor_id, double timestamp,
116 Eigen::Affine3d* pose) const;
117
125 const std::string& sensor_id) const;
126
127 private:
128 bool inited_ = false;
129 std::unordered_map<std::string, SensorPtr> sensors_;
130
131 const algorithm::SensorManager* sensor_manager_ = nullptr;
132
133 FRIEND_TEST(SensorDataManagerTest, test);
135};
136
137} // namespace fusion
138} // namespace perception
139} // namespace apollo
void GetLatestSensorFrames(double timestamp, const std::string &sensor_id, std::vector< SensorFramePtr > *frames) const
Get the latest sensor frames
bool IsRadar(const base::FrameConstPtr &frame_ptr)
Is the data frame detected by radar
bool IsLidar(const base::FrameConstPtr &frame_ptr)
Is the data frame detected by lidar
void GetLatestFrames(double timestamp, std::vector< SensorFramePtr > *frames) const
Get the latest sensor frames
bool GetPose(const std::string &sensor_id, double timestamp, Eigen::Affine3d *pose) const
Get the Pose object
bool IsCamera(const base::FrameConstPtr &frame_ptr)
Is the data frame detected by camera
base::BaseCameraModelPtr GetCameraIntrinsic(const std::string &sensor_id) const
Get the Camera Intrinsic object
void AddSensorMeasurements(const base::FrameConstPtr &frame_ptr)
Add the data frame, which contains the obstacles detected by the sensor
#define DECLARE_SINGLETON(classname)
Definition macros.h:52
std::shared_ptr< BaseCameraModel > BaseCameraModelPtr
Definition camera.h:75
std::shared_ptr< const Frame > FrameConstPtr
Definition frame.h:61
class register implement
Definition arena_queue.h:37