Orb_slam2: Saving map in realtime

Created on 19 Dec 2016  路  1Comment  路  Source: raulmur/ORB_SLAM2

I am using orbslam2 with ros kinetic and i've managed to run some examples using my webcam.
I know that orb slam saves the trajectory in KeyFrameTrajectory.txt. But what I want to do is extracting the coordinates in real time. In other word , is there a way to make orbslam2 node publish the coordinates so that I can use it in other applications.

Most helpful comment

Only if you want to write c++ code.

There is only one instance of Map, it contains all MapPoints, you can get them in a vector of MapPoint in main from SLAM.mpMap->GetAllMapPoints() .

vector<MapPoint> mapPoints = SLAM.mpMap->GetAllMapPoints();
Mat position = mapPoints[i].GetWorldPos();

position will be a 3 element Mat, representing the absolute point position in the map.

Remember, scale is arbitrary.

>All comments

Only if you want to write c++ code.

There is only one instance of Map, it contains all MapPoints, you can get them in a vector of MapPoint in main from SLAM.mpMap->GetAllMapPoints() .

vector<MapPoint> mapPoints = SLAM.mpMap->GetAllMapPoints();
Mat position = mapPoints[i].GetWorldPos();

position will be a 3 element Mat, representing the absolute point position in the map.

Remember, scale is arbitrary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EasternH picture EasternH  路  5Comments

imrasp picture imrasp  路  6Comments

jinfagang picture jinfagang  路  4Comments

Gaoxiang-Zhang picture Gaoxiang-Zhang  路  3Comments

balzar29 picture balzar29  路  4Comments