ethz-asl / voxblox

A library for flexible voxel-based mapping, mainly focusing on truncated and Euclidean signed distance fields.
BSD 3-Clause "New" or "Revised" License
1.37k stars 357 forks source link

How to calculate memory usage & volume explored? #415

Open SwiftGust opened 5 months ago

SwiftGust commented 5 months ago

Hi, I'd like to know how to calculate volume & memory of voxblox is using

  1. For memory usage, I know there is a function for layer memory calculation but it seems returns far lesser than actual voxblox program using (i.e - verbose output of running TSDF server on cow_and_lady dataset says about 42.1MB [ INFO] [1717035719.497574596]: Layer memory: 42066875 after completion but TSDF server node itself consumes 182.2MB in my desktop environment, with have disabled mesh layer on purpose.
  2. For volume, would this be correct way to calculate volume of any voxblox layer if not please correct me. each block contains cubic of voxels_perside and volume per voxel is also cubic of resolution so multiply by number of blocks
    size_t num_blocks = getNumberOfAllocatedBlocks();
    size_t num_voxels_per_block = voxels_per_side_ * voxels_per_side_ * voxels_per_side_;
    double volume_per_voxel = voxel_size_ * voxel_size_ * voxel_size_;
    double volume = num_voxels_per_block * num_blocks * volume_per_voxel;

Thank you