Isaac Sim Version
4.5.0
Hi.
I’d like to spawn particles in the region around the robot (eg, a sphere with r =1 with robot at centre),
as robot moves, generated particles falls outside of the sphereical region will be deleted automatically.
How should I achieve this effect? Warp? omni.particle.system.core (is this still available in 4.5?) PhysX?
Thanks in advance.
Hi @HaoyuMa you can just generating particles during simulation runtime. I tried this quickly and this is what I got:
Script here:
# Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
from isaacsim import SimulationApp
# Create simulation app (not headless so we can see the particles)
simulation_app = SimulationApp({"headless": False})
from isaacsim.core.api import World
from isaacsim.core.api.objects import DynamicSphere
import numpy as np
import random
import time
# Create world with CPU backend
my_world = World(stage_units_in_meters=1.0)
print("Using CPU backend")
# Add default ground plane
my_world.scene.add_default_ground_plane()
# Define spawn region
spawn_region = {
"x_min": -1.0, "x_max": 1.0,
"y_min": -1.0, "y_max": 1.0,
"z_min": 0.5, "z_max": 2.0
}
# Particle parameters
particle_radius = 0.05
spawn_interval = 2.0 # Time between spawning new particles
particles_per_spawn = 20
# List to keep track of all spawned particles
particles = []
# Reset world to initialize scene
my_world.reset()
# Main simulation loop
start_time = time.time()
last_spawn_time = start_time
print("Simulation started. New particles will be spawned every 2 seconds.")
print("Press Ctrl+C to exit.")
while simulation_app.is_running():
current_time = time.time()
elapsed_time = current_time - start_time
# Spawn new particles every spawn_interval seconds
if current_time - last_spawn_time >= spawn_interval:
for _ in range(particles_per_spawn):
# Generate random position
x = random.uniform(spawn_region["x_min"], spawn_region["x_max"])
y = random.uniform(spawn_region["y_min"], spawn_region["y_max"])
z = spawn_region["z_max"] # Spawn at the top of the region
# Generate random color
color = np.array([random.random(), random.random(), random.random()])
# Create a unique name for the particle
particle_name = f"particle_{len(particles)}"
# Create the dynamic sphere
particle = my_world.scene.add(
DynamicSphere(
name=particle_name,
position=np.array([x, y, z]),
prim_path=f"/World/{particle_name}",
radius=particle_radius,
color=color,
mass=1.0
)
)
# Add to our list of particles
particles.append(particle)
print(f"Time: {elapsed_time:.1f}s - Spawned {particles_per_spawn} new particles. Total: {len(particles)}")
last_spawn_time = current_time
my_world.step(render=True)
# Cleanup
simulation_app.close()
Thank you so much for getting back to me!
I am seeing that those are actually DyanmicSphere object instead of a particle system.
I want to generate many of small particles floating in the air around my robot, like 10000 number of them.
Is this the right approach for doing that?
Thanks
Sorry for the late reply @HaoyuMa, you can also use a PointInstancer to do the same thing, but I think instantiating individual prims should work just fine.
Hello!
We noticed that this topic hasn’t received any recent responses, so we are closing it for now to help keep the forum organized.
If you’re still experiencing this issue or have additional questions, please feel free to create a new topic with updated details. When doing so, we recommend mentioning or linking to this original topic in your new post—this helps provide context and makes it easier for others to assist you.
Thank you for being part of the NVIDIA Isaac Sim community.
Best regards,
The NVIDIA Isaac Sim Forum Team