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

[Feature request] Expose the apply_depth_control_preset function #106

Closed
I0x0I opened this issue Sep 13, 2016 · 10 comments
Closed

[Feature request] Expose the apply_depth_control_preset function #106

I0x0I opened this issue Sep 13, 2016 · 10 comments

Comments

@I0x0I
Copy link

I0x0I commented Sep 13, 2016

Hi everyone, as mentioned in #50, using the default settings of R200 may produce a noisy depth image, the ds-private.cpp shows the default settings are actually optimized for outdoor scenario.

    const dc_params dc_params::presets[] = {
        {5, 5, 192,  1,  512, 6, 24, 27,  7,   24}, // (DEFAULT) Default settings on chip. Similiar to the medium setting and best for outdoors.
        {5, 5,   0,  0, 1023, 0,  0,  0,  0, 2047}, // (OFF) Disable almost all hardware-based outlier removal
        {5, 5, 115,  1,  512, 6, 18, 25,  3,   24}, // (LOW) Provide a depthmap with a lower number of outliers removed, which has minimal false negatives.
        {5, 5, 185,  5,  505, 6, 35, 45, 45,   14}, // (MEDIUM) Provide a depthmap with a medium number of outliers removed, which has balanced approach.
        {5, 5, 175, 24,  430, 6, 48, 47, 24,   12}, // (OPTIMIZED) Provide a depthmap with a medium/high number of outliers removed. Derived from an optimization function.
        {5, 5, 235, 27,  420, 8, 80, 70, 90,   12}, // (HIGH) Provide a depthmap with a higher number of outliers removed, which has minimal false positives.
    };

By using the apply_depth_control_preset function from the rs.hpp to set the R200 works in HIGH mode, I can clearly see a reduce of noise points in the depth image.
So exposing the apply_depth_control_preset function in the ROS node is likely to solve the problem ;-)

@doisyg
Copy link

doisyg commented Sep 13, 2016

That would be amazing!
I've never used librealsense, just the ROS implementation. Without exposing the 'apply_depth_control_preset' function in the ROS node, is there a way of changing this mode and making the change permanent to use it then in ROS?

@I0x0I
Copy link
Author

I0x0I commented Sep 13, 2016

For different versions of librealsense, fixs might not be the same.
As for the latest version, a possible quick fix can be like

  1. Include librealsense/rsutil.h in base_nodelet.h
  2. Add rs_apply_depth_control_preset(rs_device_, 5); to base_nodelet.cpp line 478

I haven't try out this quick fix yet since I use an older version of librealsense and this fix is probably only for the R200.

@doisyg
Copy link

doisyg commented Sep 14, 2016

Thanks a lot @I0x0I , this fix works great and I have a much cleaner pointcloud now

@reaganlo
Copy link

@I0x0I Thanks for your suggestion. We are working on providing a ROS API for this functionality via rqt_reconfigure. We will keep you posted.

@mdhorn
Copy link

mdhorn commented Sep 22, 2016

This will be include in the upcoming 1.5.0 release.

@mdhorn
Copy link

mdhorn commented Sep 29, 2016

Fixed by release 1.5.0
https://github.com/intel-ros/realsense/releases/tag/1.5.0

@mdhorn mdhorn closed this as completed Sep 29, 2016
@doisyg
Copy link

doisyg commented Oct 18, 2016

Is it possible to view a working launch file which use the new depth control preset option?

EDIT: found it with rqt_reconfigure but would be nice to have this documented in the readme

@mdhorn
Copy link

mdhorn commented Oct 18, 2016

r200_nodelet_dc_preset.launch.txt

I'm attaching a sample file to set a different depth control preset: r200_nodelet_dc_preset.launch

However, in testing this I found a bug in the 1.5.0 implementation and documented the bug as Issue #132

A fix for this should be in the 'indigo-devel' branch soon and it will be in the next release 1.6.0.

@lucasjinreal
Copy link

@mdhorn How to open this option in code?

@mdhorn
Copy link

mdhorn commented Dec 27, 2018

@jinfagang I haven't looked at this for a few years, but you should be able to change the parameter with the API http://wiki.ros.org/ROS/Parameter%20Server%20API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants