Apollo 10.0
自动驾驶开放平台
vanjeelidar_component.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2024 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
20#include <vanjee_driver/api/lidar_driver.hpp>
21#include <vanjee_driver/driver/driver_param.hpp>
22#include <vanjee_driver/msg/packet.hpp>
23#include <vanjee_driver/msg/point_cloud_msg.hpp>
24
25#include "modules/drivers/lidar/vanjeelidar/proto/vanjeelidar.pb.h"
26#include "modules/drivers/lidar/vanjeelidar/proto/vanjeelidar_config.pb.h"
27
31
32namespace apollo {
33namespace drivers {
34namespace lidar {
35
36typedef ::vanjee::lidar::PointXYZIRT PointT;
37typedef ::vanjee::lidar::PointCloudT<PointT> PointCloudMsg;
38
39using ::vanjee::lidar::InputType;
40
42 : public LidarComponentBase<vanjee::VanjeeScanPacket> {
43 public:
44 bool Init() override;
45
47 const std::shared_ptr<vanjee::VanjeeScanPacket>& scan_message) override;
48
49 void VanjeePacketCallback(const ::vanjee::lidar::Packet& lidar_packet);
50
51 std::shared_ptr<PointCloudMsg> VanjeeCloudAllocateCallback();
52
53 void VanjeeCloudPutCallback(std::shared_ptr<PointCloudMsg> vanjee_cloud);
54
56
58
59 private:
60 std::shared_ptr<::vanjee::lidar::LidarDriver<PointCloudMsg>> driver_ptr_;
62
63 ::vanjee::lidar::SyncQueue<std::shared_ptr<PointCloudMsg>> cloud_queue_;
64 std::shared_ptr<SyncBuffering<PointCloudMsg>> cloud_buffer_;
65
66 std::thread cloud_handle_thread_;
67
68 int seq_ = 0;
69};
71
72} // namespace lidar
73} // namespace drivers
74} // namespace apollo
std::shared_ptr< PointCloudMsg > VanjeeCloudAllocateCallback()
void ReadScanCallback(const std::shared_ptr< vanjee::VanjeeScanPacket > &scan_message) override
void VanjeeCloudPutCallback(std::shared_ptr< PointCloudMsg > vanjee_cloud)
void VanjeePacketCallback(const ::vanjee::lidar::Packet &lidar_packet)
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:656
PointCloudT< PointT > PointCloudMsg
class register implement
Definition arena_queue.h:37