Hi All.
I’m using isaacsim 4.5 on ubuntu 22.04 and I want to get semantic data from RTX Lidar. Here is my code
from isaacsim import SimulationApp
simulation_app = SimulationApp({"headless": False})
import numpy as np
import omni.replicator.core as rep
from isaacsim.core.api import World
from isaacsim.core.api.objects import DynamicCuboid
from isaacsim.sensors.rtx import LidarRtx
import omni.syntheticdata._syntheticdata as _syntheticdata
my_world = World(stage_units_in_meters=1.0)
my_world.scene.add_default_ground_plane()
lidar = my_world.scene.add(LidarRtx(prim_path="/World/Lidar", name="Lidar", position=[2.0, 0.0, 1.5], valid_range = (0.1, 2000.0)))
annotator = rep.AnnotatorRegistry.get_annotator("RtxSensorCpuIsaacCreateRTXLidarScanBuffer", init_params={"outputObjectId": True})
annotator.attach([lidar._render_product_path])
cube_1 = my_world.scene.add(DynamicCuboid(prim_path="/World/cube", name="cube_1", position=np.array([2, 2, 2.5]), scale=np.array([20, 0.2, 5])))
cube_2 = my_world.scene.add(DynamicCuboid(prim_path="/World/cube_2", name="cube_2", position=np.array([2, -2, 2.5]), scale=np.array([20, 0.2, 5])))
my_world.reset()
while simulation_app.is_running():
simulation_app.update()
data = annotator.get_data()
objects = data["objectId"]
#about 200000 unique ids here, too many for this simple scene
print(len(set(objects)))
interface = _syntheticdata.acquire_syntheticdata_interface()
for object in objects:
path = interface.get_uri_from_instance_segmentation_id(int(object))
my_world.stop()
simulation_app.close()
After running this code I get a lot of warnings:
I’ve also found that there are too many unique ids in objects list and most of them are invalid. So do I miss any step to use RTXLidarScanBuffer or is it a bug of isaacsim 4.5?