cartographer的使用安装和测试
我这里用的是ubuntu14.04,ros indigo
五.cartographer的安装
1.sudo apt-get update
2.安装依赖,cartographer它的依赖总共是5个库,其中Boost,Eigen3,Lua,Protobuf这四个库的依赖是可以直接安装的,但Ceres这个库是需要另外安装的。
sudo apt-get install -y \
cmake \
g++ \
git \
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
3.安装ceres库及编译
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install
4.安装cartographer库及编译
git clone https://github.com/googlecartographer/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install
5.安装cartographer-ros
sudo apt-get update sudo apt-get install -y python-wstool python-rosdep ninja-build # Create a new workspace in \'catkin_ws\'. mkdir catkin_my cd catkin_my wstool 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.rosinstall 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
六、运行示例
1.下载示例包,点击
https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag进行下载
2.把这个包移到home目录下
3.运行
cd catkin_my
catkin_make_isolated --install --use-ninja source install_isolated/setup.bash
cd src
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/cartographer_paper_deutsches_museum.bag
运行结果如下:
版权声明:本文为talugirl原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。