cartographer/mapping/3d/range_data_inserter_3d.h¶
Overview¶
RangeDataInserter3D inserts 3D range data (hits and misses) into a HybridGrid, and optionally an IntensityHybridGrid, using precomputed log-odds lookup tables. It is the 3D counterpart of the 2D probability-grid range data inserter and is used by Submap3D to update its high- and low-resolution hybrid grids.
Class: cartographer::mapping::RangeDataInserter3D¶
Construction¶
explicit RangeDataInserter3D(const proto::RangeDataInserterOptions3D& options);
Precomputes two lookup tables via ComputeLookupTableToApplyOdds(Odds(p)):
hit_table_fromhit_probability(must be > 0.5).miss_table_frommiss_probability(must be < 0.5).
Insert¶
void Insert(const sensor::RangeData& range_data, HybridGrid* hybrid_grid,
IntensityHybridGrid* intensity_hybrid_grid) const;
Insertion order:
Hits. Every point in
range_data.returnsis rasterized into its voxel and thehit_table_is applied withApplyLookupTable. Hits are inserted before misses so that a hit in a cell is never overwritten by a miss in the same cell — hits have priority.Misses.
InsertMissesIntoGridcasts a ray fromrange_data.originto each hit voxel. The number of samples along the ray equals the Chebyshev distance between the origin and hit cells, and only the lastnum_free_space_voxelsvoxels before the hit are updated withmiss_table_(for performance). This frees up space directly in front of surfaces.Intensities. If an intensity grid is provided and the point cloud carries intensities, points with intensity above
intensity_thresholdare skipped and the rest are added viaIntensityHybridGrid::AddIntensity.hybrid_grid->FinishUpdate()finalizes the batch of updates for the grid’s internal caching.
void InsertMissesIntoGrid(const std::vector<uint16>& miss_table,
const Eigen::Vector3f& origin,
const sensor::PointCloud& returns,
HybridGrid* hybrid_grid,
const int num_free_space_voxels);
Options¶
proto::RangeDataInserterOptions3D:
Field |
Type |
Meaning |
|---|---|---|
|
double |
Occupancy probability applied to hit voxels (must be > 0.5) |
|
double |
Occupancy probability applied to miss voxels (must be < 0.5) |
|
int |
Number of voxels before each hit updated as free space |
|
double |
Only intensities below this value are inserted |
Configuration¶
From trajectory_builder_3d.lua (embedded in submaps):
range_data_inserter = {
hit_probability = 0.55,
miss_probability = 0.49,
num_free_space_voxels = 5,
intensity_threshold = 0.95,
}
CreateRangeDataInserterOptions3D() reads the four keys and validates the hit/miss probability bounds.
Role in the SLAM Pipeline¶
Submap3D::InsertData uses this inserter to update the high-resolution hybrid grid, the low-resolution hybrid grid, and (when configured) the intensity hybrid grid. Because a RangeDataInserter3D instance is shared between submaps, the precomputed lookup tables are built once.
See Also¶
Submap3D — Owns and applies the inserter
HybridGrid — The grid being updated
RangeData — The input data structure
ProbabilityGrid — 2D counterpart