jskinn / ORB_SLAM2-PythonBindings

A python wrapper for ORB_SLAM2
BSD 2-Clause "Simplified" License
162 stars 40 forks source link

Slowdown over time #4

Open djl11 opened 6 years ago

djl11 commented 6 years ago

From my understanding, the list of trajectory points which is revealed by slam.get_trajectory_points() grows indefinitely. This both means that calls to slam.get_trajectory_points() take longer and longer to execute each time, eventually ceasing to meet real-time speeds, and the program would eventually eat up all the ram if left running for long enough. Is there any other way of retrieving just the most recent camera poses, which doesn't suffer from this slowdown?

(ps thanks for sharing these bindings)

jskinn commented 5 years ago

The problem is that ORB_SLAM2 needs to store the whole pose-graph to perform bundle adjustment and loop closure. When it detects a loop closure, it goes back and updates the estimated poses for the earlier frames.

So yes, the memory is going to grow significantly over time, which is part of the design of ORB_SLAM2. Managing this sounds like a hard problem.

In terms of these bindings, it should be possible to retrieve only the more recent frames (either just the current, or an index based approach might be interesting), but this doesn't stop ORB_SLAM2 from storing them, or reduce the memory.