Skip to content

Commit ff84360

Browse files
authored
fix(tasks): track_knife tracks the knife asset, not the teapot (#778)
The tracked "object" RigidObjCfg in track_knife.py had usd/urdf/mjcf paths copied from track_ceramic_teapot (all_asset/ceramic_teapot/...), while the task loads the knife grasp-state pkl and uses the knife centre offset — so the simulated manipuland (a teapot) mismatched the grasp poses the reward assumes. Point the three asset paths at the knife asset, matching approach_grasp_knife.py (mjcf is knife/knife.xml, directly under the asset dir). A full sweep of all track_*/approach_grasp_* tasks confirmed this was the only mismatched manipuland asset. Adds a backend-free regression test inspecting the ScenarioCfg object paths. Red on pre-fix.
1 parent a0ad877 commit ff84360

2 files changed

Lines changed: 33 additions & 3 deletions

File tree

roboverse_pack/tasks/pick_place/track_knife.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ class PickPlaceTrackKnife(PickPlaceBase):
172172
scale=(1, 1, 1),
173173
enabled_gravity=False,
174174
physics=PhysicStateType.RIGIDBODY,
175-
usd_path="roboverse_data/EmbodiedGenData/all_asset/ceramic_teapot/usd/ceramic_teapot.usd",
176-
urdf_path="roboverse_data/EmbodiedGenData/all_asset/ceramic_teapot/ceramic_teapot.urdf",
177-
mjcf_path="roboverse_data/EmbodiedGenData/all_asset/ceramic_teapot/mjcf/ceramic_teapot.xml",
175+
usd_path="roboverse_data/EmbodiedGenData/all_asset/knife/usd/knife.usd",
176+
urdf_path="roboverse_data/EmbodiedGenData/all_asset/knife/knife.urdf",
177+
mjcf_path="roboverse_data/EmbodiedGenData/all_asset/knife/knife.xml",
178178
),
179179
RigidObjCfg(
180180
name="plate",

tests/test_track_knife_asset.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""Regression: the track_knife task must load the knife asset, not the teapot.
2+
3+
``PickPlaceTrackKnife``'s tracked ``"object"`` had its usd/urdf/mjcf paths copied
4+
from ``track_ceramic_teapot`` (all_asset/ceramic_teapot/...), while the rest of
5+
the task is knife-specific (knife grasp-state pkl, knife centre offset). So the
6+
simulated object (a teapot) mismatched the grasp poses the reward assumes. This
7+
pins the corrected knife asset. Backend-free: the task class is importable and
8+
its ScenarioCfg is inspectable without a simulator.
9+
"""
10+
11+
from __future__ import annotations
12+
13+
import pytest
14+
15+
16+
@pytest.mark.general
17+
def test_track_knife_object_uses_knife_asset():
18+
from roboverse_pack.tasks.pick_place.track_knife import PickPlaceTrackKnife
19+
20+
obj = next(o for o in PickPlaceTrackKnife.scenario.objects if o.name == "object")
21+
22+
for path in (obj.usd_path, obj.urdf_path, obj.mjcf_path):
23+
assert "ceramic_teapot" not in path, f"track_knife still references the teapot asset: {path}"
24+
assert "knife" in path, f"track_knife object path is not the knife asset: {path}"
25+
26+
# Match the sibling approach_grasp_knife.py layout exactly (mjcf lives directly
27+
# under knife/, not knife/mjcf/).
28+
assert obj.usd_path == "roboverse_data/EmbodiedGenData/all_asset/knife/usd/knife.usd"
29+
assert obj.urdf_path == "roboverse_data/EmbodiedGenData/all_asset/knife/knife.urdf"
30+
assert obj.mjcf_path == "roboverse_data/EmbodiedGenData/all_asset/knife/knife.xml"

0 commit comments

Comments
 (0)