16 const auto& mean = voxel.mean;
17 const auto& cov = voxel.cov;
18 const auto intensity = voxel.intensity;
21 this->num_points = voxel.num_points;
22 this->mean << mean[0], mean[1], mean[2];
23 this->cov << cov(0, 0), cov(0, 1), cov(0, 2), cov(1, 1), cov(1, 2), cov(2, 2);
24 this->intensity = intensity;
27 std::shared_ptr<std::pair<VoxelInfo, GaussianVoxel>> uncompact()
const {
28 auto uncompacted = std::make_shared<std::pair<VoxelInfo, GaussianVoxel>>();
29 uncompacted->first.lru = 0;
30 uncompacted->first.coord = coord;
32 auto& voxel = uncompacted->second;
33 voxel.finalized =
true;
34 voxel.num_points = num_points;
35 voxel.mean << mean.cast<
double>(), 1.0;
37 voxel.cov(0, 0) = cov[0];
38 voxel.cov(0, 1) = voxel.cov(1, 0) = cov[1];
39 voxel.cov(0, 2) = voxel.cov(2, 0) = cov[2];
40 voxel.cov(1, 1) = cov[3];
41 voxel.cov(1, 2) = voxel.cov(2, 1) = cov[4];
42 voxel.cov(2, 2) = cov[5];
44 voxel.intensity = intensity;
49 Eigen::Vector3i coord;
52 Eigen::Matrix<float, 6, 1> cov;