Skip to content

Commit

Permalink
Merge pull request #2478 from abussy-aldebaran/topic/dae_texture
Browse files Browse the repository at this point in the history
meshcat_visualizer: force type of image paths to pathlib.Path
  • Loading branch information
jcarpent authored Nov 15, 2024
2 parents 470ec5a + e774dde commit 0fc3e9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Fix mjcf parsing of armature and of the default tag in models ([#2477](https://github.com/stack-of-tasks/pinocchio/pull/2477))
- Fix undefined behavior when using the site attribute in mjcf ([#2477](https://github.com/stack-of-tasks/pinocchio/pull/2477))
- Fix the type of image paths when loading textures in the meshcat visualizer ([#2478](https://github.com/stack-of-tasks/pinocchio/pull/2478))

### Changed
- On GNU/Linux and macOS, hide all symbols by default ([#2469](https://github.com/stack-of-tasks/pinocchio/pull/2469))
Expand Down
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 0fc3e9d

Please sign in to comment.