ROS与SLAM入门教程-cartographer在Turltlebot的应用1-官方安装及补充
ROS与SLAM入门教程-cartographer在Turltlebot的应用1
说明
cartographer介绍
这是一个实时同步定位与地图系统(SLAM),提供ROS 系统支持2D 和 3D SLAM(simultaneous localization and mapping)库。
Cartographer ROS for TurtleBots介绍
- 这个库通过Cartographer ROS提供针对Turtlebots的Cartographer SLAM
来自hitcm的安装方法(不需要翻墙)
来自官方的安装方法
- 修改ceres-solver地址:
- github地址:https://github.com/ceres-solver/ceres-solver.git
1. 库安装
- 在ubuntu 14.04 + indigo 测试通过,应该在ubuntu 16.04 + Kinetic 也能运行。
sudo apt-get install -y google-mock libboost-all-dev libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx ros-indigo-tf2-eigen libatlas-base-dev libsuitesparse-dev liblapack-dev
- 安装步骤:
# Install wstool and rosdep.
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
# Create a new workspace in 'catkin_ws'.
mkdir catkin_ws
cd catkin_ws
wstool init src
# Merge the cartographer_turtlebot.rosinstall file and fetch code for dependencies.
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_turtlebot/master/cartographer_turtlebot.rosinstall
#vim src/.rosinstall
#更改ceres-solver中地址改为下面的地址:
#>>uri: https://github.com/ceres-solver/ceres-solver.git
wstool update -t src
# Install deb dependencies.
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
# Build and install.
catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash
问题及解决
问题: 运行rosdep install会提示,没有找到ceres-solver
解决: 进入src/cartographer,在package.xml文件,找到
ceres-solver 先注释,在执行。依赖安装完之后再取消注释。问题:运行catkin_make_isolated提示,no member name 'submap_index'
解决:可能是同时使用不同版本cartographer_ros导致,检查去掉其他版本。我出现这个问题是之前安装过hitcm提供的源码。去掉hitcm的源码,并注释掉相应的source包含其他的版本的工作空间导入。
问题:更改ceres-solver库的方法
解决:http://www.jianshu.com/p/7acbbc58eab5
2. 运行
- 安装完成即Cartographer, Cartographer ROS, and Cartographer ROS’s TurtleBot都已经安装。
- 下载例子包到~/Downloads目录,并测试
# Download the example bag.(下载例子)
wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/turtlebot/cartographer_turtlebot_demo.bag
# Launch the 2D LIDAR demo.(2D雷达DEMO)
roslaunch cartographer_turtlebot demo_lidar_2d.launch bag_filename:=${HOME}/Downloads/cartographer_turtlebot_demo.bag
# Launch the 2D depth camera demo.(2D深度相机DEMO)
roslaunch cartographer_turtlebot demo_depth_camera_2d.launch bag_filename:=${HOME}/Downloads/cartographer_turtlebot_demo.bag
# Launch the 3D depth camera demo.(3D深度相机DEMO)
roslaunch cartographer_turtlebot demo_depth_camera_3d.launch bag_filename:=${HOME}/Downloads/cartographer_turtlebot_demo.bag
- launch 文件会自动启动roscore和rviz
3. 视频演示
- 演示1
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号