ros 安装cartographer

来源:互联网 发布:好了歌注 知乎 编辑:程序博客网 时间:2024/05/16 05:52

安装步骤如下:(完全follow 官网):

# Install wstool and rosdep.sudo apt-get updatesudo apt-get install -y python-wstool python-rosdep ninja-build# Create a new workspace in 'catkin_ws'.mkdir catkin_wscd catkin_wswstool init src# Merge the cartographer_ros.rosinstall file and fetch code for dependencies.wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstallwstool update -t src# Install deb dependencies.# The command 'sudo rosdep init' will print an error if you have already# executed it since installing ROS. This error can be ignored.sudo rosdep initrosdep updaterosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y# Build and install.catkin_make_isolated --install --use-ninjasource install_isolated/setup.bash

在上面的catkin_make_isolated --install --use-ninja 这一步时遇到一个build error

CMake Error at /home/xxx/catkin_ws/install_isolated/lib/cmake/Ceres/CeresConfig.cmake:88 (message):
Failed to find Ceres - Missing requested Ceres components:
[SparseLinearAlgebraLibrary] (components requested:

解决办法:

在/home/xxx/catkin_ws_cartographer/build_isolated/ceres-solver/install/CMakeCache.txt 里找到EIGENSPARSE:BOOL=OFF , 把OFF 改成ON

重新:

catkin_make_isolated --install --use-ninja就OK.



运行cartographer算法来建图:

下载bag数据:下载2d的bag 数据(要vpn)
mkdir ~/map_data cd ~/map_data wget  https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bagrun cartographer建图: roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/map_data/cartographer_paper_deutsches_museum.bag
过程比较漫长,rqt_graph 查看节点之间的关系,如下图所示:




建的地图长相:todo 补上


原创粉丝点击