一起学RGBDSLAM系列_问题及解决
本博客主要介绍的是跟人在学习高翔博士“一起学RGBDSLAM系列”中遇到的问题和解决方法。vslam入门系列见高博士blog主页:http://www.cnblogs.com/gaoxiang12/
1 part4 :cloudviewer 未定义引用
解决方法:# 增加PCL库的依赖添加 visualization
FIND_PACKAGE( PCL REQUIRED COMPONENTS common io visualization )
2 文件或图片没找到导致的一系列错误
解决方法:写上正确的文件路径
ParameterReader( string filename="../parameters.txt")
3 part5:Eigen 出错
解决方法:在slamBase.h中将Eigen库放到OpenCV库之前,即
// Eigen
#include <Eigen/Core>
#include <Eigen/Geometry>
// OpenCV
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <opencv2/core/eigen.hpp>
4 part4 and part5:
函数joinPointCloud()中代码为
pcl::transformPointCloud( *original, *output, T.matrix() );
*newCloud += *output;
运算过程为:
output = T * original;
*newCloud += *output;
original在每次更新中都会叠加增大,运算量每次都会增多。可改为
output = inv(T)* newCloud;
*original += *output;
不行,因为 inv(T)* newCloud只能得到在上一帧坐标系下的点云,并不是第一帧的点云,叠加后会出错
问题 5 part6 and part7
图优化中边是什么?
Pnp 计算的T又是那两个坐标系的转移矩阵
edge->setMeasurement( T.inverse() );
回答: Pnp 计算的T是那两个坐标系P1 P2的转移矩阵,关系为 P2=T * P1 即T为P1在P2下的位姿
所以 P1 =inv(T) * P2, inv(T)为P2在P1下的位姿, edge->setMeasurement( T.inverse() );
pnp from OpenCV docutmentation:
rvec– Output rotation vector (see Rodrigues() ) that, together with tvec, brings points from the model coordinate system to the camera coordinatesystem
问题6 par6 linux 14.04无法安装libqglviewer-qt4-dev
解决方法,如图