MCPcopy Create free account
hub / github.com/Robotics-STAR-Lab/H2-Mapping / update_grid

Method update_grid

mapping/src/mapping.py:400–416  ·  view source on GitHub ↗
(self, voxels, children, vertexes, svo_idx)

Source from the content-addressed store, hash-verified

398
399 @torch.enable_grad()
400 def update_grid(self, voxels, children, vertexes, svo_idx):
401
402 centres = (voxels[:, :3] + voxels[:, -1:] / 2) * self.voxel_size
403 children = torch.cat([children, voxels[:, -1:]], -1)
404
405 centres = centres.cuda().float()
406 children = children.cuda().int()
407
408 map_states = {}
409 map_states["voxels"] = voxels.cuda()
410 map_states["voxel_vertex_idx"] = vertexes.cuda()
411 map_states["voxel_center_xyz"] = centres.cuda()
412 map_states["voxel_structure"] = children.cuda()
413 map_states["sdf_priors"] = self.sdf_priors
414 map_states["svo_idx"] = svo_idx.cuda()
415
416 self.map_states = map_states
417
418 @torch.no_grad()
419 def get_updated_poses(self):

Callers 1

create_voxelsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected