Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R/256 -> align to development 20/11/2024 #13527

Merged
merged 59 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
216a027
Remove excess foreach_uvc_device in v4l_uvc_device constructor
aaron-evercoast Oct 16, 2024
1708e79
remove libusb leftovers
Nir-Az Oct 31, 2024
42b7c35
PR #13479 from Nir-Az: Remove libusb leftovers
Nir-Az Oct 31, 2024
576e4e4
bump version to 2.57.0.0
Nir-Az Oct 31, 2024
8bcbeb3
PR #13480 from Nir-Az: Bump development version to 2.57.0.0
Nir-Az Oct 31, 2024
bac49ef
update get_gvd
AviaAv Nov 3, 2024
6cd93e8
PR #13488 from AviaAv: D500 GVD updates
Nir-Az Nov 3, 2024
6344108
Fix DDS stream tagging
OhadMeir Nov 3, 2024
bca6605
PR #13489 from OhadMeir: Fix DDS stream tagging
Nir-Az Nov 3, 2024
fb6299e
add get_opcode_string to sdk
AviaAv Nov 5, 2024
026f44b
python script to create html from lrs_options
AviaAv Oct 22, 2024
defc911
use get_opcode_string to show error string
AviaAv Nov 7, 2024
180a91b
renaming
AviaAv Nov 11, 2024
960edef
PR #13498 from AviaAv: Adding string to opcode mismatch error
Nir-Az Nov 11, 2024
1b2ef8a
move script, add GHA check and exception throw
AviaAv Nov 11, 2024
76a4d8e
update comment
AviaAv Nov 11, 2024
eba3fd8
get version number as a param
AviaAv Nov 11, 2024
31f3252
PR #13502 from AviaAv: python script to create html from lrs_options
Nir-Az Nov 12, 2024
ea836e6
remove response size limitation
AviaAv Nov 12, 2024
87d431a
remove log print for cmds with empty response
AviaAv Nov 12, 2024
40a90a8
support empty flash enumeration
Nir-Az Nov 13, 2024
ed7afed
rotate frames
noacoohen Nov 7, 2024
b9bf02d
convert _value to float
noacoohen Nov 7, 2024
0f673a3
add case rotation_filter
noacoohen Nov 7, 2024
e025cb7
fix PR review comments
noacoohen Nov 10, 2024
195c58b
fix PR comments
noacoohen Nov 11, 2024
5098156
fix rotation only for depth frames
noacoohen Nov 11, 2024
d08520f
override should process to filter frames for rotate filter
noacoohen Nov 13, 2024
2b3c978
add rotation filter to rs-post-processing example and remove override…
noacoohen Nov 13, 2024
524f519
commets improvements
Nir-Az Nov 13, 2024
c25e183
add depth table related sensor to the comments
Nir-Az Nov 14, 2024
c0dc22e
add unit test
noacoohen Nov 14, 2024
2fea862
PR #13512 from Nir-Az: Table read error fallback
Nir-Az Nov 14, 2024
52de0e3
add rotation filter to python
noacoohen Nov 14, 2024
855774e
fix coverity issues
Nir-Az Nov 17, 2024
e1cf8e5
PR #13518 from Nir-Az: Fix Coverity issues from PR #13512
OhadMeir Nov 17, 2024
7ac1dfa
rs-enumerate-devices returns failure if no device found (detect no de…
OhadMeir Nov 17, 2024
fec7a5d
SDK should not throw if DDS devices are not ready in time
OhadMeir Nov 17, 2024
9da74c7
Identify D555 by name, not pid
OhadMeir Nov 7, 2024
85d26a6
add step to struct filter_slider_ui in rs-post-processing example
noacoohen Nov 17, 2024
59c8039
fix PR comments
noacoohen Nov 17, 2024
8b36e44
return success message for some commands
AviaAv Nov 17, 2024
58db2aa
replace syncder with frame_queue
noacoohen Nov 17, 2024
455f76f
PR #13510 from AviaAv: remove response size limitation, and remove lo…
Nir-Az Nov 18, 2024
a6d4972
PR #13499 from noacoohen: Add new post processing filter - rotation …
Nir-Az Nov 18, 2024
8503b56
PR #13431 from aaron-evercoast: Improve query_devices time on high de…
remibettan Nov 18, 2024
3074e3c
PRt #13520 from OhadMeir/development
OhadMeir Nov 19, 2024
a5ab5ec
adding read and write data to bagfile
Nov 17, 2024
ddd994b
enabling record and playback
remibettan Nov 18, 2024
36336ff
semantic change
remibettan Nov 18, 2024
82b51b1
bug correction
remibettan Nov 19, 2024
f8f2b49
PR #13519 from remibettan: D555 IMU record and playback
OhadMeir Nov 19, 2024
c424a87
fix coverity issue
noacoohen Nov 19, 2024
da07459
fix PR comments
noacoohen Nov 19, 2024
6354e60
fix PR comments
noacoohen Nov 19, 2024
6174446
add comment
noacoohen Nov 19, 2024
9e51a1a
fix PR comments
noacoohen Nov 19, 2024
684cebc
PR request #13526 from noacoohen: Fix Coverity issue
Nir-Az Nov 19, 2024
e87b853
Merge remote-tracking branch 'origin/development' into r/256
Nir-Az Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,15 @@ jobs:
echo "Error - The minimal CMake version required for LibRS is ${EXPECTED_CMAKE_MAJOR_VER}.${EXPECTED_CMAKE_MINOR_VER} but on this build the minimal CMake version that works is $CURRENT_CMAKE_MAJOR_VER.$CURRENT_CMAKE_MINOR_VER"
exit 1
fi

build_flags_docs:
name: "Generate build-flags.html"
timeout-minutes: 10
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3

- name: Build docs
run: |
python3 scripts/lrs_options-to-html.py
6 changes: 6 additions & 0 deletions CMake/lrs_options.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## This file is also being used to generate our build flags document at https://intelrealsense.github.io/librealsense/build-flags-docs/build-flags.html
## Formatting notes for this file:
## Options are listed as: <name> | <description> [comment] | <value>
## regular comments should be ABOVE their relevent option
## use double # for comments that should not show in the options doc

option(ENABLE_CCACHE "Build with ccache." ON)
option(BUILD_WITH_CUDA "Enable CUDA" OFF)
option(BUILD_GLSL_EXTENSIONS "Build GLSL extensions API" ON)
Expand Down
3 changes: 2 additions & 1 deletion common/d500-on-chip-calib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ namespace rs2
auto depth_sensor = _sub->s->as <rs2::depth_sensor>();

// disabling the depth visual preset change for D555 - not needed
if (get_device_pid() != "0B56" && get_device_pid() != "DDS")
std::string dev_name = _dev.supports( RS2_CAMERA_INFO_NAME ) ? _dev.get_info( RS2_CAMERA_INFO_NAME ) : "";
if( dev_name.find( "D555" ) == std::string::npos )
{
// set depth preset as default preset
set_option_if_needed<rs2::depth_sensor>(depth_sensor, RS2_OPTION_VISUAL_PRESET, 1);
Expand Down
6 changes: 3 additions & 3 deletions common/device-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3351,10 +3351,10 @@ namespace rs2
{
bool is_d555 = false;

if( dev.supports( RS2_CAMERA_INFO_PRODUCT_ID ) )
if( dev.supports( RS2_CAMERA_INFO_NAME ) )
{
auto pid_str = std::string( dev.get_info( RS2_CAMERA_INFO_PRODUCT_ID ) );
if( pid_str == "0B56" || pid_str == "DDS" )
auto dev_name = std::string( dev.get_info( RS2_CAMERA_INFO_NAME ) );
if( dev_name.find( "D555" ) != std::string::npos )
is_d555 = true;
}

Expand Down
12 changes: 10 additions & 2 deletions common/output-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ void output_model::add_log(rs2_log_severity severity, std::string filename, int

void output_model::run_command(std::string command, device_models_list & device_models)
{
std::string opcode_error_as_string = "";
try
{
if (to_lower(command) == "clear")
Expand Down Expand Up @@ -990,7 +991,11 @@ void output_model::run_command(std::string command, device_models_list & device_
{
found = true;
auto res = dbg.send_and_receive_raw_data(buffer);

if (res.data())
{
int8_t opcode = *res.data();
opcode_error_as_string = dbg.get_opcode_string(opcode);
}
std::string response = rsutils::string::from() << "\n" << terminal_parser.parse_response(to_lower(command), res);
add_log(RS2_LOG_SEVERITY_INFO, __FILE__, 0, response);
}
Expand All @@ -1006,7 +1011,10 @@ void output_model::run_command(std::string command, device_models_list & device_
}
catch(const std::exception& ex)
{
add_log( RS2_LOG_SEVERITY_ERROR, __FILE__, __LINE__, ex.what() );
std::string error_string = rsutils::string::from() << ex.what();
if (opcode_error_as_string != "")
error_string = rsutils::string::from() << error_string << " (" << opcode_error_as_string << ")";
add_log( RS2_LOG_SEVERITY_ERROR, __FILE__, __LINE__, error_string);
}
}

Expand Down
5 changes: 3 additions & 2 deletions common/subdevice-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ namespace rs2
}
catch (...) {}

auto filters = s->get_recommended_filters();

for (auto&& f : s->get_recommended_filters())
{
auto shared_filter = std::make_shared<filter>(f);
Expand All @@ -215,6 +213,9 @@ namespace rs2
model->enable(false);
}

if( shared_filter->is< rotation_filter >() )
model->enable( false );

if (shared_filter->is<threshold_filter>())
{
if (s->supports(RS2_CAMERA_INFO_PRODUCT_ID))
Expand Down
91 changes: 91 additions & 0 deletions doc/build-flags.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/* This file is used in lrs_options-to-html, creating the html build-flags.html file we use to keep
the flags updated */
body {
font-family: 'Roboto', Arial, sans-serif;
background-color: #f5f5f5;
margin: 0;
padding: 0;
}

.container {
width: 80%;
margin: 0 auto;
padding: 30px;
}

h1 {
text-align: center;
margin-bottom: 20px;
}

h2 {
text-align: center;
margin-bottom: 30px;
}

table {
width: 100%;
border-collapse: collapse;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
border-radius: 8px;
overflow: visible;
}

th, td {
padding: 16px;
text-align: left;
border: 1px solid #ddd;
}

th {
background-color: #5873e0;
color: white;
}

tr:hover {
background-color: #f0f0f0;
}

code {
padding: 2px 4px;
border-radius: 4px;
font-family: 'Roboto Mono', monospace;
}
/* --- Tooltip --- */
.tooltip {
position: relative;
display: block;
}

.tooltip .tooltip-text {
visibility: hidden;
/*width: 120px;*/
background-color: #555;
color: #fff;
text-align: center;
padding: 5%;
border-radius: 6px;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
}

.tooltip .tooltip-text::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
visibility: visible;
opacity: 1;
}
Binary file added doc/build-flags.ico
Binary file not shown.
35 changes: 26 additions & 9 deletions examples/post-processing/rs-post-processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct filter_slider_ui
std::string description;
bool is_int;
float value;
float step;
rs2::option_range range;

bool render(const float3& location, bool enabled);
Expand Down Expand Up @@ -71,6 +72,7 @@ int main(int argc, char * argv[]) try

// Declare filters
rs2::decimation_filter dec_filter; // Decimation - reduces depth frame density
rs2::rotation_filter rot_filter; // Rotation - rotates frames
rs2::threshold_filter thr_filter; // Threshold - removes values outside recommended range
rs2::spatial_filter spat_filter; // Spatial - edge-preserving spatial smoothing
rs2::temporal_filter temp_filter; // Temporal - reduces temporal noise
Expand All @@ -85,6 +87,7 @@ int main(int argc, char * argv[]) try

// The following order of emplacement will dictate the orders in which filters are applied
filters.emplace_back("Decimate", dec_filter);
filters.emplace_back("Rotate", rot_filter);
filters.emplace_back("Threshold", thr_filter);
filters.emplace_back(disparity_filter_name, depth_to_disparity);
filters.emplace_back("Spatial", spat_filter);
Expand Down Expand Up @@ -115,11 +118,12 @@ int main(int argc, char * argv[]) try
/* Apply filters.
The implemented flow of the filters pipeline is in the following order:
1. apply decimation filter
2. apply threshold filter
3. transform the scene into disparity domain
4. apply spatial filter
5. apply temporal filter
6. revert the results back (if step Disparity filter was applied
2. apply rotation filter
3. apply threshold filter
4. transform the scene into disparity domain
5. apply spatial filter
6. apply temporal filter
7. revert the results back (if step Disparity filter was applied
to depth domain (each post processing block is optional and can be applied independantly).
*/
bool revert_disparity = false;
Expand Down Expand Up @@ -269,11 +273,12 @@ void render_ui(float w, float h, std::vector<filter_options>& filters)
ImGui::Checkbox(filter.filter_name.c_str(), &tmp_value);
filter.is_enabled = tmp_value;
ImGui::PopStyleColor();

if (filter.supported_options.size() == 0)
if( filter.supported_options.size() == 0 )
{
offset_y += elements_margin;
}

// Draw a slider for each of the filter's options
for (auto& option_slider_pair : filter.supported_options)
{
Expand Down Expand Up @@ -316,11 +321,21 @@ bool filter_slider_ui::render(const float3& location, bool enabled)
{
int value_as_int = static_cast<int>(value);
value_changed = ImGui::SliderInt(("##" + name).c_str(), &value_as_int, static_cast<int>(range.min), static_cast<int>(range.max), "%.0f");
if( step > 1 )
{
value_as_int = static_cast< int >( range.min )
+ ( ( value_as_int - static_cast< int >( range.min ) ) / static_cast< int >( step ) )
* static_cast< int >( step );
}
value = static_cast<float>(value_as_int);
}
else
{
value_changed = ImGui::SliderFloat(("##" + name).c_str(), &value, range.min, range.max, "%.3f", 1.0f);
if( step > 0.0f )
{
value = range.min + round( ( value - range.min ) / step ) * step;
}
}

ImGui::PopItemWidth();
Expand Down Expand Up @@ -356,12 +371,13 @@ filter_options::filter_options(const std::string name, rs2::filter& flt) :
filter(flt),
is_enabled(true)
{
const std::array<rs2_option, 5> possible_filter_options = {
const std::array<rs2_option, 6> possible_filter_options = {
RS2_OPTION_FILTER_MAGNITUDE,
RS2_OPTION_FILTER_SMOOTH_ALPHA,
RS2_OPTION_MIN_DISTANCE,
RS2_OPTION_MAX_DISTANCE,
RS2_OPTION_FILTER_SMOOTH_DELTA
RS2_OPTION_FILTER_SMOOTH_DELTA,
RS2_OPTION_ROTATION
};

//Go over each filter option and create a slider for it
Expand All @@ -378,6 +394,7 @@ filter_options::filter_options(const std::string name, rs2::filter& flt) :
supported_options[opt].name = name + "_" + opt_name;
std::string prefix = "Filter ";
supported_options[opt].label = opt_name;
supported_options[opt].step = range.step;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions include/librealsense2/h/rs_option.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ extern "C" {
RS2_OPTION_SOC_PVT_TEMPERATURE, /**< Temperature of PVT SOC */
RS2_OPTION_GYRO_SENSITIVITY,/**< Control of the gyro sensitivity level, see rs2_gyro_sensitivity for values */
RS2_OPTION_REGION_OF_INTEREST,/**< The rectangular area used from the streaming profile */
RS2_OPTION_ROTATION,/**Rotates frames*/
RS2_OPTION_COUNT /**< Number of enumeration values. Not a valid input: intended to be used in for-loops. */
} rs2_option;

Expand Down
6 changes: 6 additions & 0 deletions include/librealsense2/h/rs_processing.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ rs2_processing_block* rs2_create_align(rs2_stream align_to, rs2_error** error);
*/
rs2_processing_block* rs2_create_decimation_filter_block(rs2_error** error);

/**
* Creates post-processing filter block. This block accepts frames and applies rotation filter
* \param[out] error if non-null, receives any error that occurs during this call, otherwise, errors are ignored
*/
rs2_processing_block * rs2_create_rotation_filter_block( rs2_error ** error );

/**
* Creates Depth post-processing filter block. This block accepts depth frames, applies temporal filter
* \param[out] error if non-null, receives any error that occurs during this call, otherwise, errors are ignored
Expand Down
1 change: 1 addition & 0 deletions include/librealsense2/h/rs_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ typedef enum rs2_extension
RS2_EXTENSION_SOFTWARE_DEVICE,
RS2_EXTENSION_SOFTWARE_SENSOR,
RS2_EXTENSION_DECIMATION_FILTER,
RS2_EXTENSION_ROTATION_FILTER,
RS2_EXTENSION_THRESHOLD_FILTER,
RS2_EXTENSION_DISPARITY_FILTER,
RS2_EXTENSION_SPATIAL_FILTER,
Expand Down
8 changes: 8 additions & 0 deletions include/librealsense2/hpp/rs_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,14 @@ namespace rs2

return results;
}

std::string get_opcode_string(int opcode)
{
rs2_error* e = nullptr;
char buffer[1024];
rs2_hw_monitor_get_opcode_string(opcode, buffer, sizeof(buffer), _dev.get(), &e);
return std::string(buffer);
}
};

class device_list
Expand Down
42 changes: 42 additions & 0 deletions include/librealsense2/hpp/rs_processing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,48 @@ namespace rs2
}
};

class rotation_filter : public filter
{
public:
/**
* Create rotation filter
* Rotation filter performs rotation of the frames
*/
rotation_filter()
: filter( init(), 1 )
{
}

rotation_filter( float value )
: filter( init(), 1 )
{
set_option( RS2_OPTION_ROTATION, value );
}

rotation_filter( filter f )
: filter( f )
{
rs2_error * e = nullptr;
if( ! rs2_is_processing_block_extendable_to( f.get(), RS2_EXTENSION_ROTATION_FILTER, &e ) && ! e )
{
_block.reset();
}
error::handle( e );
}

private:
friend class context;

std::shared_ptr< rs2_processing_block > init()
{
rs2_error * e = nullptr;
auto block = std::shared_ptr< rs2_processing_block >( rs2_create_rotation_filter_block( &e ),
rs2_delete_processing_block );
error::handle( e );
return block;
}
};

class temporal_filter : public filter
{
public:
Expand Down
2 changes: 2 additions & 0 deletions include/librealsense2/rs.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ float rs2_depth_frame_get_distance(const rs2_frame* frame_ref, int x, int y, rs2
*/
rs2_time_t rs2_get_time( rs2_error** error);

void rs2_hw_monitor_get_opcode_string(int opcode, char* buffer, size_t buffer_size,rs2_device* device, rs2_error** error);

#ifdef __cplusplus
}
#endif
Expand Down
Loading
Loading