Class PhotosensorV2
Requirement : This node uses DXR so an NVidia card GTX 1060 or above is required.
A Photosensor is an electronic component that detects the presence of visible light, nfrared transmission (IR), and/or ultraviolet (UV) energy. This node responsible to take measurement from the simulation as a laser paired with a photosensor would do. In the photosensor, there is an implicit laser firing a beam originating from the photosensor. If no beam light node is specified in the graph, the photosensor will consider the laser as if it was a white light and will take only the depth. No intensity will be measured. See beam light node for more information on how to define the laser light beam.
There is an heuristic inside this node implementation that assumes it will rotate on itself.The sampling shader interpolates the rotation of the photosensor to accommodate its usage in a lidar kind of sensor.
Inherited Members
Namespace: Mechatronics.SensorSDK
Assembly: solution.dll
Syntax
[NodeCategory("Sensor", "Photosensor v2", NodeTick.Asynchronous, LifeCycle.Update, 0, NodeMode.Standard, false)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.sensorsdk@2.1/manual/DeveloperGuide/PhotosensorNode.html")]
public class PhotosensorV2 : NodeRuntime
Constructors
Name | Description |
---|---|
PhotosensorV2() | Constructs the photosensor and initializes the relative error curve to be displayed on the node. |
Fields
Name | Description |
---|---|
maxRange | Define 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 distance of 0 meter. |
minRange | Define the minimum range of measurement. The measurement will start at this distance from the photosensor object in the scene. Everything before this range won't be perceived by the device. |
outTranscode | This is a 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 it’s processing to the gpu command buffer. |
outputData | A compute buffer structured this way : Vector3 sphericalCoordinates, float intensity, uint cellIndex. |
referenceToWorldTransform | Transform used to return points acquired by the photosensor. |
relativeDepthError | The relative depth error input is a curve that provides the relative error over the distance. The lidar range [minDistance, maxDistance] 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, in the shader, we sample the relative depth error textured mentioned above based on the distance. We take a normally distributed random number and we scale it according to the relative error. Then we apply the error on the measured distance. |
samplingRequest | The input structure will be stored into the node until the next simulation rendering where the node will execute the sampling on the simulation. |
sensingComponent | Defines what sampler to use for the simulation. It allows the user to specify a sampler, or create their own. |
sensitivity | Minimum radiant energy threshold (watts/m^2). Under this threshold, the sampling fails. Which means the return position and intensity will be 0.0. The default value for this parameter is 0, which means it always succeeds if bounced back to the photosensor. |
Methods
Name | Description |
---|---|
Disable() | Unregister the photosensor to the main camera to sample the scene and release graphic resources and clear sampling requests. |
Enable(ClockState) | Register the photosensor to the main camera to sample the scene, initialize random buffer for the depth measurement error, setup sensor and sampling request list. |
OnSamplingRequested() | Callback when a controller send a new sampling request. |
Update() | Update sensor parameters, resize and/or update buffers required for executing the sampling on GPU. Note: No emulation code should be done here. |