新版的cartographer 安装(前面为官网)
# Install wstool and rosdep.
1 sudo apt-get update2 sudo apt-get install -y python-wstool python-rosdep ninja-build
# Create a new workspace in 'catkin_ws'.
3 mkdir catkin_ws
4 cd catkin_ws
5 wstool init src
# Merge the cartographer_ros.rosinstall file and fetch code for dependencies.
6 wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
7 wstool update -t src
# Install proto3. #在catkin_ws目录下进行
8 src/cartographer/scripts/install_proto3.sh
#注意::未克隆cartographer可以去github克隆
git clone https://github.com/googlecartographer/cartographer.git
git clone https://github.com/googlecartographer/cartographer_ros.git
git clone https://github.com/googlecartographer/cartographer_turtlebot.git
git clone https://github.com/ceres-solver/ceres-solver.git
# 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.
9 sudo rosdep init
10 rosdep update
11 rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
# Build and install.
12 catkin_make_isolated --install --use-ninja
13 source install_isolated/setup.bash
---------------------------------------------------------------------------
方便其他包运行
该部分是个人自加 可以不运行
#为了能够被其他软件包使用请将其安装到ROS系统目录下
1 su root
2 source /opt/ros/kinetic/setup.bash
3 catkin_make_isolated --install --use-ninja -DCMAKE_INSTALL_PREFIX=/opt/ros/kinetic
注意:su root 密码忘记时 sudo passwd 可以重新修改密码
注意:cartographer安装后,安装文件安装到了install_isolated里面 进行cartographer_ros的launch文件修改时,在该文件夹下进行修改,否则不起作用
--------------------------------------------------------------------------------
安装测试
检测安装是否正确 可以进行运行以下demo测试
测试2D
# Download the 2D backpack example bag.
1 wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag
# Launch the 2D backpack demo.
2 roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag
测试3D
# Download the 3D backpack example bag.
3 wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_3d/with_intensities/b3-2016-04-05-14-14-00.bag
# Launch the 3D backpack demo.
4 roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag
实验室安装
本系统在Ubuntu16.04上进行了开发和测试,使用Kinetic版本的ROS系统,若您使用其他平台进行系统的部署可能存在系统兼容性问题
- ROS环境搭建请参考[http://wiki.ros.org/kinetic/Installation/Ubuntu]
- 若您要在turtlebot平台上进行系统测试请自行配置turtlebot运行环境
- urg激光雷达ROS软件包安装请参考urg_node,或者在gitlab中搜索urg_node查看
- 本系统使用cartographer进行2d地图构建,为了适应系统的需求我们对cartographer代码进行了适当的修改,由于其代码构建方式与该项目代码构建方式存在差异,因此需要独立安装配置,安装配置过程如下所示:
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
cd ~/
mkdir cartographer
cd cartographer
mkdir src
cd src
catkin_init_workspace #初始化工作空间
git clone http://10.108.235.88/cartographer/cartographer.git
git clone http://10.108.235.88/cartographer/cartographer_ros.git
git clone http://10.108.235.88/cartographer/cartographer_turtlebot.git #请先配置turtlebot环境
git clone http://10.108.235.88/cartographer/ceres_solver.git
cd ../
# Install deb dependencies.
rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
# Build and install.
catkin_make_isolated --install --use-ninja
#为了能够被其他软件包使用请将其安装到ROS系统目录下
su root
source /opt/ros/kinetic/setup.bash
catkin_make_isolated --install --use-ninja -DCMAKE_INSTALL_PREFIX=/opt/ros/kinetic