Description
Base class for all filters that can be applied to a sensor after initial rendering.
Any filters that will be added to a sensor must inherit from here.
#include <ChFilter.h>

Public Member Functions | |
| virtual | ~ChFilter () |
| Virtual class destructor. | |
| virtual void | Apply ()=0 |
| Virtual apply function. More... | |
| virtual void | Initialize (std::shared_ptr< ChSensor > pSensor, std::shared_ptr< SensorBuffer > &bufferInOut)=0 |
| Virtual initialize function. More... | |
| std::string & | Name () |
| Accesses the name of the filter. More... | |
Protected Member Functions | |
| ChFilter (std::string name) | |
| protected constructor for the filter which requires a name as input. More... | |
| unsigned int | GetRngStreamIndex () const |
| This filter's RNG stream index within its sensor, for filters that own a cuRAND buffer. More... | |
| void | InvalidFilterGraphNullBuffer (std::shared_ptr< ChSensor > pSensor) |
| Error function for invalid filter graph: null buffer found. | |
| void | InvalidFilterGraphBufferTypeMismatch (std::shared_ptr< ChSensor > pSensor) |
| Error function for invalid filter graph: type mismatch in graph. | |
| void | InvalidFilterGraphSensorTypeMismatch (std::shared_ptr< ChSensor > pSensor) |
| Error function for invalid filter graph: type mismatch in graph. | |
Friends | |
| class | ChSensor |
| assigns m_rng_stream_index in PushFilter / PushFilterFront | |
Constructor & Destructor Documentation
◆ ChFilter()
|
inlineprotected |
protected constructor for the filter which requires a name as input.
- Parameters
-
name A string name of the filter.
Member Function Documentation
◆ Apply()
|
pure virtual |
Virtual apply function.
This will be called sequentially for all filters in a filter list. This should contain the necessary processing during the simulation. This must be threadsafe when applied to a ChOptixSensor.
Implemented in chrono::sensor::ChFilterAccess< BufferType, UserBufferType >, chrono::sensor::ChFilterAccess< BufferType, UserBufferType >, chrono::sensor::ChFilterAccess< BufferType, UserBufferType >, chrono::sensor::ChFilterAccess< BufferType, UserBufferType >, chrono::sensor::ChFilterAccess< BufferType, UserBufferType >, chrono::sensor::ChFilterImgAlias, chrono::sensor::ChFilterImageResize, chrono::sensor::ChFilterNormalToRGBA8, chrono::sensor::ChFilterDepthToRGBA8, chrono::sensor::ChFilterImageHalf4ToRGBA16, chrono::sensor::ChFilterMagnetometerUpdate, chrono::sensor::ChFilterCameraNoisePixDep, chrono::sensor::ChFilterRGBDHalf4ToR8, chrono::sensor::ChFilterOptixRender, chrono::sensor::ChFilterGyroscopeUpdate, chrono::sensor::ChFilterRGBDHalf4ToImageHalf4, chrono::sensor::ChFilterPhysCameraNoise, chrono::sensor::ChFilterAccess< BufferType, UserBufferType >, chrono::sensor::ChFilterVisualize, chrono::sensor::ChFilterLidarNoiseXYZI, chrono::sensor::ChFilterCameraNoiseConstNormal, chrono::sensor::ChFilterPhysCameraExpsrToDV, chrono::sensor::ChFilterPhysCameraAggregator, chrono::sensor::ChFilterAccelerometerUpdate, chrono::sensor::ChFilterPhysCameraDefocusBlur, chrono::sensor::ChFilterGPSUpdate, chrono::sensor::ChFilterRadarSavePC, chrono::sensor::ChFilterSave, chrono::sensor::ChFilterSavePtCloud, chrono::sensor::ChFilterVisualizePointCloud, chrono::sensor::ChFilterCameraExposureCorrect, chrono::sensor::ChFilterPhysCameraVignetting, chrono::sensor::ChFilterRadarProcess, chrono::sensor::ChFilterGrayscale, chrono::sensor::ChFilterImageHalf4ToRGBA8, and chrono::sensor::ChFilterPCfromDepth.
◆ GetRngStreamIndex()
|
inlineprotected |
This filter's RNG stream index within its sensor, for filters that own a cuRAND buffer.
Needed because (sensor, purpose) is NOT a unique stream key: PushFilter applies no type or duplicate check, so two filters of the same kind can sit on one sensor, each with its own RNG buffer, and both would answer to the same (sensor, purpose) pair. This index separates them. It is an attach-order counter, not a list position, because ChOptixEngine prepends its render filter with PushFilterFront after the user's filters are already in place, which would renumber a positional index.
- Returns
- The index assigned when this filter was attached, or CH_SENSOR_UNASSIGNED_RNG_ID if it never was.
◆ Initialize()
|
pure virtual |
Virtual initialize function.
This will be called once when added to the ChSensorManager. It should create all the necessary memory space and setup any data that will be needed in the apply function. This function does not need to be threadsafe so can be used to access and store any sensor specific information that is needed later.
- Parameters
-
pSensor A pointer to the sensor to which it is attached bufferInOut The pointer that is passed from one filter to the next. Can be changed by the filter when augmentation does not happen in place.
Implemented in chrono::sensor::ChFilterImgAlias, chrono::sensor::ChFilterImageResize, chrono::sensor::ChFilterNormalToRGBA8, chrono::sensor::ChFilterDepthToRGBA8, chrono::sensor::ChFilterImageHalf4ToRGBA16, chrono::sensor::ChFilterMagnetometerUpdate, chrono::sensor::ChFilterCameraNoisePixDep, chrono::sensor::ChFilterRGBDHalf4ToR8, chrono::sensor::ChFilterOptixRender, chrono::sensor::ChFilterPhysCameraNoise, chrono::sensor::ChFilterGyroscopeUpdate, chrono::sensor::ChFilterPhysCameraExpsrToDV, chrono::sensor::ChFilterPhysCameraAggregator, chrono::sensor::ChFilterRGBDHalf4ToImageHalf4, chrono::sensor::ChFilterPhysCameraDefocusBlur, chrono::sensor::ChFilterAccess< BufferType, UserBufferType >, chrono::sensor::ChFilterVisualize, chrono::sensor::ChFilterLidarNoiseXYZI, chrono::sensor::ChFilterCameraNoiseConstNormal, chrono::sensor::ChFilterPhysCameraVignetting, chrono::sensor::ChFilterAccelerometerUpdate, chrono::sensor::ChFilterCameraExposureCorrect, chrono::sensor::ChFilterGPSUpdate, chrono::sensor::ChFilterRadarSavePC, chrono::sensor::ChFilterSave, chrono::sensor::ChFilterSavePtCloud, chrono::sensor::ChFilterVisualizePointCloud, chrono::sensor::ChFilterRadarProcess, chrono::sensor::ChFilterGrayscale, chrono::sensor::ChFilterImageHalf4ToRGBA8, and chrono::sensor::ChFilterPCfromDepth.
◆ Name()
|
inline |
Accesses the name of the filter.
Name not used for any critical processes. Optional use for clarity. A string reference to the filter's name.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_sensor/filters/ChFilter.h
- /builds/uwsbel/chrono/src/chrono_sensor/filters/ChFilter.cpp