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
27
#include "
modules/drivers/lidar/lslidar/parser/lslidar_parser.h
"
28
29
namespace
apollo
{
30
namespace
drivers {
31
namespace
lslidar {
32
namespace
parser {
33
34
using
apollo::drivers::PointCloud
;
35
using
apollo::drivers::lslidar::LslidarScan
;
36
37
// convert lslidar data to pointcloud and republish
38
class
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
47
void
ConvertPacketsToPointcloud
(
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
apollo::drivers::lslidar::parser::Convert
Definition
convert.h:38
apollo::drivers::lslidar::parser::Convert::ConvertPacketsToPointcloud
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
apollo::drivers::lslidar::parser::Convert::~Convert
virtual ~Convert()=default
apollo::drivers::lslidar::parser::Convert::init
void init(const Config &lslidar_config)
Definition
convert.cc:27
apollo::drivers::lslidar::parser::Convert::Convert
Convert()=default
lslidar_parser.h
These classes Unpack raw Lslidar LIDAR packets into several useful formats.
apollo
class register implement
Definition
arena_queue.h:37
apollo::drivers::PointCloud
Definition
pointcloud.proto:14
apollo::drivers::lslidar::Config
Definition
config.proto:10
apollo::drivers::lslidar::LslidarScan
Definition
lslidar.proto:33
modules
drivers
lidar
lslidar
parser
convert.h