Apollo 11.0
自动驾驶开放平台
radar_detection_component.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 <memory>
19#include <string>
20#include <vector>
21
22#include "modules/common_msgs/localization_msgs/localization.pb.h"
23#include "modules/perception/radar_detection/proto/radar_component_config.pb.h"
24
34
35namespace apollo {
36namespace perception {
37namespace radar {
38
41
42class RadarDetectionComponent : public cyber::Component<ContiRadar> {
43 public:
45 : seq_num_(0),
46 tf_child_frame_id_(""),
47 radar_forward_distance_(200.0),
48 odometry_channel_name_(""),
49 hdmap_input_(nullptr),
50 radar_preprocessor_(nullptr),
51 radar_perception_(nullptr) {}
53
54 bool Init() override;
55 bool Proc(const std::shared_ptr<ContiRadar>& message) override;
56
57 private:
58 bool InitAlgorithmPlugin(const RadarComponentConfig& config);
59 bool InternalProc(const std::shared_ptr<ContiRadar>& in_message,
60 std::shared_ptr<onboard::SensorFrameMessage> out_message);
61 bool GetCarLocalizationSpeed(double timestamp,
62 Eigen::Vector3f* car_linear_speed,
63 Eigen::Vector3f* car_angular_speed);
64
66 RadarDetectionComponent& operator=(const RadarDetectionComponent&) = delete;
67
68 private:
69 std::mutex _mutex;
70 uint32_t seq_num_;
71
72 base::SensorInfo radar_info_;
73 std::string tf_child_frame_id_;
74 double radar_forward_distance_;
75 std::string odometry_channel_name_;
76
77 onboard::TransformWrapper radar2world_trans_;
78 onboard::TransformWrapper radar2novatel_trans_;
79 map::HDMapInput* hdmap_input_;
80 std::shared_ptr<BasePreprocessor> radar_preprocessor_;
81 std::shared_ptr<BaseRadarObstaclePerception> radar_perception_;
82 onboard::MsgBuffer<LocalizationEstimate> localization_subscriber_;
83 std::shared_ptr<apollo::cyber::Writer<onboard::SensorFrameMessage>> writer_;
84};
85
87
88} // namespace radar
89} // namespace perception
90} // namespace apollo
bool Proc(const std::shared_ptr< ContiRadar > &message) override
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:657
class register implement
Definition arena_queue.h:37