Apollo 10.0
自动驾驶开放平台
hesai_component.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2020 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
22#include <hesai2/hesai_lidar_sdk.hpp>
23
24#include "modules/drivers/lidar/hslidar/proto/hesai_config.pb.h"
25
26#include "cyber/cyber.h"
28
29namespace apollo {
30namespace drivers {
31namespace lidar {
32
33class HesaiComponent2 : public LidarComponentBase<HesaiUdpFrame> {
34 public:
35 virtual ~HesaiComponent2() {}
36 bool Init() override;
38 const std::shared_ptr<HesaiUdpFrame>& scan_message) override;
39
40 // Used to publish point clouds through 'ros_send_point_cloud_topic'
41 void SendPointCloud(const LidarDecodedFrame<LidarPointXYZIRT>& msg);
42 // Used to publish the original pcake through 'ros_send_packet_topic'
43 void SendPacket(const UdpFrame_t& hesai_raw_msg, double);
44
45 private:
46 HesaiConfig conf_;
47 std::shared_ptr<HesaiLidarSdk<LidarPointXYZIRT>> driver_ptr_;
48
49 int convert_threads_num_ = 1;
50};
51
52CYBER_REGISTER_COMPONENT(HesaiComponent2)
53
54} // namespace lidar
55} // namespace drivers
56} // namespace apollo
void ReadScanCallback(const std::shared_ptr< HesaiUdpFrame > &scan_message) override
void SendPacket(const UdpFrame_t &hesai_raw_msg, double)
void SendPointCloud(const LidarDecodedFrame< LidarPointXYZIRT > &msg)
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:656
class register implement
Definition arena_queue.h:37