Apollo 11.0
自动驾驶开放平台
convert.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 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 "modules/drivers/proto/pointcloud.pb.h"
23#include "modules/common_msgs/sensor_msgs/pointcloud.pb.h"
24#include "modules/drivers/lidar/lslidar/proto/config.pb.h"
25#include "modules/drivers/lidar/lslidar/proto/lslidar.pb.h"
26
28
29namespace apollo {
30namespace drivers {
31namespace lslidar {
32namespace parser {
33
36
37// convert lslidar data to pointcloud and republish
38class Convert {
39 public:
40 Convert() = default;
41 virtual ~Convert() = default;
42
43 // init lslidar config struct from private_nh
44 void init(const Config& lslidar_config);
45
46 // convert lslidar data to pointcloud and public
48 const std::shared_ptr<apollo::drivers::lslidar::LslidarScan>&
49 scan_msg,
50 std::shared_ptr<apollo::drivers::PointCloud> point_cloud_out);
51
52 private:
53 // RawData class for converting data to point cloud
54 std::unique_ptr<LslidarParser> parser_;
55 std::string channel_pointcloud_;
56
58 Config config_;
59};
60
61} // namespace parser
62} // namespace lslidar
63} // namespace drivers
64} // namespace apollo
void ConvertPacketsToPointcloud(const std::shared_ptr< apollo::drivers::lslidar::LslidarScan > &scan_msg, std::shared_ptr< apollo::drivers::PointCloud > point_cloud_out)
Callback for raw scan messages.
Definition convert.cc:41
void init(const Config &lslidar_config)
Definition convert.cc:27
These classes Unpack raw Lslidar LIDAR packets into several useful formats.
class register implement
Definition arena_queue.h:37