Skip to content

Commit

Permalink
Improve logging if invalid object to scale
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-thankyou-lin committed Feb 27, 2025
1 parent 1e1ca86 commit 481d60d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion robosuite/models/arenas/arena.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ def set_scale(self, scale: Union[float, List[float]], obj_name: str):
"""
obj = self.worldbody.find(f"./body[@name='{obj_name}']")
if obj is None:
raise ValueError(f"Object {obj_name} not found in arena; cannot set scale.")
bodies = self.worldbody.findall("./body")
body_names = [body.get("name") for body in bodies if body.get("name") is not None]
raise ValueError(f"Object {obj_name} not found in arena; cannot set scale. Available objects: {body_names}")
self.object_scales[obj.get("name")] = scale

# scale geoms
Expand Down

0 comments on commit 481d60d

Please sign in to comment.