Ros2BridgeUsePhysicsStepSimTime set to True is not working

I’m using Isaac Sim 2021.2.1 local workstation installation, Ubuntu 20.04. I would like the ROS bridge to publish ROS topic using sim time measured with physics steps instead of rendering/app update.

Even with setting this
omni.kit.commands.execute("Ros2BridgeUseSimTime",use_sim_time=True), the /clock is not publishing when simulation_context.step(render=False).

It is only publishing the /clock topic when simulation_context.step(render=True).

I have tried with ROS1 and ROS2 bridge, both doesn’t seem to work. Does anyone face the similar issue and have any resolution? Many thanks

I found a problem with my previous attempt and found a working solution. Applies to both ROS1 and ROS2

Working. Creation must be before play, set RosBridgeUsePhysicsStepSimTime must be after play and a single step.

omni.kit.commands.execute("ROSBridgeCreateClock", path="/ROS_Clock", enabled=False)
simulation_context.play()
simulation_context.step()
omni.kit.commands.execute("RosBridgeUsePhysicsStepSimTime", use_physics_step_sim_time=True)
while kit.is_running():
    simulation_context.step(render=False)
    omni.kit.commands.execute("RosBridgeTickComponent", path="/ROS_Clock")

Not working method 1

omni.kit.commands.execute("ROSBridgeCreateClock", path="/ROS_Clock", enabled=False)
omni.kit.commands.execute("RosBridgeUsePhysicsStepSimTime", use_physics_step_sim_time=True)
simulation_context.play()
simulation_context.step()

Not working method 2

simulation_context.play()
simulation_context.step()
omni.kit.commands.execute("ROSBridgeCreateClock", path="/ROS_Clock", enabled=False)
omni.kit.commands.execute("RosBridgeUsePhysicsStepSimTime", use_physics_step_sim_time=True)

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