I’m trying to add and remove boxes dynamically from Isaac Sim. I’m using the following command to add the box:
prim = FixedCuboid(
prim_path=prim_path,
color=color,
scale=np.array([1.0, 1.0, 1.0]),
size=1.0,
position=position,
orientation=quaternion
)
and this one to remove it:
prim = get_prim_at_path(prim_path)
if prim.IsValid():
delete_prim(prim_path)
else:
print(f"Prim at {prim_path} does not exist or is not valid.")
While it does work, the scene keeps creating new visual elements for every cube and it doesn’t remove them, quickly filling the scenario with them. How can I solve this?