高翔博士:视觉SLAM十四讲笔记(nX)

0. 为什么标题的编号是(nX)?

因为是在学习到第7章的时候,被有关G2O的安装和编译不通过给搞疯了,要成魔了,才想起了应该把踩过的坑记录下来,以供日后学习,也给后来者提供一个快速过坑的机会。
我的环境配置为:
ubuntu18.04 + opencv-3.4.6 + ceres-solver-1.14.0

1. ** 安装和编译G2O**

1.1 下载源文件

安装的版本是g2o-20170730,点这里下载github上的g2o-20170730.tar.gz,也可以在码云上面下载镜像文件。

1.2 解压缩与编译

1.2.1 删除已有g2o库

一般而言,g2o会安装在usr\local\bin, usr\local\include, usr\local\lib三个文件夹中,依次进入这三个文件夹,在终端输入

sudo rm -rf *g2o*

可以把有关g2o的文件都删掉。

1.2.2 安装依赖项

检查g2o的安装依赖项:

sudo apt-get install cmake libeigen3-dev libsuitesparse-dev libqt4-dev qt4-qmake libqglviewer-dev

如果有报错,则使用下面的命令,设置强制安装。

sudo apt-get -f install

然后再输入一遍安装依赖项的命令:

sudo apt-get -f install cmake libeigen3-dev libsuitesparse-dev libqt4-dev qt4-qmake libqglviewer-d

1.3 安装G2O

可以用高翔在git上的包,一可以使用clone安装(如果你的网速够快的话)

git clone https://github.com/RainerKuemmerle/g2o.git

或者把已经下载的g2o.tar.gz解压到 ~/Download/g2o-2017/ 目录下。
然后进入g2o文件夹,执行cmake编译

mkdir build
cd build
cmake-gui ..

选择安装路径和配置选项,然后
make
得到日志结果如下:

