Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

meshcat_visualizer: force type of image paths to pathlib.Path #2478

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading