C: Lidar Sensor#
This example populates an ovstage instance from lidar_example.usda, attaches
it to the renderer, renders a lidar PointCloud output through
ovrtx_step_with_stage, maps the composite render variable to CPU memory, and
reads the named tensor channels. ovstage owns scene ingest and stepping; sensor
output fetch/map stays a renderer-side concern on the ovrtx APIs.
The scene is Z-up and contains a lidar at (0, 0, 1) rotated to look along
world +X, an asphalt ground plane, and a concrete cube. The USD requests
Coordinates, Intensity, Counts, and TimeOffsetNs channels.
The executable enables MotionBVH through ovrtx_config_t at renderer
creation because it is required by the lidar sensor pipeline.
“Create a C/C++ lidar sensor example that configures the renderer for sensor output, loads a lidar scene, warms up the sensor pipeline, renders one point-cloud output, reads valid point data safely through the count channel, prints summary statistics, and cleans up all results and mappings.”
Build and Run#
Prerequisites
sudo apt install build-essential cmake
Building
cd examples/c/lidar
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
Running
./build/lidar-composite-tensor
You can also pass an explicit scene path:
./build/lidar-composite-tensor path/to/lidar_example.usda
Prerequisites
Building
cd examples/c/lidar
cmake -S . -B build
cmake --build build --config Release
Running
.\build\Release\lidar-composite-tensor.exe
Expected output values vary, but a successful run prints the number of valid points, mean intensity, and maximum time offset in nanoseconds.