Photosensor v2
The photosensor node represents an electronic component that detects the presence of visible, infrared transmission (IR), and ultraviolet (UV) light. The node takes measurements from the simulation similar to a laser paired with a photosensor.
Input Parameters
SamplingRequest
The sampling request is a list of laser beam orientations, along with specific timings for each beam. See SamplingRequest for the complete list of variables.
Relative depth error
The relative depth error input is a curve that provides the relative error as a function of distance. The lidar range [minRange, maxRange] is normalized on the X axis between [0, 1]. This curve is uniformly sampled, by the photosensor, and sent to the shader as a 1D texture of 2048 samples.
To compute the error, the shader samples the relative depth error texture mentioned above based on the distance. SensorSDK takes a normally distributed random number and scales it according to the relative error and applies the error on the measured distance.
Min range
The minimum range of measurement. The measurement will start at this distance from the photosensor object in the scene. Every sample under the min range will have a position and intensity of 0, indicating an invalid point.
Max range
The maximum range of measurement. This act as a maximum range clamp over the sensitivity threshold one. Every sample outside the max range will have a position and intensity of 0, indicating an invalid point.
Sensitivity
Minimum radiant energy threshold (watts/m^2). Every sample under the threshold will have a position and intensity of 0, indicating an invalid point. The default value for this parameter is 0, which indicates there is no minimum sensitivity.
Output parameters
RawData
The node outputs a compute buffer with the following structure:
- Vector3 sphericalCoordinates
- float intensity
- uint cellIndex
- uint objectID (used with the Perception package for Lidar segmentation).
OutTranscode
This structure contains a command buffer used to execute the sampling. This is required to apply any GPU processing pipelined right after the sampling. This can be seen also as a latch signal for the next node to add its processing to the GPU command buffer.
Bindings
Sensing
The sensing binding defines what sampler to use for the simulation. It allows the user to specify a sampler, or create their own.
You must bind to the Sensing binding a sensing component on the GameObject that represents the photosensor. The sensing component uses the transform property of that GameObject as the beam origin. For mechanical lidars, you must also bind this GameObject or one of its parent objects to the DC Motor node to make it turn.
The available sensing components are Camera Sensing Component and Pathtraced Sensing Component.
Reference frame
This is the Transform used to return points acquired by the photosensor.
You must bind to the Reference frame the transform of a GameObject that's a non-moving part of the lidar, as all points sensed by the lidar are ultimately expressed in that space. One easy solution is to use the top-level GameObject representing the lidar.
Light beam parameters
If you bind a Pathtraced Sensing Component of the photosensor GameObject to the Sensing binding, you can specify light beam parameters in the Inspector window, including:
- Wavelength: The wavelength emitted by the laser and perceived by the photosensor, in nanometers.
- Power: The laser beam power, in watts.
- Divergence: The laser beam divergence angle, in degrees. It is the angle of the cone shape made by laser beam.
- Beam Width: The width of the laser beam leaving the sensor, in milimeters.
Best practices
- The sampling rate (number of samples per second) must be a multiple of (rotations per second * number of lasers). This ensures an integer number of points per laser, per turn, with the first point always having the same orientation (no drifting). This will usually be true if using specifications from a real lidar.
- If a point cloud viewer node is used, its Transform binding is usually set to the same GameObject as the photosensor's Reference frame.