ORB_SLAM2-PythonBindings icon indicating copy to clipboard operation
ORB_SLAM2-PythonBindings copied to clipboard

Call "get_tracked_mappoints()" but no response

Open jerrywiston opened this issue 4 years ago • 2 comments

To get the 3D map points built by orb-slam, I call the function of slam:

map_pts = slam.get_tracked_mappoints()
print(map_pts)

But the program stuck here and no response.

jerrywiston avatar May 05 '20 11:05 jerrywiston

I have a similar issue, but I get 'Segmentation fault' error.

LiudmylaN avatar Jun 22 '20 04:06 LiudmylaN

I found there are empty elements in map points causing the segmentation fault. You can modify the code in src/ORBSlamOython.cpp Line:311 to

for(size_t i=0; i<Mps.size(); i++)    {
       if(Mps[i] != NULL){
            cv::Mat wp = Mps[i]->GetWorldPos();
            map_points.append(boost::python::make_tuple(
                wp.at<float>(0,0),
                wp.at<float>(1,0),
                wp.at<float>(2,0)                          
            ));
        }
}

jerrywiston avatar Jun 30 '20 04:06 jerrywiston