raulmur / ORB_SLAM2

Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities
Other
9.49k stars 4.7k forks source link

Issue with bundle adjustment #284

Open Mieos opened 7 years ago

Mieos commented 7 years ago

I use ORB-SLAM2 in stereo-mode with rectified images coming from a stereo calibrated camera.

I tried to see if the bundle adjustment works properly by testing it with a plane surfaced quite well textured and by trying to do a loop in the camera poses in order to get this loop detected by orbslam2. According to the pointCloud obtained, it seems to work properly during a time and it looks like a plane but after a while, the drift accumulates and when I come back to the first camera position, the reprojected points do not match at all in the pointcloud and I get 2 distinct planes. I think at this point a loop should be detected and the camera poses graph should be corrected but it's not.. Even If I try to come back in area I have already explore, the graph never recover as it should.

I've observed that I've got a quite huge amount of keyframes that could be a source of problems for the bundle adjustment (I did not really understand how to properly reduce this amount). I guess it might have a link with this parameter ThDepth but I don't know how to properly set it.

During the exploration I've got some warning in the terminal: virtual int g2o::SparseOptimizer::optimize(int, bool): 0 vertices to optimize, maybe forgot to call initializeOptimization()

It seems that some other issues already report this ( #211 and #276 ) and it might be why the bundle adjustment does not work properly in my case.

Maybe there is a way I can reduce the number of keyframes used?

Mieos commented 7 years ago

Ok.. So I investigated a little and I've found different things:

Any ideas concerning those parameters? Maybe it's linked to ThDepth.

mtee commented 7 years ago

You can sort of control the frequency with which keyframes are created with the camera.fps parameter. The more the fps number, the less keyframes are created per time unit.