源码可在https://github.com/learnmoreonce/SLAM 下载
文件:sensor/range_data.h
#ifndef CARTOGRAPHER_SENSOR_RANGE_DATA_H_
#define CARTOGRAPHER_SENSOR_RANGE_DATA_H_
#include "cartographer/common/port.h"
#include "cartographer/sensor/compressed_point_cloud.h"
#include "cartographer/sensor/point_cloud.h"
#include "cartographer/sensor/proto/sensor.pb.h"
namespace cartographer {
namespace sensor {
/*
RangeData:
数据成员包括
1),原始位置,{x0,y0,z0}
2),返回点云,{x,y,z}
3),缺失点云,标识free space.
*/
// Rays begin at 'origin'. 'returns' are the points where obstructions were
// detected. 'misses' are points in the direction of rays for which no return
// was detected, and were inserted at a configured distance. It is assumed that
// between the 'origin' and 'misses' is free space.
struct RangeData {
Eigen::Vector3f origin;//{x0,y0,z0},sensor坐标。
PointCloud returns; //反射位置{x,y,z},表征有物体反射。
PointCloud misses; //无反射,自由空间
};
// Converts 'range_data' to a proto::RangeData. 序列化
proto::RangeData ToProto(const RangeData& range_data);
// Converts 'proto' to a RangeData. 反序列化
RangeData FromProto(const proto::RangeData& proto);
//对数据进行3d变换,转换为机器坐标
RangeData TransformRangeData(