The following code is mean to simply load a particle sampled cube. The cube is suspended in air and as such one would expect the particles to fall nicely on the ground. That does not happen and they just remain suspended without moving. This works in isaac 2022.2.0 but not in 2023.1.0 or 2023.1.1.
from omni.isaac.kit import SimulationApp
CONFIG = {"renderer": "RayTracedLighting", "headless": False}
simulation_app = SimulationApp(CONFIG)
from omni.isaac.core import SimulationContext, utils # noqa E402
from omni.isaac.core.utils.viewports import set_camera_view
simulation_context = SimulationContext(backend="torch", device="cuda:0", set_defaults=False)
# set_camera_view([2.5, 2.5, 2.5], [0.0, 0.0, 0.0])
# Configure the physics scene to use GPU dynamics for particles (fluids)
print(f"------------------------------------------------ Configure Physics Context ----------------------------------------------------")
physics_context = simulation_context.get_physics_context()
physics_context.enable_ccd(False)
physics_context.enable_gpu_dynamics(True)
print(physics_context.get_physx_update_transformations_settings())
physics_context.set_physx_update_transformations_settings(update_to_usd=True)
print(physics_context.get_physx_update_transformations_settings())
# Loading the cube with the particle sampler as a reference
utils.stage.add_reference_to_stage("particle_cube.usda", "/cube_reference")
# utils.prims.create_prim("/World/Table_1", usd_path="particle_cube.usda", translation=(0.55, -1.0, 0.0))
simulation_app.update()
simulation_context.initialize_physics()
simulation_context.play()
init_context = simulation_context.physics_sim_view
# print(init_context.get_physx_update_transformations_settings())
while simulation_app.is_running():
simulation_context.step(render=True)
simulation_context.stop()
simulation_app.close()
I’ve noticed that if I go to Window>Physics>Settings the update_to_usd is not enabled. Enabling the particles are instantly updated to the positions one would expect them to be after falling. The issue seems to be that even though update_to_usd was set in physics context it is not actually when the simulation starts.
particle_cube.usda (286.7 KB)