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

rs2_depth_frame_get_distance doesn't work for software_device sensor #2844

Closed
ruanjiandong opened this issue Dec 4, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@ruanjiandong
Copy link

Repro Steps:

  1. create software_device pipeline like https://github.com/IntelRealSense/librealsense/tree/master/examples/software-device
  2. add the following processing logic:
   rs2::align aligner(RS2_STREAM_COLOR);
   auto fset = sync.wait_for_frames();

   // the following succeeds since it use RS2_OPTION_DEPTH_UNITS
   aligner.process(fset);
   auto depth_frame = aligned_frame.get_depth_frame();

   // the following always return 0.0 since it doesn't use RS2_OPTION_DEPTH_UNITS
   auto depth = rs2_depth_frame_get_distance(depth_frame.get(), u, v, nullptr);

Root cause:
Internally, rs2_depth_frame_get_distance calls depth_frame::query_units function in src/archive.h. depth_frame::query_units can't correctly handle software depth sensor.

Proposed fix: depth_frame::query_units query RS2_OPTION_DEPTH_UNITS option on the sensor object itself.

@dorodnic
Copy link
Contributor

dorodnic commented Dec 5, 2018

Hi @ruanjiandong
Thank you for the report, we will look into this. The logic behind Depth-Units is a bit complex because we are concerned about sending hardware command to the device on every frame (it would be very bad in terms of both latency and power-consumption). So we try to cache it. We will look into how to solve this.

dorodnic added a commit to dorodnic/librealsense that referenced this issue Feb 25, 2019
…th sensor, but only when RS2_OPTION_DEPTH_UNITS is defined
@dorodnic dorodnic mentioned this issue Feb 25, 2019
@RealSenseCustomerSupport
Copy link
Collaborator


Please check librealsense 2.19.0 with the fix.

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

No branches or pull requests

4 participants