View my account

Incorrect depth measurement at high speeds

Comments

11 comments

  • MartyG

    May I begin by first asking if your program uses wait_for_frames() so that the program will block until a complete frame is received?  In the link below, a RealSense team member explains the difference between wait_for_frames() and other types of '_for_frames' instructions, such as poll_for_frames() that returns frames instantly without waiting.

    https://github.com/IntelRealSense/librealsense/issues/2422

    0
    Comment actions Permalink
  • Lschreurs25

    Hi Marty,

     

    First of all, I think you tagged the wrong person, but yes my program uses wait_for_frames(), as seen in the screenshot along with the code used to get the frame.

     

    0
    Comment actions Permalink
  • MartyX Grover

    Thanks very much for the tag correction, Lschreurs25 - I have adjusted the comment above!

    I note that you are using rs2::align.  If you built the librealsense SDK on Jetson with CUDA support included then the program will be likely taking advantage of the automatic acceleration for align operations that is provided by the Jetson's Nvidia graphics GPU chip.  This can considerably reduce the processing burden on the CPU by offloading the processing work onto the GPU.

     

    CUDA support will be included if librealsense was built on your Jetson from packages or if you built from source code with CMake and included the build term -DBUILD_WITH_CUDA=true

    0
    Comment actions Permalink
  • Lschreurs25

    I have included CUDA support while building. So you are saying the line : "frames = frames.apply_filter(alignment); " is actually increasing the execution time as it is unnecessary?

    I will try this and report back to you with the results! thank you!

    0
    Comment actions Permalink
  • MartyX Grover

    You would still need to include an instruction to perform alignment.  What CUDA support can do is significantly reduce the percentage usage of the CPU when performing alignment (it also accelerates pointcloud and color conversion operations).  Alignment is a CPU-intensive processing operation.  

    The link below provides rough examples of CPU percentage usage values with and without CUDA support when performing pointcloud generation and color conversion (align support was added a little later, so figures for % usage reduction for alignment are not included in that link).

    https://github.com/IntelRealSense/librealsense/pull/1866

    0
    Comment actions Permalink
  • Lschreurs25

    Okay I will look into this!

     

    It seems there are some problems with the Xavier at the moment, which need to be fixed before I can test this. So when these are resolved I will get back at you!

    0
    Comment actions Permalink
  • MartyX Grover

    Thanks very much.  I look forward to your next report.

     

    The link below has CUDA performance figures relating to align acceleration.

    https://github.com/IntelRealSense/librealsense/pull/2670

    0
    Comment actions Permalink
  • Lschreurs25

    Hey MartyG,

     

    So I got the Jetson working again, only the problem remains.

    On top of that, the PC is having a similar problem. Where the Jetson gets incorrect depth measurements with little to no time between getting the frame and measuring depth, the PC gets more incorrect depth measurements with more time between getting the frame and measuring depth. This is all with the same c++ program.

    I really am getting confused, as I thought maybe the CPU of the Jetson was too slow or something. But that doesn't explain the problem with the PC.

     

    0
    Comment actions Permalink
  • MartyX Grover

    It may be worth testing the RealSense SDK's rs-grabcuts OpenCV C++ example, which also aligns depth and color, to see whether the same problems occur when running that program on your PC and Jetson.  If it works normally then that would suggest that there is a problem in your script code.

    https://github.com/IntelRealSense/librealsense/tree/master/wrappers/opencv/grabcuts

    0
    Comment actions Permalink
  • Lschreurs25

    Okay, I will try this. 

    For now I built a buffer for the height, which returns an average of the last 100 correct measurements. It isn't the correct way to fix the issue, but it must do for now.

    I want to thank you for your help!

    0
    Comment actions Permalink
  • MartyX Grover

    You are very welcome!

    0
    Comment actions Permalink

Please sign in to leave a comment.