Error in creating camera sensor handle while headless

Hi, I want to use camera sensors while headless, but I got an error in creating camera sensor handle.

It is same problem as the below link:

Continuing the discussion from Error using camera in headless mode

I’ve followed other topics too but it did not work.

Also I can run the example too.

Please give any solution to resolve the problem.

Hi @seong_drgn

The problem comes from line 89

The configuration for enabling camera sensors (enableCameraSensors) in Isaac Gym environments is defined at task.env.enableCameraSensors however, the configuration in the script is looking at task.enableCameraSensors.

Because this last sub-key does not exist, enable_camera_sensors = config.get("enableCameraSensors", False) is always returning False. Then, when headless is True, the final graphics_device_id is -1

To create and set the sub-key, when running the script, use +task.enableCameraSensors=True


python task=Cartpole headless=True +task.enableCameraSensors=True

Or edit the line 89

enable_camera_sensors = config["env"].get("enableCameraSensors", False)

and use the original configuration sub-key:


python task=Cartpole headless=True task.env.enableCameraSensors=True

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.