diff --git a/src/jaxsim/mujoco/visualizer.py b/src/jaxsim/mujoco/visualizer.py index 810391f36..bbf2f400d 100644 --- a/src/jaxsim/mujoco/visualizer.py +++ b/src/jaxsim/mujoco/visualizer.py @@ -81,6 +81,9 @@ def record_frame(self, camera_name: str | None = None) -> None: def write_video(self, path: pathlib.Path, exist_ok: bool = False) -> None: """Writes the video to a file.""" + # Resolve the path to the video. + path = path.expanduser().resolve() + if path.is_dir(): raise IsADirectoryError(f"The path '{path}' is a directory.")