haosulab / SAPIEN

SAPIEN Embodied AI Platform
https://sapien.ucsd.edu/
MIT License
427 stars 41 forks source link

Issue: IndexError: _Map_base::at #135

Closed wadiuvatzy closed 1 year ago

wadiuvatzy commented 1 year ago

I am using Sapien. When I am taking a picture using its camera with code get_color_rgba(), an error occurs IndexError: _Map_base::at. I have also tried get_float_texture('Color') and got the same error.

Anyone can explain this or fix it?

wadiuvatzy commented 1 year ago
Traceback (most recent call last):
  File "/home/liuyuhao/anaconda3/envs/tactile_sim/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/home/liuyuhao/anaconda3/envs/tactile_sim/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/liuyuhao/workspace/tacktile_vision_fusion/scripts/../utils/gym_env_utils.py", line 44, in _safe_run_worker
    observation = env.reset()
  File "/home/liuyuhao/anaconda3/envs/tactile_sim/lib/python3.8/site-packages/gym/wrappers/order_enforcing.py", line 16, in reset
    return self.env.reset(**kwargs)
  File "/home/liuyuhao/workspace/tacktile_vision_fusion/scripts/../envs/continuous_insertion.py", line 1079, in reset
    obs = super().reset(specify_offset)
  File "/home/liuyuhao/workspace/tacktile_vision_fusion/scripts/../envs/continuous_insertion.py", line 560, in reset
    return self.get_obs()
  File "/home/liuyuhao/workspace/tacktile_vision_fusion/scripts/../envs/continuous_insertion.py", line 767, in get_obs
    rgba = self.main_camera.get_color_rgba() 
IndexError: _Map_base::at
wadiuvatzy commented 1 year ago

I am working on a Ubuntu 18.04 system with NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7

wadiuvatzy commented 1 year ago

I have tried sapien 2.1.0, 2.2.2 and the error was always there

fbxiang commented 1 year ago

It is hard to guess the error without code. My best guess is that camera.take_picture is not called before calling get_color_rgba, so the camera does not know what texture names exist, causing a map indexing error.