RLBench icon indicating copy to clipboard operation
RLBench copied to clipboard

How to add a camera and set its intrinsic and extrinsic parameters?

Open ChaiYing1 opened this issue 1 year ago • 1 comments

I want to add a camera to the slide_block_to_target task, positioned near cam_front (rotating 30 degrees around cam_front with the base as the center). However, after adding the corresponding cam_front2 to all parts of RLBench related to cam_front, I still encounter the following error. How can I add a camera with the same intrinsic parameters but slightly different extrinsic parameters?

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/data_collection/record_demos.py", line 118, in <module>
    env.launch()
  File "/home/anaconda3/envs/lib/python3.11/site-packages/rlbench/environment.py", line 125, in launch
    self._scene = Scene(
                  ^^^^^^
  File "/home/anaconda3/envs/lib/python3.11/site-packages/rlbench/backend/scene.py", line 50, in __init__
    self._cam_front2 = VisionSensor('cam_front2')
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/anaconda3/envs/lib/python3.11/site-packages/pyrep/objects/vision_sensor.py", line 14, in __init__
    super().__init__(name_or_handle)
  File "/home/anaconda3/envs/lib/python3.11/site-packages/pyrep/objects/object.py", line 24, in __init__
    self._handle = sim.simGetObjectHandle(name_or_handle)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/anaconda3/envs/lib/python3.11/site-packages/pyrep/backend/sim.py", line 94, in simGetObjectHandle
    raise RuntimeError('Handle %s does not exist.' % objectName)
RuntimeError: Handle cam_front2 does not exist.
QObject::~QObject: Timers cannot be stopped from another thread
QMutex: destroying locked mutex

ChaiYing1 avatar Nov 27 '24 07:11 ChaiYing1