Skip to content

Commit 82a9ff5

Browse files
Fix known issues with dataloaders (#420)
1 parent 286ef70 commit 82a9ff5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

python/kiss_icp/datasets/mulran.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ def read_point_cloud(self, file_path: str):
4848
timestamps = self.get_timestamps()
4949
if points.shape[0] != timestamps.shape[0]:
5050
# MuRan has some broken point clouds, just fallback to no timestamps
51-
return points.astype(np.float64), np.ones(points.shape[0])
51+
return points.astype(np.float64), np.array([])
5252
return points.astype(np.float64), timestamps
5353

5454
@staticmethod
5555
def get_timestamps():
5656
H = 64
5757
W = 1024
58-
return (np.floor(np.arange(H * W) / H) / W).reshape(-1, 1)
58+
return np.floor(np.arange(H * W) / H) / W
5959

6060
def load_gt_poses(self, poses_file: str):
6161
"""MuRan has more poses than scans, therefore we need to match 1-1 timestamp with pose"""

python/kiss_icp/datasets/ncd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ def getitem(self, scan_file: str):
5959
points = self.PyntCloud.from_file(scan_file).points[["x", "y", "z"]].to_numpy()
6060
timestamps = self.get_timestamps()
6161
if points.shape[0] != timestamps.shape[0]:
62-
# MuRan has some broken point clouds, just fallback to no timestamps
63-
return points.astype(np.float64), np.ones(points.shape[0])
62+
# Newer College has some broken point clouds, just fallback to no timestamps
63+
return points.astype(np.float64), np.array([])
6464
return points.astype(np.float64), timestamps
6565

6666
@staticmethod
6767
def get_timestamps():
6868
H = 64
6969
W = 1024
70-
return (np.floor(np.arange(H * W) / H) / W).reshape(-1, 1)
70+
return np.floor(np.arange(H * W) / H) / W
7171

7272
@staticmethod
7373
def get_pcd_filenames(scans_folder):

0 commit comments

Comments
 (0)