Skip to content

Commit

Permalink
meshcat_visualizer: force type of image paths to pathlib.Path
Browse files Browse the repository at this point in the history
  • Loading branch information
abussy-aldebaran committed Nov 15, 2024
1 parent 470ec5a commit 20cffc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/python/pinocchio/visualize/meshcat_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ def __init__(self, dae_path: str, cache: Optional[Set[str]] = None) -> None:

# Encode texture in base64
img_path_abs = img_path
if not img_path.is_absolute():
if not Path(img_path).is_absolute():
img_path_abs = os.path.normpath(dae_dir / img_path_abs)
if not img_path_abs.is_file():
if not Path(img_path_abs).is_file():
raise UserWarning(f"Texture '{img_path}' not found.")
with Path(img_path_abs).open("rb") as img_file:
img_data = base64.b64encode(img_file.read())
Expand Down

0 comments on commit 20cffc6

Please sign in to comment.