C: Radar Sensor#
This example loads radar_example.usda, renders a radar PointCloud
output, maps the composite render variable to CPU memory, and reads the named
tensor channels. The moving target approaches the radar, so its
RadialVelocityMs values are expected to be negative.
The scene is Z-up and contains a radar at (0, 0, 1) rotated to look along
world +X, an asphalt ground plane, a moving steel cube, and a fixed concrete
cube. The USD requests Coordinates, Counts, RCS, and
RadialVelocityMs channels.
The executable applies the runtime setting
--/renderer/raytracingMotion/enabled=true because MotionBVH is required for
moving-object radial velocity.
“Create a C/C++ radar sensor example that applies required runtime settings before renderer creation, loads an animated radar scene, advances scene time across several simulation steps, reads valid detection data including signal strength and signed radial velocity, prints per-step summaries, reports moving-target observations, and cleans up all resources.”
Build and Run#
Prerequisites
sudo apt install build-essential cmake
Building
cd examples/c/sensors/radar
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
Running
./build/radar-composite-tensor
You can also pass an explicit scene path:
./build/radar-composite-tensor path/to/radar_example.usda
Prerequisites
Building
cd examples/c/sensors/radar
cmake -S . -B build
cmake --build build --config Release
Running
.\build\Release\radar-composite-tensor.exe
Expected output values vary, but a successful run prints 10 steps and a final observation line summarizing detections with nonzero radial velocity.