IsaacLab icon indicating copy to clipboard operation
IsaacLab copied to clipboard

[Bug Report] Adding call for CV2 imshow will freeze entire Isaac-Sim

Open ahanjaya opened this issue 1 year ago • 2 comments

Describe the bug

The bug is about calling the OpenCV window to render the camera image from the robot. The entire simulation will stuck on startup.

Steps to reproduce

def _debug_vis_callback(self, event):
     cv2.imshow("Robot Depth Frame", self.grid_depth_img)
     cv2.waitKey(1)

Please try to provide a minimal example to reproduce the bug. Error messages and stack traces are also helpful. 2024-08-09-112134_1278x1417_scrot

System Info

Describe the characteristics of your environment:

  • Commit: 6451d235785780167f80c14bb9d635d20aff9b29
  • Isaac Sim Version: 4.0.0-rc.21+4.0.13872.3e3cb0c9.gl
  • OS: Ubuntu 22.04
  • GPU: RTX 4090
  • CUDA: 12.3
  • GPU Driver: 545.23.08

Additional context

Previously this bug never occurred, I could easily stream the OpenCV result with the same code GetImage

Checklist

  • [x] I have checked that there is no similar issue in the repo (required)
  • [ ] I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

Add the criteria for which this task is considered done. If not known at issue creation time, you can add this once the issue is assigned.

  • [ ] Criteria 1
  • [ ] Criteria 2

ahanjaya avatar Aug 09 '24 03:08 ahanjaya

I'm not super familiar with cv2, but I think you can remove the cv2.waitKey(1) call to avoid blocking the simulation environment.

Let us know if this works for your issue!

jsmith-bdai avatar Aug 09 '24 10:08 jsmith-bdai

it still doesn't work, even by simply initializing the OpenCV window

def _set_debug_vis_impl(self, debug_vis: bool):
    if self.cfg.show_depth:
        cv2.namedWindow("Robot Depth Frame", cv2.WINDOW_NORMAL)

I did this before and had no problem the last 2 weeks, but after I rebased to the latest main branch this issue occured.

ahanjaya avatar Aug 12 '24 03:08 ahanjaya

Our apologies we couldn't follow up in a timely manner. If you still have this issue with the latest Isaac Sim, please post a topic in the forums. Thank you.

RandomOakForest avatar Jan 05 '25 06:01 RandomOakForest