Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
alik-git committed Dec 19, 2024
1 parent cb37c16 commit 7d82c05
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions krecviz/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ def log_frame_data(frame: krec.KRecFrame, frame_idx: int) -> None:


def visualize_krec(
krec_path: Path,
urdf_path: Path | None = None,
output_path: Path | None = None,
krec_path: Path | str,
urdf_path: Path | str | None = None,
output_path: Path | str | None = None,
) -> None:
"""Visualize a KREC recording with a URDF model using Rerun.
Expand All @@ -133,6 +133,11 @@ def visualize_krec(
urdf_path: Path to the URDF file
output_path: Optional path to save the visualization as .rrd file
"""
# Convert string paths to Path objects
krec_path = Path(krec_path) if isinstance(krec_path, str) else krec_path
urdf_path = Path(urdf_path) if isinstance(urdf_path, str) else urdf_path
output_path = Path(output_path) if isinstance(output_path, str) else output_path

# Initialize Rerun
if output_path:
rr.init("urdf_basic_logging", spawn=False)
Expand Down

0 comments on commit 7d82c05

Please sign in to comment.