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

Call "get_tracked_mappoints()" but no response #15

Open
jerrywiston opened this issue May 5, 2020 · 2 comments
Open

Call "get_tracked_mappoints()" but no response #15

jerrywiston opened this issue May 5, 2020 · 2 comments

Comments

@jerrywiston
Copy link

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.

@LiudmylaN
Copy link

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

@jerrywiston
Copy link
Author

jerrywiston commented Jun 30, 2020

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)                          
            ));
        }
}

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

No branches or pull requests

2 participants