Isaac Sim Version
4.5.0
Operating System
Ubuntu 22.04
GPU Information
- Model: 4070
- Driver Version: 550
Topic Description
Detailed Description
the annotator RtxSensorCpuIsaacComputeRTXLidarPointCloud sometimes returns zero data when using rep.orchestrator.step instead of simulationcontext
rep.AnnotatorRegistry.get_annotator(“RtxSensorCpuIsaacComputeRTXLidarPointCloud”)
/home/liaojinyi/Project/robot/MobilityGen/app/standalone_examples/api/isaacsim.util.debug_draw/rtx_lidar_bak.py
Steps to Reproduce
- run standardalone api example standalone_examples/api/isaacsim.util.debug_draw/rtx_lidar.py
- using rep.orchestrator.step instead of simulationcontext
- zero point cloud data at some frames
# 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.
#
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", type=str, default="Example_Rotary", help="Name of lidar config.")
args, _ = parser.parse_known_args()
from isaacsim import SimulationApp
# Example for creating a RTX lidar sensor and publishing PCL data
simulation_app = SimulationApp({"headless": False})
import carb
import omni
import omni.kit.viewport.utility
import omni.replicator.core as rep
from isaacsim.core.api import SimulationContext
from isaacsim.core.utils import stage
from isaacsim.core.utils.extensions import enable_extension
from isaacsim.storage.native import get_assets_root_path
from pxr import Gf
# enable ROS bridge extension
enable_extension("isaacsim.util.debug_draw")
simulation_app.update()
# Locate Isaac Sim assets folder to load environment and robot stages
assets_root_path = get_assets_root_path()
if assets_root_path is None:
carb.log_error("Could not find Isaac Sim assets folder")
simulation_app.close()
sys.exit()
simulation_app.update()
# Loading the simple_room environment
stage.add_reference_to_stage(
assets_root_path + "/Isaac/Environments/Simple_Warehouse/warehouse_multiple_shelves.usd", "/background"
)
robot = stage.add_reference_to_stage(
assets_root_path + "/Isaac/Robots/Forklift/forklift_c.usd", "/robot"
)
simulation_app.update()
lidar_config = "Velodyne_VLS128"
# Create the lidar sensor that generates data into "RtxSensorCpu"
# Possible config options are Example_Rotary and Example_Solid_State
_, sensor = omni.kit.commands.execute(
"IsaacSensorCreateRtxLidar",
path="/sensor",
parent=None,
config=lidar_config,
)
hydra_texture = rep.create.render_product(sensor.GetPath(), [1, 1], name="Isaac")
# simulation_context = SimulationContext(physics_dt=1.0 / 60.0, rendering_dt=1.0 / 60.0, stage_units_in_meters=1.0)
simulation_app.update()
_lidar_annotator = rep.AnnotatorRegistry.get_annotator("RtxSensorCpuIsaacComputeRTXLidarPointCloud")
_lidar_annotator.initialize()
_lidar_annotator.attach([hydra_texture])
# Create the debug draw pipeline in the post process graph
writer = rep.writers.get("RtxLidar" + "DebugDrawPointCloud" + "Buffer")
writer.attach([hydra_texture])
simulation_app.update()
# simulation_context.play()
while simulation_app.is_running():
simulation_app.update()
rep.orchestrator.step(
rt_subframes=1,
delta_time=1.0/60.0,
pause_timeline=False
)
data = _lidar_annotator.get_data()
print(f"Data length: {len(data['data'])}")
# cleanup and shutdown
# simulation_context.stop()
simulation_app.close()
And when using delta_time = 0, I can not get data of annotators.
By the way. I am using MobilityGen(GitHub - NVlabs/MobilityGen: Data Generation Pipeline for Mobility) to generate synthesisi data from camera and lidar sensor