MIT-SPARK / Kimera-VIO

Visual Inertial Odometry with SLAM capabilities and 3D Mesh generation.
BSD 2-Clause "Simplified" License
1.56k stars 418 forks source link

Hints on using the Kimera-VIO front end? #179

Closed toivo-he closed 2 years ago

toivo-he commented 3 years ago

Hi, we want to do some research on accelerating factor graph optimization for SLAM, and are interested to see if we can use the front end in Kimera-VIO to extract features. I tried to look through some of the code, but it's not obvious to me how I could do this in a good way.

I see that GTSAM is used by both the front end and back end, so I guess that the front end creates GTSAM factors and hands them to the back end? Let's say that I want to run Kimera-VIO on an existing data set and export the GTSAM factors as they are delivered by the front end. Where do you think would be a good place in the code where I could try to add this kind of functionality?

Also, I know that there are some python bindings for Kimera but I haven't been able to figure out what they do or how to use them. Is something like this already exposed through the python bindings so that I can play around with it?

Thanks, Toivo

marcusabate commented 2 years ago

This is a bit late but the frontend creates measurements (gtsam::StereoPoint) that are then converted to factors in the backend. If you want to capture the factors before they are added to the graph, this would all be done in the backend. Take a look at the large function VioBackend::addVisualInertialStateAndOptimize which includes the factor construction and adds the factors, before calling the optimizer. Gtsam has some functionality built in to save factor graphs to file, should only need to add a line or two.