Search code examples
rospoint-cloud-library

std::length error when using PCL Ground_based RGBD detection


I am facing an issue with Ground-based RGBD people detection (https://pcl.readthedocs.io/projects/tutorials/en/latest/ground_based_rgbd_people_detection.html). The error is inconsistent and hence has been pretty difficult to narrow down. When I am running the detection, sometimes it throws a std::length error, and what() says vector_M_fill_insert. Initially, I assumed it happened when people were detected (because it ran fine and the moment a person entered the frame, it stopped), and it was probably associated with the clustering, but in a few cases, it threw the error just after I launched the node. I passed a processed point cloud to it and then passed the direct camera point cloud as well just to try to check if the issue was with the processed point cloud, but in both cases, it threw the error unpredictably. I am confused as to how to go about debugging the error or what might be causing it. Any help is appreciated thank you!


Solution

  • You need to build your nodes with debug flags enabled and that can be achieved in some ways ... Adding to your CMakelists.txt

    set(CMAKE_BUILD_TYPE Debug)
    

    Or

    compiling with -DCMAKE_BUILD_TYPE=Debug.

    Then you should attach the gdb debugger to whatever node you want. If you are using VS Code as IDE, there is already an extension for it with tutorials, otherwise, you can also add it to your launch file as described here