g2o学习记录(1)安装和运行其下面的unit_test项目

前言

  最近对新版本的g2o进行学习,相关的安装我这里就稍微说一下,以作记录,最主要的倒是它的unit_test的那个项目测试,调试得我真的是一言难尽,最后才调试出来,但是在其中一部分的调试并运行中,感觉是自己的处理有问题,或者原g2o就没处理好。这部分只能一个个的改,需要一定的权限,这就是真的尴尬的局面了。
  我是在2018年12月21日进行的安装,晚上开始进行unit_test的代码查阅,主要是想看看新版本的g2o是如何操作的,因为新版本采用了c++11标准,有些地方甚至使用了move()函数进行右值引用部分的使用。
  我进行安装的版本号是"b226dcb" 。而以前的旧版本大概可以说和slam十四讲和ORB-SLAM2所给出的g2o版本一致,事实上他们两属于哪个版本我也不清楚,这个版本比较旧,所以对于slam十四讲中的g2o,大致只是让你能了解一下g2o的使用方式,对于新版本倒是不能照搬过来。我打算试试新版本的g2o,我在项目中使用了先使用g2o的旧版本,到时候再换成新版本。

安装

依赖项

  按照新版本的g2o的CMakelist.txt文件,应该需要这么安装。

git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
sudo apt-get install cmake libeigen3-dev
sudo apt-get install libsuitesparse-dev qtdeclarative5-dev qt5-qmake libqglviewer-dev libcholmod3.0.6 liblapack-dev libblas-dev
mkdir build
cd build
cmake ..
make
sudo make install

  最后输出安装的这些信息,请注意,这些信息才是最主要的信息!!!!因为它涉及到后面修改unit_test的依赖库链接时候的修改

