Page 1 of 1

p.getCameraImage stuck after a few calls

Posted: Sun Mar 06, 2022 12:05 pm
by nic_olas_s
Hi PyBullet Community,

in a small PyBullet setup we simulate an inhand mounted camera.
We use p.getCameraImage as follows to get rgb and depth data, which in general works.
However, after a few calls to that function our program seems stuck.
We debugged our code a bit and apparently it is stuck exactly at the getCameraImage call.

Has anybody here experienced something similar?

I also tried the ER_BULLET_HARDWARE_OPENGL renderer with the same behaviour.

Code: Select all

        _, _, rgb_img, depth_img, seg_img = p.getCameraImage(
            width, height, view_matrix, projection_matrix, physicsClientId=self.sim, renderer=p.ER_TINY_RENDERER
        )

Re: p.getCameraImage stuck after a few calls

Posted: Tue Mar 15, 2022 2:47 am
by Erwin Coumans
I've never seen this issue before, and many researchers used pybullet with camera rendering. Did you check memory use?

Re: p.getCameraImage stuck after a few calls

Posted: Wed Jun 15, 2022 3:33 pm
by andytgl
I do experience a similar issue - querying p.getCameraImage for a large number of times causes the function to hang. I am using pybullet.ER_TINY_RENDERER. Has anyone else experienced the same issue and found a solution?

Re: p.getCameraImage stuck after a few calls

Posted: Wed Jun 15, 2022 5:52 pm
by andytgl
I did solve my issue by switching to 'eglRenderer', e.g., by adding the following lines (from https://github.com/bulletphysics/bullet ... derTest.py) upon initialization:

Code: Select all

        # Initialize pybullet
        connection_mode=p.DIRECT
        self.ch =  bc.BulletClient(connection_mode)

        # Load eglRendered
        self.ch.setAdditionalSearchPath(pybullet_data.getDataPath())
        self.plugin = self.ch.loadPlugin(egl.get_filename(), "_eglRendererPlugin")
        print("plugin=", self.plugin)