xdspacelab / openvslam

OpenVSLAM: A Versatile Visual SLAM Framework
https://openvslam.readthedocs.io/
2.97k stars 870 forks source link

Current camera pose going backward #429

Open gizmosir opened 4 years ago

gizmosir commented 4 years ago

Follow the installation step by step and finally run the example successfully. But the current camera pose are going backard instead. And the tracking will lose as soon as it detect a looping. Do you have any idea?

backward_1 _current_campose are going backward

backward_2 _current_campose look like at the symmetry place of where it should be

backward_3 _before looping is detected, everything seems fine except the current_campose

backward_4 as the looping is detected, map change dramatically and tracking no more

ymd-stella commented 4 years ago

I think you have the wrong config or input image. I think it would be a good idea to go to https://spectrum.chat/openvslam and write the information about the camera and the current config.yaml and ask how you should create the config.

gizmosir commented 4 years ago

@ymd-stella Thank for you advice. I will definitly get it a try.

Actually I am running the command bellow which pretty much the same as tutorial. And I also tried the KITTI sequence_00 with the config.yaml in example/kitti folder. It has the same problem.

./build/run_video_slam -v orb_vocab/orb_vocab.dbow2 -c ~/Dataset/equirectangular/aist_living_lab_1/config.yaml -m ~/Dataset/equirectangular/aist_living_lab_1/video.mp4 --frame-skip 3 --map-db aist_living_lab_1_map.msg

From my point of view, it looks like a hidden bug instead of missing around with dataset and config. I am tracking down this bug and it seems like cam_pose_cw.inverse() bellow do not get the right result.

/src/pangolin_viewer/viewer.cc @@185~189

pangolin::OpenGlMatrix viewer::get_current_cam_pose() { 
    const auto cam_pose_cw = map_publisher_->get_current_cam_pose();
    const pangolin::OpenGlMatrix gl_cam_pose_wc(cam_pose_cw.inverse().eval());
    return gl_cam_pose_wc;
}

I am using eigen 3.3.5 and this lib performs correctly at another computer.

ymd-stella commented 4 years ago

If it's an installation issue, there's little I can advise you on. All you can do for this issue is to adapt your environment to the one we tested or figure out how to get the library to work in your environment as well. I'm looking forward to a follow-up report.

surfii3z commented 4 years ago

Hi @gizmosir

IDK if it's related or not but when I built g2o and openVSLAM with -DBUILD_WITH_MARCH_NATIVE=OFF it seems to have the same problem.

When I change it to -DBUILD_WITH_MARCH_NATIVE=ON , then it works fine.