Clear Filters
Clear Filters

Is there any way to load a g2o file posegraph in matlab?

8 views (last 30 days)
I am wondering if there is any way to load a posegraph (available in the form of g2o file) in MATLAB and also store the optimized pose graph in a file? I have searched for it in official documentation but there is no answer to this.

Answers (2)

Zheng Dong
Zheng Dong on 6 Dec 2023
Hi Haris,
Unfortunately, there is no existing tool which supports importing a g2o file to be a poseGraph object. I have created an enhancement task based on your request. Our team will consider enabling this functionality in the future.
However, there is a function importFactorGraph which accpets g2o files and it will create a factorGraph object based on the g2o file. Factor graph is a powerful frame we currently work on which is similar to poseGraph but supports much more kinds of edges and different SLAM workflows. You can give it a try if you are interested.
Besides, you can store optimized poseGraph by
save('new','updatedPG')
It will save the updated poseGraph (updatedPG) to the new.mat file.
Best,
Zheng

Remo Pillat
Remo Pillat on 6 Dec 2023
Another option would be to look at Peter Corke's RVC3 toolbox. It has a function, g2oread, which implements what you are asking for. In addition to returning a poseGraph object, it can also extract lidar scans that may be stored in the g2o file.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!