Add support for post processing filters - #11566
Conversation
| if( filter_name.compare( "Depth Huffman Decoder" ) == 0 ) | ||
| current_filters.add_processing_block( std::make_shared< depth_decompression_huffman >() ); | ||
| else if( filter_name.compare( "Decimation Filter" ) == 0 ) | ||
| //TODO - set options? might be needed according to stream type |
There was a problem hiding this comment.
Currently this does not support setting internal options?
There was a problem hiding this comment.
Changed the comment - sensor.cpp sets format option based on sensor type, but the filter does not use it and selects the appropriate decimation algorithm based on processed frame profile format. No need to set the options
| }; | ||
|
|
||
| // For cases when checking if this is< color_sensor > (like realsense-viewer::subdevice_model) | ||
| class dds_color_sensor_proxy : public dds_sensor_proxy, public color_sensor |
There was a problem hiding this comment.
Check is we can add also depth_sensor
Can be on the todo list
| else if( state_type::WAIT_FOR_DEVICE_OPTIONS == state && id == "device-options" ) | ||
| { | ||
| LOG_DEBUG( "... device-options: " << j["n-options"] << " options received" ); | ||
| LOG_DEBUG( "... device-options: " << j["options"].size() << " options received" ); |
| filter_names.push_back( filter ); | ||
| } | ||
|
|
||
| stream_it->second->set_recommended_filters( filter_names ); |
| } | ||
| } | ||
| server->init_options( options ); | ||
| server->set_recommended_filters( filter_names ); |
| throw std::runtime_error( "Could not find a stream that supports option " + name ); | ||
| } | ||
|
|
||
| void add_processing_block( std::string filter_name ) |
There was a problem hiding this comment.
This file starts to be really long. If I read it correctly, most of it is dds_sensor_proxy class - please consider to add new h and cpp files for it.
There was a problem hiding this comment.
Already mentioned in a previous PR (about metadata support) that we intend to split the DDS to a different file, but because the changes we made broke the LibCI we address it first. After changes will be merged we will create a new PR to split this file.
| create_processing_block( filter_name ); | ||
| } | ||
|
|
||
| bool processing_block_exists( processing_blocks const & blocks, std::string const & block_name ) |
There was a problem hiding this comment.
Should this method be const?
| { | ||
| auto & current_filters = get_software_recommended_proccesing_blocks(); | ||
|
|
||
| if( filter_name.compare( "Depth Huffman Decoder" ) == 0 ) |
There was a problem hiding this comment.
Consider removing the "==0" and adding"!" instead. e.g:
if( !filter_name.compare( "Depth Huffman Decoder" ) )
There was a problem hiding this comment.
I think that using ! is less readable, because compare returns 0 when it is true. !compare reads like it does not compare.
| }; | ||
|
|
||
| // For cases when checking if this is< color_sensor > (like realsense-viewer::subdevice_model) | ||
| class dds_color_sensor_proxy : public dds_sensor_proxy, public color_sensor |
There was a problem hiding this comment.
Consider exporting this class to separate h, cpp files
There was a problem hiding this comment.
Will be moved in a future PR. See previous comments
| { | ||
| // This is a new sensor we haven't seen yet | ||
| sensor_info.proxy = std::make_shared< dds_sensor_proxy >( stream->sensor_name(), this, _dds_dev ); | ||
| if( stream->sensor_name().compare( "RGB Camera" ) == 0 ) |
There was a problem hiding this comment.
Isn't it some member in the realdds::dds_stream class that can return the stream type (as RS2_STREAM_COLOR)?
There was a problem hiding this comment.
No.
And we can't go over all the profiles and test if there is RGB8 one, because D405 has RGB8 but not a color_sensor.
Comparing sensor name to "RGB Camera" is also the way it was done in ROS wrapper.
remibettan
left a comment
There was a problem hiding this comment.
few comments - great work!
|
@remibetta pending your approval |
Enabling post processing filters for DDS devices.
Using filters name to create appropriate filters at the client side.