Scanning dependencies of target freeglut_minimal
[  0%] Building CXX object EXTERNAL/freeglut/CMakeFiles/freeglut_minimal.dir/freeglut_font.cpp.o
[  0%] Building CXX object EXTERNAL/freeglut/CMakeFiles/freeglut_minimal.dir/freeglut_stroke_mono_roman.cpp.o
[  1%] Building CXX object EXTERNAL/freeglut/CMakeFiles/freeglut_minimal.dir/freeglut_stroke_roman.cpp.o
[  1%] Linking CXX shared library ../../../lib/libg2o_ext_freeglut_minimal.so
[  1%] Built target freeglut_minimal
Scanning dependencies of target opengl_helper
[  1%] Building CXX object g2o/stuff/CMakeFiles/opengl_helper.dir/opengl_primitives.cpp.o
[  2%] Linking CXX shared library ../../../lib/libg2o_opengl_helper.so
[  2%] Built target opengl_helper
Scanning dependencies of target stuff
[  2%] Building CXX object g2o/stuff/CMakeFiles/stuff.dir/timeutil.cpp.o
[  3%] Building CXX object g2o/stuff/CMakeFiles/stuff.dir/command_args.cpp.o
[  3%] Building CXX object g2o/stuff/CMakeFiles/stuff.dir/sparse_helper.cpp.o
[  4%] Building C object g2o/stuff/CMakeFiles/stuff.dir/os_specific.c.o
[  4%] Building CXX object g2o/stuff/CMakeFiles/stuff.dir/filesys_tools.cpp.o
[  4%] Building CXX object g2o/stuff/CMakeFiles/stuff.dir/string_tools.cpp.o
[  5%] Building CXX object g2o/stuff/CMakeFiles/stuff.dir/property.cpp.o
[  5%] Building CXX object g2o/stuff/CMakeFiles/stuff.dir/sampler.cpp.o
[  5%] Building CXX object g2o/stuff/CMakeFiles/stuff.dir/tictoc.cpp.o
[  6%] Linking CXX shared library ../../../lib/libg2o_stuff.so
[  6%] Built target stuff
Scanning dependencies of target core
[  6%] Building CXX object g2o/core/CMakeFiles/core.dir/hyper_graph_action.cpp.o
[  7%] Building CXX object g2o/core/CMakeFiles/core.dir/hyper_graph.cpp.o
[  7%] Building CXX object g2o/core/CMakeFiles/core.dir/marginal_covariance_cholesky.cpp.o
[  8%] Building CXX object g2o/core/CMakeFiles/core.dir/matrix_structure.cpp.o
[  8%] Building CXX object g2o/core/CMakeFiles/core.dir/batch_stats.cpp.o
[  8%] Building CXX object g2o/core/CMakeFiles/core.dir/parameter.cpp.o
[  9%] Building CXX object g2o/core/CMakeFiles/core.dir/cache.cpp.o
[  9%] Building CXX object g2o/core/CMakeFiles/core.dir/optimizable_graph.cpp.o
[ 10%] Building CXX object g2o/core/CMakeFiles/core.dir/solver.cpp.o
[ 10%] Building CXX object g2o/core/CMakeFiles/core.dir/optimization_algorithm_factory.cpp.o
[ 10%] Building CXX object g2o/core/CMakeFiles/core.dir/estimate_propagator.cpp.o
[ 11%] Building CXX object g2o/core/CMakeFiles/core.dir/factory.cpp.o
[ 11%] Building CXX object g2o/core/CMakeFiles/core.dir/sparse_optimizer.cpp.o
[ 11%] Building CXX object g2o/core/CMakeFiles/core.dir/hyper_dijkstra.cpp.o
[ 12%] Building CXX object g2o/core/CMakeFiles/core.dir/parameter_container.cpp.o
[ 12%] Building CXX object g2o/core/CMakeFiles/core.dir/optimization_algorithm.cpp.o
[ 13%] Building CXX object g2o/core/CMakeFiles/core.dir/optimization_algorithm_with_hessian.cpp.o
[ 13%] Building CXX object g2o/core/CMakeFiles/core.dir/optimization_algorithm_gauss_newton.cpp.o
[ 13%] Building CXX object g2o/core/CMakeFiles/core.dir/optimization_algorithm_levenberg.cpp.o
[ 14%] Building CXX object g2o/core/CMakeFiles/core.dir/optimization_algorithm_dogleg.cpp.o
[ 14%] Building CXX object g2o/core/CMakeFiles/core.dir/sparse_optimizer_terminate_action.cpp.o
[ 15%] Building CXX object g2o/core/CMakeFiles/core.dir/jacobian_workspace.cpp.o
[ 15%] Building CXX object g2o/core/CMakeFiles/core.dir/robust_kernel.cpp.o
[ 15%] Building CXX object g2o/core/CMakeFiles/core.dir/robust_kernel_impl.cpp.o
[ 16%] Building CXX object g2o/core/CMakeFiles/core.dir/robust_kernel_factory.cpp.o
[ 16%] Linking CXX shared library ../../../lib/libg2o_core.so
[ 16%] Built target core
Scanning dependencies of target g2o_cli_library
[ 16%] Building CXX object g2o/apps/g2o_cli/CMakeFiles/g2o_cli_library.dir/dl_wrapper.cpp.o
[ 17%] Building CXX object g2o/apps/g2o_cli/CMakeFiles/g2o_cli_library.dir/output_helper.cpp.o
[ 17%] Building CXX object g2o/apps/g2o_cli/CMakeFiles/g2o_cli_library.dir/g2o_common.cpp.o
[ 17%] Linking CXX shared library ../../../../lib/libg2o_cli.so
[ 17%] Built target g2o_cli_library
Scanning dependencies of target g2o_cli_application
[ 17%] Building CXX object g2o/apps/g2o_cli/CMakeFiles/g2o_cli_application.dir/g2o.cpp.o
[ 18%] Linking CXX executable ../../../../bin/g2o
[ 18%] Built target g2o_cli_application
Scanning dependencies of target g2o_hierarchical_library
[ 18%] Building CXX object g2o/apps/g2o_hierarchical/CMakeFiles/g2o_hierarchical_library.dir/edge_labeler.cpp.o
[ 19%] Building CXX object g2o/apps/g2o_hierarchical/CMakeFiles/g2o_hierarchical_library.dir/edge_creator.cpp.o
[ 19%] Building CXX object g2o/apps/g2o_hierarchical/CMakeFiles/g2o_hierarchical_library.dir/star.cpp.o
[ 20%] Building CXX object g2o/apps/g2o_hierarchical/CMakeFiles/g2o_hierarchical_library.dir/edge_types_cost_function.cpp.o
[ 20%] Building CXX object g2o/apps/g2o_hierarchical/CMakeFiles/g2o_hierarchical_library.dir/backbone_tree_action.cpp.o
[ 20%] Building CXX object g2o/apps/g2o_hierarchical/CMakeFiles/g2o_hierarchical_library.dir/simple_star_ops.cpp.o
[ 21%] Building CXX object g2o/apps/g2o_hierarchical/CMakeFiles/g2o_hierarchical_library.dir/g2o_hierarchical_test_functions.cpp.o
[ 21%] Linking CXX shared library ../../../../lib/libg2o_hierarchical.so
[ 21%] Built target g2o_hierarchical_library
Scanning dependencies of target types_slam3d
[ 21%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/dquat2mat.cpp.o
[ 22%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/isometry3d_mappings.cpp.o
[ 22%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/isometry3d_gradients.cpp.o
[ 23%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/vertex_se3.cpp.o
[ 23%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/parameter_se3_offset.cpp.o
[ 23%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/edge_se3.cpp.o
[ 24%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/edge_se3_offset.cpp.o
[ 24%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/vertex_pointxyz.cpp.o
[ 25%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/parameter_camera.cpp.o
[ 25%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/parameter_stereo_camera.cpp.o
[ 25%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/edge_se3_pointxyz.cpp.o
[ 26%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/edge_se3_pointxyz_disparity.cpp.o
[ 26%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/edge_se3_pointxyz_depth.cpp.o
[ 27%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/edge_se3_prior.cpp.o
[ 27%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/edge_se3_lotsofxyz.cpp.o
[ 27%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/edge_pointxyz.cpp.o
[ 28%] Building CXX object g2o/types/slam3d/CMakeFiles/types_slam3d.dir/types_slam3d.cpp.o
[ 28%] Linking CXX shared library ../../../../lib/libg2o_types_slam3d.so
[ 28%] Built target types_slam3d
Scanning dependencies of target g2o_hierarchical_application
[ 29%] Building CXX object g2o/apps/g2o_hierarchical/CMakeFiles/g2o_hierarchical_application.dir/g2o_hierarchical.cpp.o
[ 29%] Linking CXX executable ../../../../bin/g2o_hierarchical
[ 29%] Built target g2o_hierarchical_application
Scanning dependencies of target types_slam2d
[ 29%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2.cpp.o
[ 30%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_pointxy_calib.cpp.o
[ 30%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/types_slam2d.cpp.o
[ 30%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/vertex_point_xy.cpp.o
[ 31%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_pointxy.cpp.o
[ 31%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/vertex_se2.cpp.o
[ 32%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_pointxy_bearing.cpp.o
[ 32%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_prior.cpp.o
[ 32%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/parameter_se2_offset.cpp.o
[ 33%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_offset.cpp.o
[ 33%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_pointxy_offset.cpp.o
[ 34%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_xyprior.cpp.o
[ 34%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_pointxy.cpp.o
[ 34%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_twopointsxy.cpp.o
[ 35%] Building CXX object g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_lotsofxy.cpp.o
[ 35%] Linking CXX shared library ../../../../lib/libg2o_types_slam2d.so
[ 35%] Built target types_slam2d
Scanning dependencies of target types_slam3d_addons
[ 36%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/vertex_se3_euler.cpp.o
[ 36%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/edge_se3_euler.cpp.o
[ 36%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/vertex_plane.cpp.o
[ 37%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/edge_se3_plane_calib.cpp.o
[ 37%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/line3d.cpp.o
[ 38%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/vertex_line3d.cpp.o
[ 38%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/edge_se3_line.cpp.o
[ 38%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/edge_plane.cpp.o
[ 39%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/edge_se3_calib.cpp.o
[ 39%] Building CXX object g2o/types/slam3d_addons/CMakeFiles/types_slam3d_addons.dir/types_slam3d_addons.cpp.o
[ 40%] Linking CXX shared library ../../../../lib/libg2o_types_slam3d_addons.so
[ 40%] Built target types_slam3d_addons
Scanning dependencies of target types_slam2d_addons
[ 41%] Building CXX object g2o/types/slam2d_addons/CMakeFiles/types_slam2d_addons.dir/types_slam2d_addons.cpp.o
[ 41%] Building CXX object g2o/types/slam2d_addons/CMakeFiles/types_slam2d_addons.dir/vertex_segment2d.cpp.o
[ 41%] Building CXX object g2o/types/slam2d_addons/CMakeFiles/types_slam2d_addons.dir/edge_se2_segment2d.cpp.o
[ 42%] Building CXX object g2o/types/slam2d_addons/CMakeFiles/types_slam2d_addons.dir/edge_se2_segment2d_line.cpp.o
[ 42%] Building CXX object g2o/types/slam2d_addons/CMakeFiles/types_slam2d_addons.dir/edge_se2_segment2d_pointLine.cpp.o
[ 43%] Building CXX object g2o/types/slam2d_addons/CMakeFiles/types_slam2d_addons.dir/vertex_line2d.cpp.o
[ 43%] Building CXX object g2o/types/slam2d_addons/CMakeFiles/types_slam2d_addons.dir/edge_se2_line2d.cpp.o
[ 43%] Building CXX object g2o/types/slam2d_addons/CMakeFiles/types_slam2d_addons.dir/edge_line2d_pointxy.cpp.o
[ 44%] Building CXX object g2o/types/slam2d_addons/CMakeFiles/types_slam2d_addons.dir/edge_line2d.cpp.o
[ 44%] Linking CXX shared library ../../../../lib/libg2o_types_slam2d_addons.so
[ 44%] Built target types_slam2d_addons
Scanning dependencies of target g2o_simulator_library
[ 44%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/simulator.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.cpp:27:0:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 45%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/pointsensorparameters.cpp.o
[ 45%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_odometry2d.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_odometry2d.h:31,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_odometry2d.cpp:29:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 45%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_pose2d.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pose2d.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pose2d.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 46%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_pointxy.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxy.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxy.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 46%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_pointxy_bearing.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxy_bearing.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxy_bearing.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 47%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_pointxy_offset.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxy_offset.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxy_offset.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 47%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/simutils.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simutils.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simutils.cpp:1:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 47%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_segment2d.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_segment2d.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_segment2d.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 48%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_segment2d_line.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_segment2d_line.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_segment2d_line.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 48%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_segment2d_pointline.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_segment2d_pointline.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_segment2d_pointline.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 48%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_odometry3d.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator3d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_odometry3d.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_odometry3d.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 49%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_pose3d.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator3d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pose3d.h:29,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pose3d.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 49%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_pose3d_offset.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator3d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pose3d_offset.h:29,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pose3d_offset.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 50%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_pointxyz.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator3d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxyz.h:29,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxyz.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 50%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_pointxyz_disparity.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator3d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxyz_disparity.h:29,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxyz_disparity.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 50%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_pointxyz_depth.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator3d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxyz_depth.h:29,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_pointxyz_depth.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 51%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator_library.dir/sensor_se3_prior.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator3d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_se3_prior.h:29,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_se3_prior.cpp:27:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 51%] Linking CXX shared library ../../../../lib/libg2o_simulator.so
[ 51%] Built target g2o_simulator_library
Scanning dependencies of target g2o_simulator2d_application
[ 52%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator2d_application.dir/test_simulator2d.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/test_simulator2d.cpp:30:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 52%] Linking CXX executable ../../../../bin/g2o_simulator2d
[ 52%] Built target g2o_simulator2d_application
Scanning dependencies of target g2o_simulator3d_application
[ 52%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_simulator3d_application.dir/test_simulator3d.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator3d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/sensor_odometry3d.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator3d.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/test_simulator3d.cpp:30:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
 seWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                     ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 53%] Linking CXX executable ../../../../bin/g2o_simulator3d
[ 53%] Built target g2o_simulator3d_application
Scanning dependencies of target convertSegmentLine_application
[ 54%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/convertSegmentLine_application.dir/convertSegmentLine.cpp.o
In file included from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator2d_base.h:32:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simutils.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/convertSegmentLine.cpp:53:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::Robot<RobotPoseObject>::move(const PoseType&)’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:114:16: warning: invalid use of incomplete type ‘class g2o::World’
         world()->addWorldObject(po);
                ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h: In member function ‘virtual void g2o::BinarySensor<RobotType_, EdgeType_, WorldObjectType_>::sense()’:
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:58: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:245:90: warning: invalid use of incomplete type ‘class g2o::World’
       for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
     
                                                                                          ^~
/home/npuyin/Downloads/g2o-2017/g2o/apps/g2o_simulator/simulator.h:39:7: note: forward declaration of ‘class g2o::World’
 class World;
       ^~~~~
[ 54%] Linking CXX executable ../../../../bin/convertSegmentLine
[ 54%] Built target convertSegmentLine_application
Scanning dependencies of target g2o_anonymize_observations_application
[ 55%] Building CXX object g2o/apps/g2o_simulator/CMakeFiles/g2o_anonymize_observations_application.dir/g2o_anonymize_observations.cpp.o
[ 55%] Linking CXX executable ../../../../bin/g2o_anonymize_observations
[ 55%] Built target g2o_anonymize_observations_application
Scanning dependencies of target types_data
[ 56%] Building CXX object g2o/types/data/CMakeFiles/types_data.dir/types_data.cpp.o
[ 56%] Building CXX object g2o/types/data/CMakeFiles/types_data.dir/robot_data.cpp.o
[ 56%] Building CXX object g2o/types/data/CMakeFiles/types_data.dir/vertex_tag.cpp.o
[ 57%] Building CXX object g2o/types/data/CMakeFiles/types_data.dir/vertex_ellipse.cpp.o
[ 57%] Building CXX object g2o/types/data/CMakeFiles/types_data.dir/laser_parameters.cpp.o
[ 58%] Building CXX object g2o/types/data/CMakeFiles/types_data.dir/raw_laser.cpp.o
[ 58%] Building CXX object g2o/types/data/CMakeFiles/types_data.dir/robot_laser.cpp.o
[ 58%] Building CXX object g2o/types/data/CMakeFiles/types_data.dir/data_queue.cpp.o
[ 59%] Linking CXX shared library ../../../../lib/libg2o_types_data.so
[ 59%] Built target types_data
Scanning dependencies of target test_isometry3d_mappings
[ 59%] Building CXX object g2o/types/slam3d/CMakeFiles/test_isometry3d_mappings.dir/test_isometry3d_mappings.cpp.o
[ 60%] Linking CXX executable ../../../../bin/test_isometry3d_mappings
[ 60%] Built target test_isometry3d_mappings
Scanning dependencies of target test_mat2quat_jacobian
[ 60%] Building CXX object g2o/types/slam3d/CMakeFiles/test_mat2quat_jacobian.dir/test_mat2quat_jacobian.cpp.o
[ 60%] Linking CXX executable ../../../../bin/test_mat2quat_jacobian
[ 60%] Built target test_mat2quat_jacobian
Scanning dependencies of target test_slam3d_jacobian
[ 61%] Building CXX object g2o/types/slam3d/CMakeFiles/test_slam3d_jacobian.dir/test_slam3d_jacobian.cpp.o
[ 61%] Linking CXX executable ../../../../bin/test_slam3d_jacobian
[ 61%] Built target test_slam3d_jacobian
Scanning dependencies of target types_sba
[ 61%] Building CXX object g2o/types/sba/CMakeFiles/types_sba.dir/types_sba.cpp.o
In file included from /usr/local/include/eigen3/Eigen/Core:493:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/core/eigen_types.h:30,
                 from /home/npuyin/Downloads/g2o-2017/build/g2o/config.h:18,
                 from /home/npuyin/Downloads/g2o-2017/g2o/core/openmp_mutex.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/core/optimizable_graph.h:37,
                 from /home/npuyin/Downloads/g2o-2017/g2o/core/base_vertex.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/types/sba/types_sba.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/types/sba/types_sba.cpp:27:
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h: In member function ‘virtual void g2o::VertexCam::setToOriginImpl()’:
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:649:82: warning: ‘*((void*)&<anonymous> +160)’ is used uninitialized in this function [-Wuninitialized]
     res = pmul(lhs.template packet<LoadMode,Packet>(row, Index(0)), pset1<Packet>(rhs.coeff(Index(0), col)));
                                                                     ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:631:99: warning: ‘*((void*)&<anonymous> +168)’ is used uninitialized in this function [-Wuninitialized]
     res =  pmadd(lhs.template packet<LoadMode,Packet>(row, Index(UnrollingIndex-1)), pset1<Packet>(rhs.coeff(Index(UnrollingIndex-1), col)), res);
                                                                                      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:631:99: warning: ‘*((void*)&<anonymous> +176)’ is used uninitialized in this function [-Wuninitialized]
     res =  pmadd(lhs.template packet<LoadMode,Packet>(row, Index(UnrollingIndex-1)), pset1<Packet>(rhs.coeff(Index(UnrollingIndex-1), col)), res);
                                                                                      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:649:82: warning: ‘*((void*)&<anonymous> +184)’ is used uninitialized in this function [-Wuninitialized]
     res = pmul(lhs.template packet<LoadMode,Packet>(row, Index(0)), pset1<Packet>(rhs.coeff(Index(0), col)));
                                                                     ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:631:99: warning: ‘*((void*)&<anonymous> +192)’ is used uninitialized in this function [-Wuninitialized]
     res =  pmadd(lhs.template packet<LoadMode,Packet>(row, Index(UnrollingIndex-1)), pset1<Packet>(rhs.coeff(Index(UnrollingIndex-1), col)), res);
                                                                                      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:631:99: warning: ‘*((void*)&<anonymous> +200)’ is used uninitialized in this function [-Wuninitialized]
     res =  pmadd(lhs.template packet<LoadMode,Packet>(row, Index(UnrollingIndex-1)), pset1<Packet>(rhs.coeff(Index(UnrollingIndex-1), col)), res);
                                                                                      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:649:82: warning: ‘*((void*)&<anonymous> +208)’ is used uninitialized in this function [-Wuninitialized]
     res = pmul(lhs.template packet<LoadMode,Packet>(row, Index(0)), pset1<Packet>(rhs.coeff(Index(0), col)));
                                                                     ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:631:99: warning: ‘*((void*)&<anonymous> +216)’ is used uninitialized in this function [-Wuninitialized]
     res =  pmadd(lhs.template packet<LoadMode,Packet>(row, Index(UnrollingIndex-1)), pset1<Packet>(rhs.coeff(Index(UnrollingIndex-1), col)), res);
                                                                                      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:631:99: warning: ‘*((void*)&<anonymous> +224)’ is used uninitialized in this function [-Wuninitialized]
     res =  pmadd(lhs.template packet<LoadMode,Packet>(row, Index(UnrollingIndex-1)), pset1<Packet>(rhs.coeff(Index(UnrollingIndex-1), col)), res);
                                                                                      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:649:82: warning: ‘*((void*)&<anonymous> +232)’ is used uninitialized in this function [-Wuninitialized]
     res = pmul(lhs.template packet<LoadMode,Packet>(row, Index(0)), pset1<Packet>(rhs.coeff(Index(0), col)));
                                                                     ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:631:99: warning: ‘*((void*)&<anonymous> +240)’ is used uninitialized in this function [-Wuninitialized]
     res =  pmadd(lhs.template packet<LoadMode,Packet>(row, Index(UnrollingIndex-1)), pset1<Packet>(rhs.coeff(Index(UnrollingIndex-1), col)), res);
                                                                                      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/ProductEvaluators.h:631:99: warning: ‘*((void*)&<anonymous> +248)’ is used uninitialized in this function [-Wuninitialized]
     res =  pmadd(lhs.template packet<LoadMode,Packet>(row, Index(UnrollingIndex-1)), pset1<Packet>(rhs.coeff(Index(UnrollingIndex-1), col)), res);
                                                                                      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 61%] Building CXX object g2o/types/sba/CMakeFiles/types_sba.dir/types_six_dof_expmap.cpp.o
[ 62%] Linking CXX shared library ../../../../lib/libg2o_types_sba.so
[ 62%] Built target types_sba
Scanning dependencies of target types_sim3
[ 62%] Building CXX object g2o/types/sim3/CMakeFiles/types_sim3.dir/types_seven_dof_expmap.cpp.o
[ 63%] Linking CXX shared library ../../../../lib/libg2o_types_sim3.so
[ 63%] Built target types_sim3
Scanning dependencies of target types_icp
[ 63%] Building CXX object g2o/types/icp/CMakeFiles/types_icp.dir/types_icp.cpp.o
[ 64%] Linking CXX shared library ../../../../lib/libg2o_types_icp.so
[ 64%] Built target types_icp
Scanning dependencies of target types_sclam2d
[ 64%] Building CXX object g2o/types/sclam2d/CMakeFiles/types_sclam2d.dir/edge_se2_sensor_calib.cpp.o
[ 64%] Building CXX object g2o/types/sclam2d/CMakeFiles/types_sclam2d.dir/vertex_odom_differential_params.cpp.o
[ 65%] Building CXX object g2o/types/sclam2d/CMakeFiles/types_sclam2d.dir/edge_se2_odom_differential_calib.cpp.o
[ 65%] Building CXX object g2o/types/sclam2d/CMakeFiles/types_sclam2d.dir/odometry_measurement.cpp.o
[ 66%] Building CXX object g2o/types/sclam2d/CMakeFiles/types_sclam2d.dir/types_sclam2d.cpp.o
[ 66%] Linking CXX shared library ../../../../lib/libg2o_types_sclam2d.so
[ 66%] Built target types_sclam2d
Scanning dependencies of target solver_pcg
[ 67%] Building CXX object g2o/solvers/pcg/CMakeFiles/solver_pcg.dir/solver_pcg.cpp.o
[ 67%] Linking CXX shared library ../../../../lib/libg2o_solver_pcg.so
[ 67%] Built target solver_pcg
Scanning dependencies of target solver_dense
[ 67%] Building CXX object g2o/solvers/dense/CMakeFiles/solver_dense.dir/solver_dense.cpp.o
[ 68%] Linking CXX shared library ../../../../lib/libg2o_solver_dense.so
[ 68%] Built target solver_dense
Scanning dependencies of target solver_structure_only
[ 69%] Building CXX object g2o/solvers/structure_only/CMakeFiles/solver_structure_only.dir/structure_only.cpp.o
[ 69%] Linking CXX shared library ../../../../lib/libg2o_solver_structure_only.so
[ 69%] Built target solver_structure_only
Scanning dependencies of target csparse_extension
[ 69%] Building CXX object g2o/solvers/csparse/CMakeFiles/csparse_extension.dir/csparse_helper.cpp.o
[ 70%] Linking CXX shared library ../../../../lib/libg2o_csparse_extension.so
[ 70%] Built target csparse_extension
Scanning dependencies of target solver_csparse
[ 70%] Building CXX object g2o/solvers/csparse/CMakeFiles/solver_csparse.dir/solver_csparse.cpp.o
[ 71%] Linking CXX shared library ../../../../lib/libg2o_solver_csparse.so
[ 71%] Built target solver_csparse
Scanning dependencies of target solver_slam2d_linear
[ 72%] Building CXX object g2o/solvers/slam2d_linear/CMakeFiles/solver_slam2d_linear.dir/slam2d_linear.cpp.o
[ 72%] Building CXX object g2o/solvers/slam2d_linear/CMakeFiles/solver_slam2d_linear.dir/solver_slam2d_linear.cpp.o
[ 72%] Linking CXX shared library ../../../../lib/libg2o_solver_slam2d_linear.so
[ 72%] Built target solver_slam2d_linear
Scanning dependencies of target solver_cholmod
[ 73%] Building CXX object g2o/solvers/cholmod/CMakeFiles/solver_cholmod.dir/solver_cholmod.cpp.o
[ 73%] Linking CXX shared library ../../../../lib/libg2o_solver_cholmod.so
[ 73%] Built target solver_cholmod
Scanning dependencies of target solver_eigen
[ 73%] Building CXX object g2o/solvers/eigen/CMakeFiles/solver_eigen.dir/solver_eigen.cpp.o
[ 73%] Linking CXX shared library ../../../../lib/libg2o_solver_eigen.so
[ 73%] Built target solver_eigen
Scanning dependencies of target curve_fit
[ 73%] Building CXX object g2o/examples/data_fitting/CMakeFiles/curve_fit.dir/curve_fit.cpp.o
[ 74%] Linking CXX executable ../../../../bin/curve_fit
[ 74%] Built target curve_fit
Scanning dependencies of target circle_fit
[ 74%] Building CXX object g2o/examples/data_fitting/CMakeFiles/circle_fit.dir/circle_fit.cpp.o
[ 75%] Linking CXX executable ../../../../bin/circle_fit
[ 75%] Built target circle_fit
Scanning dependencies of target create_sphere
[ 76%] Building CXX object g2o/examples/sphere/CMakeFiles/create_sphere.dir/create_sphere.cpp.o
[ 76%] Linking CXX executable ../../../../bin/create_sphere
[ 76%] Built target create_sphere
Scanning dependencies of target constant_velocity_target
[ 76%] Building CXX object g2o/examples/target/CMakeFiles/constant_velocity_target.dir/constant_velocity_target.cpp.o
[ 76%] Linking CXX executable ../../../../bin/constant_velocity_target
[ 76%] Built target constant_velocity_target
Scanning dependencies of target static_target
[ 77%] Building CXX object g2o/examples/target/CMakeFiles/static_target.dir/static_target.cpp.o
[ 77%] Linking CXX executable ../../../../bin/static_target
[ 77%] Built target static_target
Scanning dependencies of target ba_demo
[ 78%] Building CXX object g2o/examples/ba/CMakeFiles/ba_demo.dir/ba_demo.cpp.o
[ 78%] Linking CXX executable ../../../../bin/ba_demo
[ 78%] Built target ba_demo
Scanning dependencies of target ba_anchored_inverse_depth_demo
[ 78%] Building CXX object g2o/examples/ba_anchored_inverse_depth/CMakeFiles/ba_anchored_inverse_depth_demo.dir/ba_anchored_inverse_depth_demo.cpp.o
[ 78%] Linking CXX executable ../../../../bin/ba_anchored_inverse_depth_demo
[ 78%] Built target ba_anchored_inverse_depth_demo
Scanning dependencies of target tutorial_slam2d_library
[ 78%] Building CXX object g2o/examples/tutorial_slam2d/CMakeFiles/tutorial_slam2d_library.dir/edge_se2_pointxy.cpp.o
[ 79%] Building CXX object g2o/examples/tutorial_slam2d/CMakeFiles/tutorial_slam2d_library.dir/edge_se2.cpp.o
[ 79%] Building CXX object g2o/examples/tutorial_slam2d/CMakeFiles/tutorial_slam2d_library.dir/vertex_se2.cpp.o
[ 80%] Building CXX object g2o/examples/tutorial_slam2d/CMakeFiles/tutorial_slam2d_library.dir/vertex_point_xy.cpp.o
[ 80%] Building CXX object g2o/examples/tutorial_slam2d/CMakeFiles/tutorial_slam2d_library.dir/parameter_se2_offset.cpp.o
[ 80%] Building CXX object g2o/examples/tutorial_slam2d/CMakeFiles/tutorial_slam2d_library.dir/types_tutorial_slam2d.cpp.o
[ 81%] Building CXX object g2o/examples/tutorial_slam2d/CMakeFiles/tutorial_slam2d_library.dir/simulator.cpp.o
In file included from /usr/local/include/eigen3/Eigen/Core:450:0,
                 from /home/npuyin/Downloads/g2o-2017/g2o/core/eigen_types.h:30,
                 from /home/npuyin/Downloads/g2o-2017/build/g2o/config.h:18,
                 from /home/npuyin/Downloads/g2o-2017/g2o/examples/tutorial_slam2d/g2o_tutorial_slam2d_api.h:13,
                 from /home/npuyin/Downloads/g2o-2017/g2o/examples/tutorial_slam2d/se2.h:33,
                 from /home/npuyin/Downloads/g2o-2017/g2o/examples/tutorial_slam2d/simulator.h:30,
                 from /home/npuyin/Downloads/g2o-2017/g2o/examples/tutorial_slam2d/simulator.cpp:27:
/usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h: In member function ‘void g2o::tutorial::Simulator::simulate(int, const g2o::tutorial::SE2&)’:
/usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h:194:66: warning: ‘*((void*)(&<anonymous>)+80).Eigen::DenseStorage<double, 9, 3, 3, 0>::m_data’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     DenseStorage(const DenseStorage& other) : m_data(other.m_data) {
     
                                                                  ^
/usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h:194:66: warning: ‘*((void*)(&<anonymous>)+16).Eigen::DenseStorage<double, 2, 2, 1, 0>::m_data’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     DenseStorage(const DenseStorage& other) : m_data(other.m_data) {
     
                                                                  ^
/usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h:194:66: warning: ‘*((void*)(&<anonymous>)+64).Eigen::DenseStorage<double, 4, 2, 2, 0>::m_data’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     DenseStorage(const DenseStorage& other) : m_data(other.m_data) {
     
                                                                  ^
[ 81%] Linking CXX shared library ../../../../lib/libg2o_tutorial_slam2d.so
[ 81%] Built target tutorial_slam2d_library
Scanning dependencies of target tutorial_slam2d
[ 82%] Building CXX object g2o/examples/tutorial_slam2d/CMakeFiles/tutorial_slam2d.dir/tutorial_slam2d.cpp.o
[ 82%] Linking CXX executable ../../../../bin/tutorial_slam2d
[ 82%] Built target tutorial_slam2d
Scanning dependencies of target gicp_demo
[ 83%] Building CXX object g2o/examples/icp/CMakeFiles/gicp_demo.dir/gicp_demo.cpp.o
[ 83%] Linking CXX executable ../../../../bin/gicp_demo
[ 83%] Built target gicp_demo
Scanning dependencies of target gicp_sba_demo
[ 83%] Building CXX object g2o/examples/icp/CMakeFiles/gicp_sba_demo.dir/gicp_sba_demo.cpp.o
[ 84%] Linking CXX executable ../../../../bin/gicp_sba_demo
[ 84%] Built target gicp_sba_demo
Scanning dependencies of target calibration_odom_laser_library
[ 84%] Building CXX object g2o/examples/calibration_odom_laser/CMakeFiles/calibration_odom_laser_library.dir/gm2dl_io.cpp.o
[ 85%] Building CXX object g2o/examples/calibration_odom_laser/CMakeFiles/calibration_odom_laser_library.dir/sclam_helpers.cpp.o
[ 85%] Building CXX object g2o/examples/calibration_odom_laser/CMakeFiles/calibration_odom_laser_library.dir/edge_se2_pure_calib.cpp.o
[ 85%] Building CXX object g2o/examples/calibration_odom_laser/CMakeFiles/calibration_odom_laser_library.dir/closed_form_calibration.cpp.o
[ 86%] Linking CXX shared library ../../../../lib/libg2o_calibration_odom_laser.so
[ 86%] Built target calibration_odom_laser_library
Scanning dependencies of target sclam_laser_calib
[ 86%] Building CXX object g2o/examples/calibration_odom_laser/CMakeFiles/sclam_laser_calib.dir/sclam_laser_calib.cpp.o
[ 86%] Linking CXX executable ../../../../bin/sclam_laser_calib
[ 86%] Built target sclam_laser_calib
Scanning dependencies of target sclam_odom_laser
[ 87%] Building CXX object g2o/examples/calibration_odom_laser/CMakeFiles/sclam_odom_laser.dir/sclam_odom_laser.cpp.o
[ 87%] Linking CXX executable ../../../../bin/sclam_odom_laser
[ 87%] Built target sclam_odom_laser
Scanning dependencies of target sclam_pure_calibration
[ 88%] Building CXX object g2o/examples/calibration_odom_laser/CMakeFiles/sclam_pure_calibration.dir/sclam_pure_calibration.cpp.o
[ 88%] Linking CXX executable ../../../../bin/sclam_pure_calibration
[ 88%] Built target sclam_pure_calibration
Scanning dependencies of target simple_optimize
[ 88%] Building CXX object g2o/examples/simple_optimize/CMakeFiles/simple_optimize.dir/simple_optimize.cpp.o
[ 89%] Linking CXX executable ../../../../bin/simple_optimize
[ 89%] Built target simple_optimize
Scanning dependencies of target simulator_3d_plane
[ 90%] Building CXX object g2o/examples/plane_slam/CMakeFiles/simulator_3d_plane.dir/simulator_3d_plane.cpp.o
/home/npuyin/Downloads/g2o-2017/g2o/examples/plane_slam/simulator_3d_plane.cpp: In function ‘int main(int, char**)’:
/home/npuyin/Downloads/g2o-2017/g2o/examples/plane_slam/simulator_3d_plane.cpp:307:23: warning: ‘new’ of type ‘Robot’ with extended alignment 32 [-Waligned-new=]
   Robot* r=new Robot(g);
                       ^
/home/npuyin/Downloads/g2o-2017/g2o/examples/plane_slam/simulator_3d_plane.cpp:307:23: note: uses ‘void* operator new(std::size_t)’, which does not have an alignment parameter
/home/npuyin/Downloads/g2o-2017/g2o/examples/plane_slam/simulator_3d_plane.cpp:307:23: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
[ 90%] Linking CXX executable ../../../../bin/simulator_3d_plane
[ 90%] Built target simulator_3d_plane
Scanning dependencies of target simulator_3d_line
[ 90%] Building CXX object g2o/examples/line_slam/CMakeFiles/simulator_3d_line.dir/simulator_3d_line.cpp.o
/home/npuyin/Downloads/g2o-2017/g2o/examples/line_slam/simulator_3d_line.cpp: In function ‘int main(int, char**)’:
/home/npuyin/Downloads/g2o-2017/g2o/examples/line_slam/simulator_3d_line.cpp:294:25: warning: ‘new’ of type ‘Robot’ with extended alignment 32 [-Waligned-new=]
   Robot* r = new Robot(g);
                         ^
/home/npuyin/Downloads/g2o-2017/g2o/examples/line_slam/simulator_3d_line.cpp:294:25: note: uses ‘void* operator new(std::size_t)’, which does not have an alignment parameter
/home/npuyin/Downloads/g2o-2017/g2o/examples/line_slam/simulator_3d_line.cpp:294:25: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
/home/npuyin/Downloads/g2o-2017/g2o/examples/line_slam/simulator_3d_line.cpp:298:51: warning: ‘new’ of type ‘LineSensor’ with extended alignment 32 [-Waligned-new=]
   LineSensor* ls = new LineSensor(r, 0, sensorPose);
                                                   ^
/home/npuyin/Downloads/g2o-2017/g2o/examples/line_slam/simulator_3d_line.cpp:298:51: note: uses ‘void* operator new(std::size_t)’, which does not have an alignment parameter
/home/npuyin/Downloads/g2o-2017/g2o/examples/line_slam/simulator_3d_line.cpp:298:51: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
[ 90%] Linking CXX executable ../../../../bin/simulator_3d_line
[ 90%] Built target simulator_3d_line
Scanning dependencies of target sba_demo
[ 90%] Building CXX object g2o/examples/sba/CMakeFiles/sba_demo.dir/sba_demo.cpp.o
[ 91%] Linking CXX executable ../../../../bin/sba_demo
[ 91%] Built target sba_demo
Scanning dependencies of target bal_example
[ 91%] Building CXX object g2o/examples/bal/CMakeFiles/bal_example.dir/bal_example.cpp.o
[ 92%] Linking CXX executable ../../../../bin/bal_example
[ 92%] Built target bal_example
Scanning dependencies of target convert_sba_slam3d
[ 93%] Building CXX object g2o/examples/data_convert/CMakeFiles/convert_sba_slam3d.dir/convert_sba_slam3d.cpp.o
[ 93%] Linking CXX executable ../../../../bin/convert_sba_slam3d
[ 93%] Built target convert_sba_slam3d
Scanning dependencies of target parser_library
[ 93%] Building CXX object g2o/examples/interactive_slam/slam_parser/parser/CMakeFiles/parser_library.dir/slam_context.cpp.o
[ 94%] Building CXX object g2o/examples/interactive_slam/slam_parser/parser/CMakeFiles/parser_library.dir/bison_parser.cpp.o
[ 94%] Building CXX object g2o/examples/interactive_slam/slam_parser/parser/CMakeFiles/parser_library.dir/driver.cpp.o
[ 94%] Building CXX object g2o/examples/interactive_slam/slam_parser/parser/CMakeFiles/parser_library.dir/flex_scanner.cpp.o
[ 95%] Linking CXX shared library ../../../../../../lib/libg2o_parser.so
[ 95%] Built target parser_library
Scanning dependencies of target interface_library
[ 95%] Building CXX object g2o/examples/interactive_slam/slam_parser/interface/CMakeFiles/interface_library.dir/parser_interface.cpp.o
[ 96%] Building CXX object g2o/examples/interactive_slam/slam_parser/interface/CMakeFiles/interface_library.dir/slam_context_interface.cpp.o
[ 96%] Linking CXX shared library ../../../../../../lib/libg2o_interface.so
[ 96%] Built target interface_library
Scanning dependencies of target g2o_interactive_library
[ 96%] Building CXX object g2o/examples/interactive_slam/g2o_interactive/CMakeFiles/g2o_interactive_library.dir/g2o_slam_interface.cpp.o
[ 97%] Building CXX object g2o/examples/interactive_slam/g2o_interactive/CMakeFiles/g2o_interactive_library.dir/graph_optimizer_sparse_online.cpp.o
[ 97%] Building CXX object g2o/examples/interactive_slam/g2o_interactive/CMakeFiles/g2o_interactive_library.dir/types_online.cpp.o
[ 97%] Linking CXX shared library ../../../../../lib/libg2o_interactive.so
[ 97%] Built target g2o_interactive_library
Scanning dependencies of target g2o_online_application
[ 98%] Building CXX object g2o/examples/interactive_slam/g2o_interactive/CMakeFiles/g2o_online_application.dir/g2o_online.cpp.o
[ 98%] Linking CXX executable ../../../../../bin/g2o_online
[ 98%] Built target g2o_online_application
Scanning dependencies of target g2o_incremental_library
[ 98%] Building CXX object g2o/examples/interactive_slam/g2o_incremental/CMakeFiles/g2o_incremental_library.dir/graph_optimizer_sparse_incremental.cpp.o
[ 99%] Linking CXX shared library ../../../../../lib/libg2o_incremental.so
[ 99%] Built target g2o_incremental_library
Scanning dependencies of target g2o_incremental_application
[100%] Building CXX object g2o/examples/interactive_slam/g2o_incremental/CMakeFiles/g2o_incremental_application.dir/g2o_incremental.cpp.o
[100%] Linking CXX executable ../../../../../bin/g2o_incremental
[100%] Built target g2o_incremental_application

2. **使用G2O编译ch7的内容

2.1 直接编译

进入~/slambook/ch7/build中,清除原来的cmake文件,然后重新cmake。

rm -rf *
cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenCV: /usr/local/opencv/opencv-3.4.6 (found suitable version "3.4.6", minimum required is "3.1") 
-- Found CSPARSE: /usr/include/suitesparse  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/npuyin/slambook/ch7/build

然后make,出现下述提示:

npuyin@U303L:~/slambook/ch7/build$ make
Scanning dependencies of target pose_estimation_2d2d
[ 10%] Building CXX object CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o
[ 20%] Linking CXX executable pose_estimation_2d2d
[ 20%] Built target pose_estimation_2d2d
Scanning dependencies of target pose_estimation_3d2d
[ 30%] Building CXX object CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o
/home/npuyin/slambook/ch7/pose_estimation_3d2d.cpp:8:10: fatal error: g2o/core/base_vertex.h: No such file or directory
 #include 
          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/pose_estimation_3d2d.dir/build.make:62: recipe for target 'CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o' failed
make[2]: *** [CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/pose_estimation_3d2d.dir/all' failed
make[1]: *** [CMakeFiles/pose_estimation_3d2d.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

这个奇葩的问题,显然是cmake在编译的时候,没有找到合适的头文件——因为我的g2o没有安装在默认目录 /usr/local下。
所以,需要更改CMakeLists.txt内的g2o的路径。

2.2 更改CMakeLists.txt的g2o路径

打开~/slambook/ch7/CMakeLists.txt,进行编辑。

# list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )
# 指定g2o的版本路径
list( APPEND CMAKE_MODULE_PATH ~/Downloads/g2o-2017/cmake_modules )
set( G2O_ROOT /usr/local/g2o )
set( G2O_INCLUDE_DIRS /usr/local/g2o/include )

然后,重新编译。

npuyin@U303L:~/slambook/ch7/build$ rm -rf *
npuyin@U303L:~/slambook/ch7/build$ cmake ..
npuyin@U303L:~/slambook/ch7/build$ make

结果日志如下,原来的错误消失了,但是又出现的新的错误。

npuyin@U303L:~/slambook/ch7/build$ rm -rf *
npuyin@U303L:~/slambook/ch7/build$ cmake ..
npuyin@U303L:~/slambook/ch7/build$ make
Scanning dependencies of target pose_estimation_2d2d
[ 10%] Building CXX object CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o
[ 20%] Linking CXX executable pose_estimation_2d2d
[ 20%] Built target pose_estimation_2d2d
Scanning dependencies of target pose_estimation_3d2d
[ 30%] Building CXX object CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o
[ 40%] Linking CXX executable pose_estimation_3d2d
/usr/bin/ld: cannot find -lg2o_core
/usr/bin/ld: cannot find -lg2o_stuff
/usr/bin/ld: cannot find -lg2o_types_sba
/usr/bin/ld: cannot find -lg2o_csparse_extension
collect2: error: ld returned 1 exit status
CMakeFiles/pose_estimation_3d2d.dir/build.make:138: recipe for target 'pose_estimation_3d2d' failed
make[2]: *** [pose_estimation_3d2d] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/pose_estimation_3d2d.dir/all' failed
make[1]: *** [CMakeFiles/pose_estimation_3d2d.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

2.3 建立缺失的软链接

参考文章Linux提示 /usr/bin/ld:cannot find-lxxx 系列解决方法
https://blog.csdn.net/qq_39584315/article/details/79724038。
会发生这样的原因是:
3. lib(.so档)的symbolic link不正确,没有连结到正确的函式库文件(.so)
一般把xx.so文件链接到相应的目录下:
使用
以libg2o_core.so为例,在系统中查找该文件。
命令为:
locate libg2o_core.so
结果显示如下:

npuyin@U303L:/usr/lib$ locate libg2o_core.so
/home/npuyin/slambook/3rdparty/g2o/lib/libg2o_core.so
/usr/local/lib/libg2o_core.so

进入/usr/local/lib查找结果
可以看到,有libg2o_core.so文件存在,但是没有libg2o_core.so文件,因此我们在/usr/local/lib目录中新建一个libg2o_core.so的软连接,使其链接到已有的libg2o_core.so文件。

sudo ln -s /usr/local/g2o/lib/libg2o_core.so libg2o_core.so

其余的文件也做相同的操作。

sudo ln -s /usr/local/g2o/lib/libg2o_stuff.so libg2o_stuff.so
sudo ln -s /usr/local/g2o/lib/libg2o_core.so libg2o_core.so
sudo ln -s /usr/local/g2o/lib/libg2o_types_sba.so libg2o_types_sba.so
sudo ln -s /usr/local/g2o/lib/libg2o_csparse_extension.so libg2o_csparse_extension.so

完成后查看下所有libg2o_*.so文件

/usr/local/lib $ ll libg2o_*.so
lrwxrwxrwx  1 root root       33 Jan  7 21:34 libg2o_core.so -> /usr/local/g2o/lib/libg2o_core.so
lrwxrwxrwx  1 root root       46 Jan  7 21:35 libg2o_csparse_extension.so -> /usr/local/g2o/lib/libg2o_csparse_extension.so
lrwxrwxrwx  1 root root       34 Jan  7 21:34 libg2o_stuff.so -> /usr/local/g2o/lib/libg2o_stuff.so
lrwxrwxrwx  1 root root       38 Jan  7 21:34 libg2o_types_sba.so -> /usr/local/g2o/lib/libg2o_types_sba.so

然后,重新编译。

npuyin@U303L:~/slambook/ch7/build$ rm -rf *
npuyin@U303L:~/slambook/ch7/build$ cmake ..
npuyin@U303L:~/slambook/ch7/build$ make

结果日志如下,原来的错误消失了,但是又出现的新的错误。

2.4 回到原点

转了一圈,结果发现还是老问题。

Scanning dependencies of target pose_estimation_2d2d
[ 10%] Building CXX object CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o
[ 20%] Linking CXX executable pose_estimation_2d2d
[ 20%] Built target pose_estimation_2d2d
Scanning dependencies of target pose_estimation_3d2d
[ 30%] Building CXX object CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o
[ 40%] Linking CXX executable pose_estimation_3d2d
CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o: In function `g2o::LinearSolverCSparse<Eigen::Matrix<double, 6, 6, 0, 6, 6> >::solvePattern(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, std::__debug::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > const&, g2o::SparseBlockMatrix<Eigen::Matrix<double, 6, 6, 0, 6, 6> > const&)':
pose_estimation_3d2d.cpp:(.text._ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi6ELi6ELi0ELi6ELi6EEEE12solvePatternERNS_17SparseBlockMatrixINS2_IdLin1ELin1ELi0ELin1ELin1EEEEERKNSt7__debug6vectorISt4pairIiiESaISC_EEERKNS5_IS3_EE[_ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi6ELi6ELi0ELi6ELi6EEEE12solvePatternERNS_17SparseBlockMatrixINS2_IdLin1ELin1ELi0ELin1ELin1EEEEERKNSt7__debug6vectorISt4pairIiiESaISC_EEERKNS5_IS3_EE]+0x130): undefined reference to `g2o::MarginalCovarianceCholesky::computeCovariance(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, std::__debug::vector<int, std::allocator<int> > const&, std::__debug::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > const&)'
CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o: In function `g2o::LinearSolverCSparse<Eigen::Matrix<double, 6, 6, 0, 6, 6> >::solveBlocks(double**&, g2o::SparseBlockMatrix<Eigen::Matrix<double, 6, 6, 0, 6, 6> > const&)':
pose_estimation_3d2d.cpp:(.text._ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi6ELi6ELi0ELi6ELi6EEEE11solveBlocksERPPdRKNS_17SparseBlockMatrixIS3_EE[_ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi6ELi6ELi0ELi6ELi6EEEE11solveBlocksERPPdRKNS_17SparseBlockMatrixIS3_EE]+0x151): undefined reference to `g2o::MarginalCovarianceCholesky::computeCovariance(double**, std::__debug::vector > const&)'
collect2: error: ld returned 1 exit status
CMakeFiles/pose_estimation_3d2d.dir/build.make:138: recipe for target 'pose_estimation_3d2d' failed
make[2]: *** [pose_estimation_3d2d] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/pose_estimation_3d2d.dir/all' failed
make[1]: *** [CMakeFiles/pose_estimation_3d2d.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

还是绕到了老路上头。哭……

你可能感兴趣的:(VSLAM,环境配置,环境配置,ubuntu,linux,cmake)