View my account

Empty point cloud on rs2::pointcloud::calculate()

Comments

4 comments

  • MartyG

    I considered your question very carefully. I believe that you are using the correct approach by accessing the vertices via the point cloud class with points.get_vertices and your code is consistent with Intel's point cloud example program.

    https://github.com/IntelRealSense/librealsense/tree/master/examples/pointcloud 

    Could you try removing the line int vertex_count = 0 please to eliminate the possibility that this line is forcing the output vertex count to constantly = 0?

    0
    Comment actions Permalink
  • Zettler Aaron

    If I replace "int vertex_count = 0;" with "int vertex_count;" like you suggested, I get some random value because "vertex_count" isn't initialized.

    Measurement at [300, 300] = 2.634000
    Fond 921600 Vertices
    Count Vertices that are not (0, 0, 0) = -1025714016

    But i can print something if a vertex isn’t (0, 0, 0) like in the code below.

    if (vertices[i].x > 0.0 || vertices[i].y > 0.0 || vertices[i].z > 0.0)
    {
    std::cout << "We got a Vertex that isnt (0, 0, 0)" << std::endl;
    vertex_count++;
    }

    You can see that nothing gets printed below.

    Measurement at [300, 300] = 2.634000
    Fond 921600 Vertices
    Count Vertices that are not (0, 0, 0) = 0
    0
    Comment actions Permalink
  • MartyG

    All of the RealSense cases involving extracting vertices from a bag involve using the MATLAB vision software and its robotics toolbox.  If you prefer to do it totally within the RealSense SDK then I recommend enquiring at the RealSense GitHub by visiting the link below and clicking on the New Issue button to post a question.  They should have the specialist programming knowledge to be able to help you.   I do apologize.

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

    0
    Comment actions Permalink
  • Zettler Aaron

    Thank you, I will try my luck there.

    0
    Comment actions Permalink

Please sign in to leave a comment.