Skip to content

Commit

Permalink
reading mcap from folder
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-ferrari committed Sep 18, 2024
1 parent 4459972 commit 28e13b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mad_icp/apps/mad_icp.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def main(data_path: Annotated[
elif len(list(data_path.glob("*.db3"))) != 0:
console.print("[yellow] The dataset is in ros2 db3 format")
reader_type = InputDataInterface.ros2
elif os.path.isfile(data_path) and data_path.suffix == ".mcap":
elif len(list(data_path.glob("*.mcap"))) != 0:
console.print("[yellow] The dataset is in ros2 mcap format")
reader_type = InputDataInterface.mcap
else:
Expand Down
5 changes: 3 additions & 2 deletions mad_icp/apps/utils/mcap_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ def __init__(self, data_dir: Path, min_range=0,
self.min_range = min_range
self.max_range = max_range

assert os.path.isfile(data_dir), "mcap dataloader expects an existing MCAP file"
mcap_file = str(data_dir)
mcap_file_path = next(data_dir.glob("*.mcap"), None)
assert os.path.isfile(mcap_file_path), "mcap dataloader expects an existing MCAP file"
mcap_file = str(mcap_file_path)

self.bag = make_reader(open(mcap_file, "rb"))
self.summary = self.bag.get_summary()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "mad-icp"
version = "0.0.5"
version = "0.0.6"
description = "It Is All About Matching Data -- Robust and Informed LiDAR Odometry"
readme = "README.md"
authors = [
Expand Down

0 comments on commit 28e13b8

Please sign in to comment.