Skip to content

Commit

Permalink
Use string
Browse files Browse the repository at this point in the history
  • Loading branch information
benemer committed Mar 26, 2024
1 parent a9ad864 commit 39fdf9b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions python/kiss_icp/datasets/kitti.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@


class KITTIOdometryDataset:
def __init__(self, data_dir, sequence: int, *_, **__):
self.sequence_id = str(int(sequence)).zfill(2)
def __init__(self, data_dir, sequence: str, *_, **__):
self.sequence_id = sequence.zfill(2)
self.kitti_sequence_dir = os.path.join(data_dir, "sequences", self.sequence_id)
self.velodyne_dir = os.path.join(self.kitti_sequence_dir, "velodyne/")

self.scan_files = sorted(glob.glob(self.velodyne_dir + "*.bin"))
self.calibration = self.read_calib_file(os.path.join(self.kitti_sequence_dir, "calib.txt"))

# Load GT Poses (if available)
if sequence < 11:
if int(sequence) < 11:
self.poses_fn = os.path.join(data_dir, f"poses/{self.sequence_id}.txt")
self.gt_poses = self.load_poses(self.poses_fn)

Expand Down
26 changes: 13 additions & 13 deletions python/kiss_icp/datasets/kitti_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@
import numpy as np

__raw_to_odometry_mapping__ = {
0: "2011_10_03/2011_10_03_drive_0027_sync/",
1: "2011_10_03/2011_10_03_drive_0042_sync/",
2: "2011_10_03/2011_10_03_drive_0034_sync/",
4: "2011_09_30/2011_09_30_drive_0016_sync/",
5: "2011_09_30/2011_09_30_drive_0018_sync/",
6: "2011_09_30/2011_09_30_drive_0020_sync/",
7: "2011_09_30/2011_09_30_drive_0027_sync/",
8: "2011_09_30/2011_09_30_drive_0028_sync/",
9: "2011_09_30/2011_09_30_drive_0033_sync/",
10: "2011_09_30/2011_09_30_drive_0034_sync/",
"00": "2011_10_03/2011_10_03_drive_0027_sync/",
"01": "2011_10_03/2011_10_03_drive_0042_sync/",
"02": "2011_10_03/2011_10_03_drive_0034_sync/",
"04": "2011_09_30/2011_09_30_drive_0016_sync/",
"05": "2011_09_30/2011_09_30_drive_0018_sync/",
"06": "2011_09_30/2011_09_30_drive_0020_sync/",
"07": "2011_09_30/2011_09_30_drive_0027_sync/",
"08": "2011_09_30/2011_09_30_drive_0028_sync/",
"09": "2011_09_30/2011_09_30_drive_0033_sync/",
"10": "2011_09_30/2011_09_30_drive_0034_sync/",
}


class KITTIRawDataset:
def __init__(self, data_dir: Path, sequence: int, *_, **__):
self.sequence_id = str(int(sequence)).zfill(2)
self.root_dir = os.path.realpath(data_dir / __raw_to_odometry_mapping__[sequence])
def __init__(self, data_dir: Path, sequence: str, *_, **__):
self.sequence_id = sequence.zfill(2)
self.root_dir = os.path.realpath(data_dir / __raw_to_odometry_mapping__[self.sequence_id])
self.date_id = self.root_dir.split("/")[-2]
self.valid_idx = self.get_benchmark_indices(self.sequence_id)

Expand Down
4 changes: 2 additions & 2 deletions python/kiss_icp/datasets/nuscenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


class NuScenesDataset:
def __init__(self, data_dir: Path, sequence: int, *_, **__):
def __init__(self, data_dir: Path, sequence: str, *_, **__):
try:
importlib.import_module("nuscenes")
except ModuleNotFoundError:
Expand All @@ -49,7 +49,7 @@ def __init__(self, data_dir: Path, sequence: int, *_, **__):
from nuscenes.nuscenes import NuScenes
from nuscenes.utils.splits import create_splits_logs

self.sequence_id = str(int(sequence)).zfill(4)
self.sequence_id = sequence.zfill(4)

self.nusc = NuScenes(dataroot=str(data_dir), version=nusc_version)
self.scene_name = f"scene-{self.sequence_id}"
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/tools/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def kiss_icp_pipeline(
help="[Optional] Open an online visualization of the KISS-ICP pipeline",
rich_help_panel="Additional Options",
),
sequence: Optional[int] = typer.Option(
sequence: Optional[str] = typer.Option(
None,
"--sequence",
"-s",
Expand Down

0 comments on commit 39fdf9b

Please sign in to comment.