tum-vision / lsd_slam

LSD-SLAM
GNU General Public License v3.0
2.58k stars 1.23k forks source link

Adding GPS measurements #312

Open ronir121 opened 5 years ago

ronir121 commented 5 years ago

Hi I'm trying to incorporate GPS measurements (xyz, az el roll) into lsd-slam. I changed the frame initialization to be the known position instead of the previous frame position according to this piece of code:

SE3 frame_to_kf_init = se3FromSim3(curr_trackingref->keyframe->pose->getCamToWorld().inverse() sim3FromSE3(pose, 1.0)); frame_to_kf_init.translation() = curr_trackingref->keyframe->pose->getCamToWorld().scale(); SE3 frame_to_kfupd = tracker->trackFrame(curr_trackingref.get(), trackingNewFrame.get(), frame_to_kf_init);

And changed the pose of the first frame according to the GPS measurement as well. However, the tracking is lost after 3-4 frames.

When I don't use these measurements, and use the default initialization, the tracking continues through the entire sequence. Any tips on how to do this? Maybe I should add an UnaryEdge or something like that to the graph? (like Prior factors in gtsam)