-- Install configuration: "Release"
-- Installing: /usr/local/include/g2o/config.h
-- Installing: /usr/local/lib/cmake/g2o/g2oConfig.cmake
-- Installing: /usr/local/lib/cmake/g2o/g2oConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/g2o/g2oTargets.cmake
-- Installing: /usr/local/lib/cmake/g2o/g2oTargets-release.cmake
-- Installing: /usr/local/lib/libg2o_ext_freeglut_minimal.so
-- Installing: /usr/local/include/g2o/freeglut/freeglut_minimal.h
-- Installing: /usr/local/lib/libdf -lh.so
-- Installing: /usr/local/lib/libg2o_opengl_helper.so
-- Installing: /usr/local/include/g2o/stuff/macros.h
-- Installing: /usr/local/include/g2o/stuff/scoped_pointer.h
-- Installing: /usr/local/include/g2o/stuff/os_specific.h
-- Installing: /usr/local/include/g2o/stuff/g2o_stuff_api.h
-- Installing: /usr/local/include/g2o/stuff/sampler.h
-- Installing: /usr/local/include/g2o/stuff/string_tools.h
-- Installing: /usr/local/include/g2o/stuff/misc.h
-- Installing: /usr/local/include/g2o/stuff/unscented.h
-- Installing: /usr/local/include/g2o/stuff/command_args.h
-- Installing: /usr/local/include/g2o/stuff/sparse_helper.h
-- Installing: /usr/local/include/g2o/stuff/timeutil.h
-- Installing: /usr/local/include/g2o/stuff/tictoc.h
-- Installing: /usr/local/include/g2o/stuff/filesys_tools.h
-- Installing: /usr/local/include/g2o/stuff/opengl_wrapper.h
-- Installing: /usr/local/include/g2o/stuff/color_macros.h
-- Installing: /usr/local/include/g2o/stuff/property.h
-- Installing: /usr/local/include/g2o/stuff/opengl_primitives.h
-- Installing: /usr/local/lib/libg2o_core.so
-- Set runtime path of "/usr/local/lib/libg2o_core.so" to ""
-- Installing: /usr/local/include/g2o/core/batch_stats.h
-- Installing: /usr/local/include/g2o/core/optimization_algorithm_gauss_newton.h
-- Installing: /usr/local/include/g2o/core/sparse_block_matrix_ccs.h
-- Installing: /usr/local/include/g2o/core/eigen_types.h
-- Installing: /usr/local/include/g2o/core/sparse_optimizer_terminate_action.h
-- Installing: /usr/local/include/g2o/core/sparse_block_matrix.h
-- Installing: /usr/local/include/g2o/core/ownership.h
-- Installing: /usr/local/include/g2o/core/hyper_graph_action.h
-- Installing: /usr/local/include/g2o/core/base_vertex.h
-- Installing: /usr/local/include/g2o/core/linear_solver.h
-- Installing: /usr/local/include/g2o/core/factory.h
-- Installing: /usr/local/include/g2o/core/base_edge.h
-- Installing: /usr/local/include/g2o/core/cache.h
-- Installing: /usr/local/include/g2o/core/sparse_optimizer.h
-- Installing: /usr/local/include/g2o/core/optimization_algorithm.h
-- Installing: /usr/local/include/g2o/core/base_multi_edge.h
-- Installing: /usr/local/include/g2o/core/optimization_algorithm_levenberg.h
-- Installing: /usr/local/include/g2o/core/hyper_dijkstra.h
-- Installing: /usr/local/include/g2o/core/jacobian_workspace.h
-- Installing: /usr/local/include/g2o/core/sparse_block_matrix_diagonal.h
-- Installing: /usr/local/include/g2o/core/estimate_propagator.h
-- Installing: /usr/local/include/g2o/core/openmp_mutex.h
-- Installing: /usr/local/include/g2o/core/robust_kernel.h
-- Installing: /usr/local/include/g2o/core/robust_kernel_factory.h
-- Installing: /usr/local/include/g2o/core/optimization_algorithm_property.h
-- Installing: /usr/local/include/g2o/core/g2o_core_api.h
-- Installing: /usr/local/include/g2o/core/marginal_covariance_cholesky.h
-- Installing: /usr/local/include/g2o/core/optimizable_graph.h
-- Installing: /usr/local/include/g2o/core/matrix_structure.h
-- Installing: /usr/local/include/g2o/core/solver.h
-- Installing: /usr/local/include/g2o/core/block_solver.h
-- Installing: /usr/local/include/g2o/core/hyper_graph.h
-- Installing: /usr/local/include/g2o/core/optimization_algorithm_dogleg.h
-- Installing: /usr/local/include/g2o/core/robust_kernel_impl.h
-- Installing: /usr/local/include/g2o/core/base_binary_edge.h
-- Installing: /usr/local/include/g2o/core/matrix_operations.h
-- Installing: /usr/local/include/g2o/core/parameter_container.h
-- Installing: /usr/local/include/g2o/core/base_unary_edge.h
-- Installing: /usr/local/include/g2o/core/creators.h
-- Installing: /usr/local/include/g2o/core/parameter.h
-- Installing: /usr/local/include/g2o/core/optimization_algorithm_factory.h
-- Installing: /usr/local/include/g2o/core/optimization_algorithm_with_hessian.h
-- Installing: /usr/local/include/g2o/core/base_binary_edge.hpp
-- Installing: /usr/local/include/g2o/core/base_unary_edge.hpp
-- Installing: /usr/local/include/g2o/core/base_multi_edge.hpp
-- Installing: /usr/local/include/g2o/core/base_vertex.hpp
-- Installing: /usr/local/include/g2o/core/block_solver.hpp
-- Installing: /usr/local/include/g2o/core/dynamic_aligned_buffer.hpp
-- Installing: /usr/local/include/g2o/core/sparse_block_matrix.hpp
-- Installing: /usr/local/lib/libg2o_cli.so
-- Set runtime path of "/usr/local/lib/libg2o_cli.so" to ""
-- Installing: /usr/local/bin/g2o
-- Set runtime path of "/usr/local/bin/g2o" to ""
-- Installing: /usr/local/include/g2o/apps/g2o_cli/g2o_cli_api.h
-- Installing: /usr/local/include/g2o/apps/g2o_cli/dl_wrapper.h
-- Installing: /usr/local/include/g2o/apps/g2o_cli/g2o_common.h
-- Installing: /usr/local/include/g2o/apps/g2o_cli/output_helper.h
-- Installing: /usr/local/lib/libg2o_hierarchical.so
-- Set runtime path of "/usr/local/lib/libg2o_hierarchical.so" to ""
-- Installing: /usr/local/include/g2o/apps/g2o_hierarchical/edge_types_cost_function.h
-- Installing: /usr/local/include/g2o/apps/g2o_hierarchical/simple_star_ops.h
-- Installing: /usr/local/include/g2o/apps/g2o_hierarchical/star.h
-- Installing: /usr/local/include/g2o/apps/g2o_hierarchical/backbone_tree_action.h
-- Installing: /usr/local/include/g2o/apps/g2o_hierarchical/g2o_hierarchical_api.h
-- Installing: /usr/local/include/g2o/apps/g2o_hierarchical/edge_labeler.h
-- Installing: /usr/local/include/g2o/apps/g2o_hierarchical/edge_creator.h
-- Installing: /usr/local/lib/libg2o_simulator.so
-- Set runtime path of "/usr/local/lib/libg2o_simulator.so" to ""
-- Installing: /usr/local/bin/g2o_simulator2d
-- Set runtime path of "/usr/local/bin/g2o_simulator2d" to ""
-- Installing: /usr/local/bin/g2o_simulator3d
-- Set runtime path of "/usr/local/bin/g2o_simulator3d" to ""
-- Installing: /usr/local/bin/g2o_anonymize_observations
-- Set runtime path of "/usr/local/bin/g2o_anonymize_observations" to ""
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_line3d.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/simutils.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_pointxy.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/simulator3d.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/simulator2d.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/simulator3d_base.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_pose3d_offset.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_odometry3d.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_odometry2d.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/simulator2d_base.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_se3_prior.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_pose3d.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_pointxyz.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_pointxyz_disparity.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_odometry.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/g2o_simulator_api.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/simulator.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_segment2d_pointline.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_segment2d_line.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/pointsensorparameters.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_pose2d.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_pointxyz_depth.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_pointxy_offset.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_segment2d.h
-- Installing: /usr/local/include/g2o/apps/g2o_simulator/sensor_pointxy_bearing.h
-- Installing: /usr/local/bin/g2o_viewer
-- Set runtime path of "/usr/local/bin/g2o_viewer" to ""
-- Installing: /usr/local/lib/libg2o_viewer.so
-- Set runtime path of "/usr/local/lib/libg2o_viewer.so" to ""
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/properties_widget.h
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/run_g2o_viewer.h
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/main_window.h
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/g2o_qglviewer.h
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/gui_hyper_graph_action.h
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/g2o_viewer_api.h
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/stream_redirect.h
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/viewer_properties_widget.h
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/ui_base_main_window.h
-- Installing: /usr/local/include/g2o/apps/g2o_viewer/ui_base_properties_widget.h
-- Installing: /usr/local/lib/libg2o_types_data.so
-- Set runtime path of "/usr/local/lib/libg2o_types_data.so" to ""
-- Installing: /usr/local/include/g2o/types/data/g2o_types_data_api.h
-- Installing: /usr/local/include/g2o/types/data/types_data.h
-- Installing: /usr/local/include/g2o/types/data/laser_parameters.h
-- Installing: /usr/local/include/g2o/types/data/robot_data.h
-- Installing: /usr/local/include/g2o/types/data/data_queue.h
-- Installing: /usr/local/include/g2o/types/data/vertex_ellipse.h
-- Installing: /usr/local/include/g2o/types/data/raw_laser.h
-- Installing: /usr/local/include/g2o/types/data/vertex_tag.h
-- Installing: /usr/local/include/g2o/types/data/robot_laser.h
-- Installing: /usr/local/lib/libg2o_types_slam2d.so
-- Set runtime path of "/usr/local/lib/libg2o_types_slam2d.so" to ""
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2_twopointsxy.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2_offset.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2_pointxy_bearing.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2_lotsofxy.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2.h
-- Installing: /usr/local/include/g2o/types/slam2d/types_slam2d.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2_xyprior.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_xy_prior.h
-- Installing: /usr/local/include/g2o/types/slam2d/vertex_point_xy.h
-- Installing: /usr/local/include/g2o/types/slam2d/g2o_types_slam2d_api.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2_pointxy_calib.h
-- Installing: /usr/local/include/g2o/types/slam2d/vertex_se2.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_pointxy.h
-- Installing: /usr/local/include/g2o/types/slam2d/parameter_se2_offset.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2_pointxy.h
-- Installing: /usr/local/include/g2o/types/slam2d/se2.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2_pointxy_offset.h
-- Installing: /usr/local/include/g2o/types/slam2d/edge_se2_prior.h
-- Installing: /usr/local/lib/libg2o_types_slam3d.so
-- Set runtime path of "/usr/local/lib/libg2o_types_slam3d.so" to ""
-- Installing: /usr/local/include/g2o/types/slam3d/edge_se3_offset.h
-- Installing: /usr/local/include/g2o/types/slam3d/edge_se3.h
-- Installing: /usr/local/include/g2o/types/slam3d/edge_xyz_prior.h
-- Installing: /usr/local/include/g2o/types/slam3d/isometry3d_mappings.h
-- Installing: /usr/local/include/g2o/types/slam3d/isometry3d_gradients.h
-- Installing: /usr/local/include/g2o/types/slam3d/parameter_se3_offset.h
-- Installing: /usr/local/include/g2o/types/slam3d/edge_se3_pointxyz.h
-- Installing: /usr/local/include/g2o/types/slam3d/g2o_types_slam3d_api.h
-- Installing: /usr/local/include/g2o/types/slam3d/se3_ops.h
-- Installing: /usr/local/include/g2o/types/slam3d/edge_pointxyz.h
-- Installing: /usr/local/include/g2o/types/slam3d/edge_se3_pointxyz_disparity.h
-- Installing: /usr/local/include/g2o/types/slam3d/se3quat.h
-- Installing: /usr/local/include/g2o/types/slam3d/edge_se3_lotsofxyz.h
-- Installing: /usr/local/include/g2o/types/slam3d/vertex_pointxyz.h
-- Installing: /usr/local/include/g2o/types/slam3d/dquat2mat.h
-- Installing: /usr/local/include/g2o/types/slam3d/types_slam3d.h
-- Installing: /usr/local/include/g2o/types/slam3d/vertex_se3.h
-- Installing: /usr/local/include/g2o/types/slam3d/edge_se3_prior.h
-- Installing: /usr/local/include/g2o/types/slam3d/edge_se3_pointxyz_depth.h
-- Installing: /usr/local/include/g2o/types/slam3d/parameter_camera.h
-- Installing: /usr/local/include/g2o/types/slam3d/parameter_stereo_camera.h
-- Installing: /usr/local/include/g2o/types/slam3d/se3_ops.hpp
-- Installing: /usr/local/lib/libg2o_types_sba.so
-- Set runtime path of "/usr/local/lib/libg2o_types_sba.so" to ""
-- Installing: /usr/local/include/g2o/types/sba/sbacam.h
-- Installing: /usr/local/include/g2o/types/sba/types_sba.h
-- Installing: /usr/local/include/g2o/types/sba/g2o_types_sba_api.h
-- Installing: /usr/local/include/g2o/types/sba/types_six_dof_expmap.h
-- Installing: /usr/local/lib/libg2o_types_sim3.so
-- Set runtime path of "/usr/local/lib/libg2o_types_sim3.so" to ""
-- Installing: /usr/local/include/g2o/types/sim3/sim3.h
-- Installing: /usr/local/include/g2o/types/sim3/types_seven_dof_expmap.h
-- Installing: /usr/local/lib/libg2o_types_icp.so
-- Set runtime path of "/usr/local/lib/libg2o_types_icp.so" to ""
-- Installing: /usr/local/include/g2o/types/icp/g2o_types_icp_api.h
-- Installing: /usr/local/include/g2o/types/icp/types_icp.h
-- Installing: /usr/local/lib/libg2o_types_sclam2d.so
-- Set runtime path of "/usr/local/lib/libg2o_types_sclam2d.so" to ""
-- Installing: /usr/local/include/g2o/types/sclam2d/edge_se2_sensor_calib.h
-- Installing: /usr/local/include/g2o/types/sclam2d/vertex_odom_differential_params.h
-- Installing: /usr/local/include/g2o/types/sclam2d/g2o_types_sclam2d_api.h
-- Installing: /usr/local/include/g2o/types/sclam2d/edge_se2_odom_differential_calib.h
-- Installing: /usr/local/include/g2o/types/sclam2d/odometry_measurement.h
-- Installing: /usr/local/include/g2o/types/sclam2d/types_sclam2d.h
-- Installing: /usr/local/lib/libg2o_types_slam2d_addons.so
-- Set runtime path of "/usr/local/lib/libg2o_types_slam2d_addons.so" to ""
-- Installing: /usr/local/include/g2o/types/slam2d_addons/vertex_segment2d.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/types_slam2d_addons.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/line_2d.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/vertex_line2d.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/edge_se2_segment2d.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/edge_se2_segment2d_line.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/edge_se2_line2d.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/edge_line2d_pointxy.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/edge_se2_segment2d_pointLine.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/g2o_types_slam2d_addons_api.h
-- Installing: /usr/local/include/g2o/types/slam2d_addons/edge_line2d.h
-- Installing: /usr/local/lib/libg2o_types_slam3d_addons.so
-- Set runtime path of "/usr/local/lib/libg2o_types_slam3d_addons.so" to ""
-- Installing: /usr/local/include/g2o/types/slam3d_addons/vertex_se3_euler.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/edge_se3_euler.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/g2o_types_slam3d_addons_api.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/line3d.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/vertex_plane.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/edge_se3_calib.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/vertex_line3d.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/edge_plane.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/plane3d.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/types_slam3d_addons.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/edge_se3_line.h
-- Installing: /usr/local/include/g2o/types/slam3d_addons/edge_se3_plane_calib.h
-- Installing: /usr/local/lib/libg2o_solver_pcg.so
-- Set runtime path of "/usr/local/lib/libg2o_solver_pcg.so" to ""
-- Installing: /usr/local/include/g2o/solvers/pcg/linear_solver_pcg.h
-- Installing: /usr/local/include/g2o/solvers/pcg/linear_solver_pcg.hpp
-- Installing: /usr/local/lib/libg2o_solver_dense.so
-- Set runtime path of "/usr/local/lib/libg2o_solver_dense.so" to ""
-- Installing: /usr/local/include/g2o/solvers/dense/linear_solver_dense.h
-- Installing: /usr/local/lib/libg2o_solver_structure_only.so
-- Set runtime path of "/usr/local/lib/libg2o_solver_structure_only.so" to ""
-- Installing: /usr/local/include/g2o/solvers/structure_only/structure_only_solver.h
-- Installing: /usr/local/lib/libg2o_solver_csparse.so
-- Set runtime path of "/usr/local/lib/libg2o_solver_csparse.so" to ""
-- Installing: /usr/local/lib/libg2o_csparse_extension.so
-- Installing: /usr/local/include/g2o/solvers/csparse/g2o_csparse_extension_api.h
-- Installing: /usr/local/include/g2o/solvers/csparse/g2o_csparse_api.h
-- Installing: /usr/local/include/g2o/solvers/csparse/csparse_helper.h
-- Installing: /usr/local/include/g2o/solvers/csparse/csparse_extension.h
-- Installing: /usr/local/include/g2o/solvers/csparse/linear_solver_csparse.h
-- Installing: /usr/local/lib/libg2o_solver_slam2d_linear.so
-- Set runtime path of "/usr/local/lib/libg2o_solver_slam2d_linear.so" to ""
-- Installing: /usr/local/include/g2o/solvers/slam2d_linear/g2o_slam2d_linear_api.h
-- Installing: /usr/local/include/g2o/solvers/slam2d_linear/solver_slam2d_linear.h
-- Installing: /usr/local/lib/libg2o_solver_cholmod.so
-- Set runtime path of "/usr/local/lib/libg2o_solver_cholmod.so" to ""
-- Installing: /usr/local/include/g2o/solvers/cholmod/linear_solver_cholmod.h
-- Installing: /usr/local/lib/libg2o_solver_eigen.so
-- Set runtime path of "/usr/local/lib/libg2o_solver_eigen.so" to ""
-- Installing: /usr/local/include/g2o/solvers/eigen/linear_solver_eigen.h
-- Installing: /usr/local/lib/libg2o_parser.so
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/parser/bison_parser.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/parser/slam_context.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/parser/FlexLexer.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/parser/commands.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/parser/driver.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/parser/scanner.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/parser/location.hh
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/parser/position.hh
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/parser/stack.hh
-- Installing: /usr/local/lib/libg2o_interface.so
-- Set runtime path of "/usr/local/lib/libg2o_interface.so" to ""
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/interface/slam_context_interface.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/interface/parser_interface.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/slam_parser/interface/abstract_slam_interface.h
-- Installing: /usr/local/lib/libg2o_interactive.so
-- Set runtime path of "/usr/local/lib/libg2o_interactive.so" to ""
-- Installing: /usr/local/bin/g2o_online
-- Set runtime path of "/usr/local/bin/g2o_online" to ""
-- Installing: /usr/local/include/g2o/examples/interactive_slam/g2o_interactive/types_slam3d_online.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/g2o_interactive/g2o_interactive_api.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/g2o_interactive/graph_optimizer_sparse_online.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/g2o_interactive/fast_output.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/g2o_interactive/g2o_slam_interface.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/g2o_interactive/types_slam2d_online.h
-- Installing: /usr/local/lib/libg2o_incremental.so
-- Set runtime path of "/usr/local/lib/libg2o_incremental.so" to ""
-- Installing: /usr/local/bin/g2o_incremental
-- Set runtime path of "/usr/local/bin/g2o_incremental" to ""
-- Installing: /usr/local/include/g2o/examples/interactive_slam/g2o_incremental/g2o_incremental_api.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/g2o_incremental/graph_optimizer_sparse_incremental.h
-- Installing: /usr/local/include/g2o/examples/interactive_slam/g2o_incremental/linear_solver_cholmod_online.h

  为了方便起见,我把其中的.so文件的名字罗列成表单,以方便查询。

