20#include "Eigen/Geometry"
27namespace localization {
32 CHECK_NOTNULL(lidar_frame);
35 for (
unsigned int i = 0; i < msg.
height(); ++i) {
36 for (
unsigned int j = 0; j < msg.
width(); ++j) {
38 pt3d[0] =
static_cast<double>(msg.
point(i * msg.
width() + j).
x());
39 pt3d[1] =
static_cast<double>(msg.
point(i * msg.
width() + j).y());
40 pt3d[2] =
static_cast<double>(msg.
point(i * msg.
width() + j).z());
41 if (!std::isnan(pt3d[0])) {
42 Eigen::Vector3d pt3d_tem = pt3d;
47 unsigned char intensity =
static_cast<unsigned char>(
49 lidar_frame->
pt_xs.push_back(pt3d[0]);
50 lidar_frame->
pt_ys.push_back(pt3d[1]);
51 lidar_frame->
pt_zs.push_back(pt3d[2]);
57 AINFO <<
"Receiving un-organized-point-cloud, width " << msg.
width()
58 <<
" height " << msg.
height() <<
"size " << msg.point_size();
59 for (
int i = 0; i < msg.point_size(); ++i) {
61 pt3d[0] =
static_cast<double>(msg.
point(i).
x());
62 pt3d[1] =
static_cast<double>(msg.
point(i).
y());
63 pt3d[2] =
static_cast<double>(msg.
point(i).
z());
64 if (!std::isnan(pt3d[0])) {
65 Eigen::Vector3d pt3d_tem = pt3d;
70 unsigned char intensity =
72 lidar_frame->
pt_xs.push_back(pt3d[0]);
73 lidar_frame->
pt_ys.push_back(pt3d[1]);
74 lidar_frame->
pt_zs.push_back(pt3d[2]);
82 if (FLAGS_lidar_debug_log_flag) {
83 AINFO << std::setprecision(15) <<
"LocalLidar Debug Log: velodyne msg. "
85 <<
"][height:" << msg.
height() <<
"][width:" << msg.
width()
86 <<
"][point_cnt:" << msg.point_size() <<
"]";
Cyber has builtin time type Time.
double ToSecond() const
convert time to second.
void Transfer(const drivers::PointCloud &message, LidarFrame *lidar_frame)
The class of LidarMagTransfer
The gflags used by localization module
optional double measurement_time
repeated PointXYZIT point
optional uint32 intensity
std::vector< double > pt_ys
std::vector< double > pt_xs
std::vector< unsigned char > intensities
std::vector< double > pt_zs