Skip to content

Commit

Permalink
turn subpixel off with low bandwidth, disable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Serafadam committed Dec 3, 2024
1 parent 42846f8 commit f51cfeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion depthai_ros_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(CMAKE_BUILD_SHARED_LIBS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra -Wpedantic -Wno-deprecated-declarations -Wno-maybe-uninitialized)
endif()
# Default to C99
if(NOT CMAKE_C_STANDARD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void StereoParamHandler::updateSocketsFromParams(dai::CameraBoardSocket& left, d

void StereoParamHandler::declareParams(std::shared_ptr<dai::node::StereoDepth> stereo) {
declareAndLogParam<int>("i_max_q_size", 30);
declareAndLogParam<bool>("i_low_bandwidth", false);
bool lowBandwidth = declareAndLogParam<bool>("i_low_bandwidth", false);
declareAndLogParam<int>("i_low_bandwidth_quality", 50);
declareAndLogParam<int>("i_low_bandwidth_profile", 4);
declareAndLogParam<int>("i_low_bandwidth_frame_freq", 30);
Expand Down Expand Up @@ -136,10 +136,13 @@ void StereoParamHandler::declareParams(std::shared_ptr<dai::node::StereoDepth> s
stereo->initialConfig.setLeftRightCheckThreshold(declareAndLogParam<int>("i_lrc_threshold", 10));
stereo->initialConfig.setMedianFilter(static_cast<dai::MedianFilter>(declareAndLogParam<int>("i_depth_filter_size", 5)));
stereo->initialConfig.setConfidenceThreshold(declareAndLogParam<int>("i_stereo_conf_threshold", 240));
if(declareAndLogParam<bool>("i_subpixel", true)) {
if(declareAndLogParam<bool>("i_subpixel", true) && !lowBandwidth) {
stereo->initialConfig.setSubpixel(true);
stereo->initialConfig.setSubpixelFractionalBits(declareAndLogParam<int>("i_subpixel_fractional_bits", 3));
}
else if(lowBandwidth) {
RCLCPP_INFO(getROSNode()->get_logger(), "Subpixel disabled due to low bandwidth mode");
}
stereo->setRectifyEdgeFillColor(declareAndLogParam<int>("i_rectify_edge_fill_color", 0));
if(declareAndLogParam<bool>("i_enable_alpha_scaling", false)) {
stereo->setAlphaScaling(declareAndLogParam<float>("i_alpha_scaling", 0.0));
Expand Down

0 comments on commit f51cfeb

Please sign in to comment.