Skip to content

Commit

Permalink
[MINOR] fix ply data loading with pointwise timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Yue Pan committed Oct 24, 2024
1 parent c49f037 commit 750b0db
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions dataset/slam_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,21 +993,24 @@ def read_point_cloud(
# print("available attributes:", keys)

points = pc_load["positions"]
points = points.astype(dtype=np.float64)

if "t" in keys:
ts = pc_load["t"] * 1e-8
elif "timestamp" in keys:
ts = pc_load["timestamp"]
else:
ts = None
time_fields = ["t", "ts", "time", "timestamp", "timestamps"]

ts = None
for time_field in time_fields:
if time_field in keys:
ts = pc_load[time_field]
break

if "colors" in keys and color_channel == 3:
colors = pc_load["colors"] # if they are available
points = np.hstack((points, colors))
elif "intensity" in keys and color_channel == 1:
intensity = pc_load["intensity"] # if they are available
# print(intensity)
points = np.hstack((points, intensity))

elif ".pcd" in filename: # currently cannot be readed by o3d.t.io
pc_load = o3d.io.read_point_cloud(filename)
points = np.asarray(pc_load.points, dtype=np.float64)
Expand Down
4 changes: 2 additions & 2 deletions utils/mesher.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ def recon_aabb_mesh(
o3d.utility.Vector3iVector(faces),
)

if not self.silence:
print("Marching cubes done")
# if not self.silence:
# print("Marching cubes done")

if estimate_sem:
mesh = self.estimate_vertices_sem(mesh, verts, filter_free_space_vertices)
Expand Down
2 changes: 1 addition & 1 deletion vis_pin_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def vis_pin_map():
sem_mlp = Decoder(config, config.sem_mlp_hidden_dim, config.sem_mlp_level, config.sem_class_count + 1)
color_mlp = Decoder(config, config.color_mlp_hidden_dim, config.color_mlp_level, config.color_channel)

# initialize the feature octree
# initialize the neural point features
neural_points = NeuralPoints(config)

# Load the map
Expand Down

0 comments on commit 750b0db

Please sign in to comment.