Physx Contact Reporter Error 22


I’m asking for help here because I have a weird error since a few days, I’m trying to do things with physics (pretty simple things like triggering something when an objects collide another), and I’m trying to use the contact reporter, but weirdly, at some points it throw me this error when there is a collision:

2022-12-09 09:06:03 [Error] [carb.physx.python] c:/users/fablab/appdata/local/ov/pkg/code-2022.3.0/kit/kernel/py\omni\kit\ write
2022-12-09 09:06:03 [Error] [carb.physx.python] c:\users\fablab\appdata\local\ov\pkg\code-2022.3.0\kit\extsphysics\omni.physx.demos-104.0.4-5.1\omni\physxdemos\scenes\ _on_physics_step

And I just can’t get over it, even when going back to the Demo scenes I still have this. Is there ban explanation ?


can you please send me the full log or some context? Looking at the demo, the error is on line 93, while trying to print the contact header information:

    def _on_physics_step(self, dt):
        contact_headers, contact_data = get_physx_simulation_interface().get_contact_report()
        for contact_header in contact_headers:
            print("Got contact header type: " + str(contact_header.type))

Not sure I follow where the problem could be. Can you please describe more closely what is going on?

Here is log when it begun to print the errors (and a bit before):

2022-12-09 09:43:04 [1,998,317ms] [Info] [] [py stdout]: Contact position: (-646.865,108.367,-544.249)

2022-12-09 09:43:04 [1,998,317ms] [Info] [] [py stdout]: Contact normal: (-0.00172305,0.999998,-0.000315579)

2022-12-09 09:43:04 [1,998,317ms] [Info] [] [py stdout]: Contact impulse: (-0,0,-0)

2022-12-09 09:43:04 [1,998,317ms] [Info] [] [py stdout]: Contact separation: 1.060901013261173e-05

2022-12-09 09:43:04 [1,998,317ms] [Info] [] [py stdout]: Contact faceIndex0: 0

2022-12-09 09:43:04 [1,998,317ms] [Info] [] [py stdout]: Contact faceIndex1: 0

2022-12-09 09:43:04 [1,998,317ms] [Info] [] [py stdout]: Contact material0: 

2022-12-09 09:43:04 [1,998,317ms] [Info] [] [py stdout]: Contact material1: 

2022-12-09 09:43:04 [1,998,317ms] [Info] [] [py stdout]: Contact:

2022-12-09 09:43:04 [1,998,317ms] [Error] [carb.physx.python] OSError: [Errno 22] Invalid argument

  c:/users/fablab/appdata/local/ov/pkg/code-2022.3.0/kit/kernel/py\omni\kit\app\_impl\ write
  c:\users\fablab\appdata\local\ov\pkg\code-2022.3.0\kit\extsphysics\omni.physx.demos-104.0.4-5.1\omni\physxdemos\scenes\ _on_physics_step

As you can see it’s pretty normal then suddenly it crashes and it does it until I re launch Code.

To give a bit more context of what’s happening:

It generally happens when I switch between scenes, mostly the Demo scene of the immediate report API, here I went to the said scene, to understand why objects aren’t reporting, to see what’s different, and then I go back to my main scene and suddenly, without doing much, it happens. In the video we see a rigid body with the collider being a convex hull, but it happens to with a boundary cube and others, and with more or less complex meshes.

Looking at the immediate report API, I think the problem is that the demo does no unsubscribe from the stepping event. It seems to be missing:

self._stepping_sub = None 

In the on_shutdown. I will fix this and make the fix available in next releases.

1 Like

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