fix path errors

This commit is contained in:
ykcheungab
2026-08-26 19:22:37 +08:00
parent 2cb152b76e
commit d59e1cb7fb
35 changed files with 546 additions and 69 deletions
+7 -2
View File
@@ -7,6 +7,10 @@ from pathlib import Path
import numpy as np
DEFAULT_FINGER_VIZ_POSE = "sensors/finger/assets/visualization/world_to_cam.npy"
_LEGACY_FINGER_VIZ_POSES = {
"assets/finger/visualization/world_to_cam.npy",
DEFAULT_FINGER_VIZ_POSE,
}
def _finger_bundle_viz_pose_candidates() -> list[Path]:
@@ -63,8 +67,9 @@ def resolve_viz_pose_path(path: str | Path | None = None) -> Path:
here = Path(__file__).resolve()
candidates: list[Path] = []
# Prefer the sensors/finger bundle for the default (and matching relative) path.
if path is None or raw.as_posix() == DEFAULT_FINGER_VIZ_POSE or not raw.is_absolute():
# Prefer the sensors/finger bundle for default / legacy relative paths.
posix = raw.as_posix()
if path is None or posix in _LEGACY_FINGER_VIZ_POSES or not raw.is_absolute():
candidates.extend(_finger_bundle_viz_pose_candidates())
try: