In Chrono:Sensor:ChCameraSensor, the synthetic data is generated via GPU-based ray-tracing. By leveraging hardware accelerated support and the headless rendering capabilities provided by Nvidia Optix Library.
Camera sensor Setup
See ChCameraSensor for more details.
The camera setup process will automatically add the Optix Render Filter to the filter list
If the camera supersample_factor is greater than 1, the setup process will adjust the resolution and append the Image Alias Filter to the filter list.
Rendering steps
The Camera sensor in Chrono::sensor uses Optix as the render engine. For each pixel, the engine will shoot out a ray at that direction and find the first object intersects with the ray. By default, the engine uses the physically based BRDF shader for rendering objects. It will spawn additional rays for shadows, reflection, and refraction in a recursive fashion.
The camera update frequency is much slower than the physics. Therefore the ChOptixEngine spawns a thread to perform the rendering, and it will not block the main thread
Each Update (main thread)
- Check if there is any camera need to be updated. If there is such camera
- Update the scene information
- Push it into render queue
- Check if any camera should have the data ready to ship, or wait until they finish.
- Continue to the next time step
Rendering thread
- Wait until there is a camera in the render queue
- Update those camera, clear the render queue, go back to step 1
Filter Graphs
Any number of filters can be append to the list and modify the final result. The filters are executed as the order in filter list. Here are some examples.
Camera animation
The position and rotation of the camera can be easily changed using SetOffsetPose
during simulation
Data access
Data will be ready after the lag time. To access