Skip to content

Commit

Permalink
Changed timestamp format during KITTI conversion to include nanosecon…
Browse files Browse the repository at this point in the history
…ds. Required for precise data-stamp associations
  • Loading branch information
EmanueleGiacomini committed Jun 18, 2024
1 parent 987ae4c commit 0445515
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "vbr-devkit"
version = "0.0.9"
version = "0.1.0"
description = "Development kit for VBR SLAM dataset"
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion python/vbr_devkit/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.9"
__version__ = "0.10.0"
7 changes: 4 additions & 3 deletions python/vbr_devkit/datasets/kitti.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ def _save_cloud(self, data: PointCloudXf, timestamp, *args, **kwargs):
clip_points = np.stack([data.points["x"], data.points["y"], data.points["z"], data.points["intensity"]],
axis=1)
clip_points.tofile(dest_path)
else:
data.points.tofile(dest_path)
return

data.points.tofile(dest_path)

def _save_image(self, data: Image, timestamp: float, *args, **kwargs):
dest_path = self.data_f / Path(self.format_fn(self.metadata["num_messages"]) + ".png")
Expand Down Expand Up @@ -117,7 +118,7 @@ def close(self):
json.dump(self.metadata, f)
with self.timestamps_f.open("w") as f:
f.writelines([
str(datetime.fromtimestamp(float(t) / 1e9)) + "\n" for t in self.timestamps])
str(np.datetime64(t, "ns")) + "\n" for t in self.timestamps])


class KittiWriter:
Expand Down

0 comments on commit 0445515

Please sign in to comment.