Issue with omni.isaac.core.World class : Unable to add physics callback

Hello.
I’m trying to monitor the kinetic energy (or velocity) of a set of rigid bodies on a stage. For that , i’m planning to use the omni.isaac.core.World class since it provides a way to add a callback to handle time events and/or physics events (see here.
But no matter how i try to add a callback function to the object, it does not seem to work.
Steps to reproduce :

  1. Load a world of your choice (wooden_world for me)
  2. Execute this script in your script editor :

import omni.usd
import carb
import omni.isaac.core
import os
stage = omni.usd.get_context().get_stage()
def ticker(n : float) : #Some dummy function here
print("Ticked once with argument : ",n)
carb.log_warn(“Ticked once with argument : {}”.format(n))
return
world = omni.isaac.core.World(set_defaults=True)
world.add_physics_callback(“TickerFunction”,ticker)

Result (for me at least)
[Error] [omni.kit.app.plugin] [py stderr]: AttributeError: ‘World’ object has no attribute ‘_physics_context’

I figured out that the PhysicsContext object that was suppose to be a private attribute of the SimulationContext class that the World class inherited from. So i tried to create my own physics scene. And the result was this after trying to add the callback once again :
Exception: Failed to create simulation view backend

After a peek in the omni.isaac.core physics_context , into the init function of the PhysicsContext class
i see this :# TODO: add backend for physics (I guess this explains that)

So does anyone have a fix , or workaround for this?
Keep in mind that my goal here is to be able to make step by step simulation with python in order to compute some things between two simulation steps.
Thank you.

Hi @a.adjanohoun. I’ve moved this over to the Isaac Sim forum for you.

1 Like

Hi @a.adjanohoun - Someone from our team will review and provide answer to you.

1 Like

Hi @a.adjanohoun - Apologies for the delay in response. Please let us know if you are still having any issues or questions after using the latest Isaac Sim release.