cartographer源码分析(23)-sensor-voxel_filter.h

本文详细分析了cartographer项目中sensor-voxel_filter.h的源码,探讨了其在SLAM中的作用。源码可以在特定的GitHub仓库下载,同时文章在多个平台发布。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

源码可在https://github.com/learnmoreonce/SLAM 下载


文件:sensor/voxel_filter.h


#ifndef CARTOGRAPHER_SENSOR_VOXEL_FILTER_H_
#define CARTOGRAPHER_SENSOR_VOXEL_FILTER_H_

#include "cartographer/common/lua_parameter_dictionary.h"
#include "cartographer/mapping_3d/hybrid_grid.h"
#include "cartographer/sensor/point_cloud.h"
#include "cartographer/sensor/proto/adaptive_voxel_filter_options.pb.h"

/*

message AdaptiveVoxelFilterOptions { 
  optional float max_length = 1; 
  optional float min_num_points = 2;
  optional float max_range = 3;
}

2d:
adaptive_voxel_filter = {
      max_length = 0.9,     //voxel_的大小edge的最大值
      min_num_points = 100, //voxel_最多“占据”的points数量
      max_range = 50.,
    },


Voxel, 三维像素,体素
3D模型体素化:http://blog.youkuaiyun.com/bugrunner/article/details/5527332

 */
namespace cartographer {
   
namespace sensor {
   


//返回过滤后的点云,size是体素的长度。
// Returns a voxel filtered copy of 'point_cloud' where 'size' is the length
// a voxel edge.
PointCloud VoxelFiltered(const PointCloud& point_cloud, float size);


/*

体素滤波器,对每一个体素voxel,采用第一个point代替所有的points

VoxelFilter:不可拷贝/不可赋值
默认构造函数指定体素边界大小



*/
// Voxel filter for point clouds. For each voxel, the assembled point cloud
// contains the first point that fell into it from any of the inserted point
// clouds.
class VoxelFilter {
   
 public:
  // 'size' is the length of a voxel edge.
  explicit VoxelFilter(float size);

  VoxelFilter(const VoxelFilter&) = delete;
  VoxelFilter& operator=(const VoxelFilter&) = delete;

  //将点云插入体素网格中
  // Inserts a point cloud into the voxel filter.
  void InsertPointCloud(const PointCloud& point_cloud);

  //返回表达occupied 体素的点云
  // Returns the filtered point cloud represe
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值