Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
benemer committed Mar 28, 2024
1 parent 44e59e8 commit 23fbe6d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/lidar_visualizer/datasets/helipr.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,16 @@ def __init__(self, data_dir: Path, *_, **__):
if self.sequence_id == "Avia":
self.format_string = "fffBBBL"
self.index_intensity = None
self.index_time = 6
elif self.sequence_id == "Aeva":
self.format_string = "ffffflBf"
self.format_string_no_intensity = "ffffflB"
self.index_intensity = 7
self.index_time = 5
elif self.sequence_id == "Ouster":
self.format_string = "ffffIHHH"
self.index_intensity = 3
self.index_time = 4
elif self.sequence_id == "Velodyne":
self.format_string = "ffffHf"
self.index_intensity = 3
self.index_time = 5
else:
print("[ERROR] Unsupported LiDAR Type")
sys.exit()
Expand All @@ -90,8 +86,7 @@ def __len__(self):
return len(self.scan_files)

def __getitem__(self, idx):
data = self.get_data(idx)
return self.read_point_cloud(data)
return self.read_point_cloud(idx)

def get_data(self, idx: int):
file_path = self.scan_files[idx]
Expand All @@ -114,7 +109,8 @@ def get_data(self, idx: int):
data = np.stack(list_lines)
return data

def read_point_cloud(self, data: np.ndarray):
def read_point_cloud(self, idx: int):
data = self.get_data(idx)
points = data[:, :3]
scan = self.o3d.geometry.PointCloud()
scan.points = self.o3d.utility.Vector3dVector(points)
Expand Down

0 comments on commit 23fbe6d

Please sign in to comment.