Apollo 10.0
自动驾驶开放平台
camera_detection_multi_stage_component.h
浏览该文件的文档.
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#pragma once
17
18#include <memory>
19#include <string>
20
21#include "modules/common_msgs/sensor_msgs/sensor_image.pb.h"
22#include "modules/perception/camera_detection_multi_stage/proto/camera_detection_multi_stage.pb.h"
23
24#include "cyber/cyber.h"
28
29namespace apollo {
30namespace perception {
31namespace camera {
32
34 : public cyber::Component<drivers::Image> {
35 public:
44 bool Init() override;
52 bool Proc(const std::shared_ptr<drivers::Image>& msg) override;
53
54 private:
55 bool InitCameraFrame(const CameraDetectionMultiStage& detection_param);
56
57 bool InitObstacleDetector(const CameraDetectionMultiStage& detection_param);
58
59 bool InitTransformWrapper(const CameraDetectionMultiStage& detection_param);
60
61 bool InternalProc(const std::shared_ptr<apollo::drivers::Image>& msg,
62 const std::shared_ptr<onboard::CameraFrame>& out_message);
63
64 private:
65 int image_height_;
66 int image_width_;
67 int frame_id_ = 0;
68 double timestamp_offset_;
69 Eigen::Matrix3f camera_k_matrix_ = Eigen::Matrix3f::Identity();
70
71 std::shared_ptr<BaseObstacleDetector> detector_;
72 std::shared_ptr<camera::DataProvider> data_provider_;
73
74 std::shared_ptr<cyber::Writer<onboard::CameraFrame>> writer_;
75 std::shared_ptr<onboard::TransformWrapper> trans_wrapper_;
76
78};
79
81
82} // namespace camera
83} // namespace perception
84} // namespace apollo
bool Proc(const std::shared_ptr< drivers::Image > &msg) override
Process of camera detection 2d compoment
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:656
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition macros.h:48
class register implement
Definition arena_queue.h:37