carlosferrazza / humanoid-bench

Other
356 stars 37 forks source link

[Bug] ObservationWrapper.reset_model forget task.reset_model() #15

Closed Xianqi-Zhang closed 3 months ago

Xianqi-Zhang commented 3 months ago

Hi, Thanks for your sharing. I would like to report a bug.

To get visual observation,

parser.add_argument('--obs_wrapper', default='True')
parser.add_argument('--sensors', default='image')

For env window and bookshelf,

python -m humanoid_bench.test_env --env h1hand-bookshelf_hard-v0
python -m humanoid_bench.test_env --env h1hand-bookshelf_simple-v0

Error message AttributeError: 'Window' object has no attribute 'head_pos0'

Since some variables are initialized in reset_model(), but it is not called in ObeservationWrapper.reset_model() https://github.com/carlosferrazza/humanoid-bench/blob/3951d65bc85e16a562d091a7f4820150c20ed91f/humanoid_bench/wrappers.py#L554-L555

Solution

    def reset_model(self):
        self.task.reset_model()
        return self.get_obs()

Best regards.

carlosferrazza commented 3 months ago

Thanks for the interest in our work! We have restructured the wrapper code to enable the possibility of nesting different wrappers. In the new updates, the issue above should also be solved.