链接名链接名链接名
libg2o_calibration_odom_laser.solibg2o_cil.solibg2o_core.so
libg2o_csparse_extension.solibg2o_ext_freeglut_minimal.solibg2o_hierarchical.so
libg2o_incremental.solibg2o_interactive.solibg2o_interface.so
libg2o_opengl_helper.solibg2o_parser.solibg2o_simulator.so
libg2o_solver_cholmod.solibg2o_solver_csparse.solibg2o_solver_dense.so
libg2o_solver_eigen.solibg2o_solver_pcg.solibg2o_solver_slam2d_linear.so
libg2o_solver_structure_only.solibg2o_stuff.solibg2o_tutorial_slam2d.so
libg2o_types_data.solibg2o_types_icp.solibg2o_types_sba.so
libg2o_types_sim3.solibg2o_types_slam2d.solibg2o_types_slam2d_addons.so
libg2o_types_slam3d.solibg2o_types_slam3d_addons.solibg2o_viewer.so

  也许会有遗漏,如果有遗漏之处,请指出。

运行unit_test

  接着进行更改,我们先进入g2o下面的unit_test,然后运行下面的命令:

mkdir build
cd build
cmake ..
make

  你会发现它会报错,报错有哪些我具体已经忘记了,但是大体上分为这几类,按照这几种进行修改,基本上一般都修改出来了。

  •   和你说/usr/local/include/g2o/core的"xx.h"有问题,那么一般指出来的是<Eigen/core>没有这个文件啊,其实是文件路径问题,我最愚蠢的办法,当然我能力不足,不知道怎么修改g2o原始的CMakelist.txt,然后我就是进入/usr/local/include/g2o/core目录下,修改<Eigen/core><eigen3/Eigen/core>,这种原因而报错的文件超级的多,所以比较麻烦,我也没想到比较好的解决方案。
  •   当你这上面的修改完了,再显示DSO missing from command line,这种问题的产生有好几个,最主要的是比如说某个libstuff.so找不到,这其实是新版本的g2o下,根本不会产生这个了,而是g2o_stuff。这类相关问题主要是出现在几个子文件项目中,比如stuffslam3dslam2d等等,你需要修改的仅仅是它们对应的CMakelist.txt,这里举例子说明。
  •   第三个是它自己本身项目内部,而不是在安装目录下进行报错,文件找不到。那么我这里是使用相对路径修改,比如:

  一般就是这么三个比较重大的错误,其他小错误倒是没发现了,如果还有其他错误,欢迎一起交流,毕竟是我在运行过程中的记录,并不是很完善。
  最后的结果就是这么的。

结语

  本次运行新版本的g2o就到这里结束了,后面我一步步做记录学习g2o也不知道有没有时间上来发发贴,嗯,祝大家也能运行成功新版本的g2o,一起进步一起学习。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YuYunTan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值