Ubuntu下google建图cartographer包移植

来源:互联网 发布:fm冠军教父数据 编辑:程序博客网 时间:2024/06/18 08:08

因团队需要,原本ubuntu14.04的操作系统要升级到ubuntu16.04,原本安装的ROS还有各种软件包都需要重新安装,普通得工作空间只需要复制src目录下的文件(也就是源代码文件)到一个新的src的下,然后catkin_make就能正常使用。

然而对于cartographer来说,由于其官方给出的安装方式,比较特别,所以移植的方式也稍微复杂一点。

一下代码为cartographer官方给出的安装代码:

# 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_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.

# 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 init

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

 

    在移植平台的时候,    这两段命令还是需要进行的。

sudo apt-get update

sudo apt-get install -y python-wstool python-rosdep ninja-build

mkdir catkin_ws

cd catkin_ws

wstool init src

    进入这个步骤以后,就不需要进行wstool merge -t src https://raw.githubuserco……这个步骤了,这个步骤是从google的网站下在包,但是国内的情况并不是很好,既然你第一次下载好了,或者对之前的文件进行过一些修改,这时候,直接把原src下的文件复制过来,然后继续下边的步骤

sudo rosdep init

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

 

这样基本能够达到跟以前的工作空间一样的效果