ROS-Jade版在UbuntuKylin15.04上的源码安装

ROS-Installing from source

Install from source requires that you download and compile the source code on your own. ROS Jade supports Trusty, Utopic, and Vivid. Other platforms are possible to use but are not expected to work out of the box. Target platforms are defined in REP 3

目录

  1. Installing from source
    1. Update the workspace
    2. Rebuild your workspace
    3. Building the catkin Packages
    4. Installing bootstrap dependencies
    5. Initializing rosdep
    6. Prerequisites
    7. Installation
    8. Maintaining a Source Checkout

Prerequisites

Installing bootstrap dependencies

Install bootstrap dependencies (Ubuntu):

These tools are used to facilitate the download and management of ROS packages and their dependencies, among other things.

Ubuntu:

  • $ sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential

    If you have trouble installing the packages in the command above, make sure you have added the packages.ros.org debian repository to your apt source lists as described starting here: jade/Installation/Ubuntu#jade.2BAC8-Installation.2BAC8-Sources.Setup_your_sources.list

    If apt complains that the python-support package is not installable, make sure that you have the Ubuntu universe repositories enabled in your /etc/apt/sources.list

Fedora:

  • $ sudo yum install python-rosdep python-rosinstall_generator python-wstool python-rosinstall @buildsys-build

    Some packages used in ROS are not currently available in the Fedora RPM repositories. Most of the other packages are available in RPM Fusion. See RPM Fusion Command Line Setup.

    Any packages not available in RPM Fusion are staged in the SDSM&T ROS RPM staging repository, which is available from csc.mcs.sdsmt.edu.

Generic (pip):

  • If you are using a non-Debian system you need to make sure that you have all build tools (compiler, CMake, etc.) installed. You can install all ROS Python tools via PIP:

    $ sudo pip install -U rosdep rosinstall_generator wstool rosinstall

    If there are errors with this or the rosdep step below, your system‘s version of pip may be out-of-date. Use your system‘s package management to update it, or use it to update itself:

    $ sudo pip install --upgrade setuptools

    Note that on many platforms such as OSX you may want to install the above packages and use ROS inside a virtualenv so as to make sure not to collide with system dependencies.

Initializing rosdep

$ sudo rosdep init$ rosdep update

Installation

Start by building the core ROS packages.

Building the catkin Packages

ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.

Create a catkin Workspace

In order to build the core packages, you will need a catkin workspace. Create one now:

  • $ mkdir ~/ros_catkin_ws$ cd ~/ros_catkin_ws

Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:

Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

  • $ rosinstall_generator desktop_full --rosdistro jade --deps --wet-only --tar > jade-desktop-full-wet.rosinstall$ wstool init -j8 src jade-desktop-full-wet.rosinstall

Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries

  • $ rosinstall_generator desktop --rosdistro jade --deps --wet-only --tar > jade-desktop-wet.rosinstall$ wstool init -j8 src jade-desktop-wet.rosinstall

ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

  • $ rosinstall_generator ros_comm --rosdistro jade --deps --wet-only --tar > jade-ros_comm-wet.rosinstall$ wstool init -j8 src jade-ros_comm-wet.rosinstall

This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.

In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:

$ rosinstall_generator robot --rosdistro jade --deps --wet-only --tar > jade-robot-wet.rosinstall$ wstool init -j8 src jade-robot-wet.rosinstall

If wstool init fails or is interrupted, you can resume the download by running:

wstool update -j 4 -t src

Resolving Dependencies

Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:

  • $ rosdep install --from-paths src --ignore-src --rosdistro jade -y

This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.

The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn‘t try to install any ROS packages in the src folder from the package manager, we don‘t need it to since we are building them ourselves. The --rosdistro option is required because we don‘t have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don‘t want to be bothered by too many prompts from the package manager.

After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.

Building the catkin Workspace

Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.

Invoke catkin_make_isolated:

  • $ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).

Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/jade argument to your catkin_make_isolated call.

For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/jade just as the Ubuntu packages would do. Don‘t do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.

Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.

Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.

Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:

  • $ source ~/ros_catkin_ws/install_isolated/setup.bash

Maintaining a Source Checkout

If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.

Update the workspace

To update your workspace, first move your existing rosinstall file so that it doesn‘t get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.

$ mv -i jade-desktop-full-wet.rosinstall jade-desktop-full-wet.rosinstall.old$ rosinstall_generator desktop_full --rosdistro jade --deps --wet-only --tar > jade-desktop-full-wet.rosinstall

Then, compare the new rosinstall file to the old version to see which packages will be updated:

$ diff -u jade-desktop-full-wet.rosinstall jade-desktop-full-wet.rosinstall.old

If you‘re satified with these changes, incorporate the new rosinstall file into the workspace and update your workspace:

$ wstool merge -t src jade-desktop-full-wet.rosinstall$ wstool update -t src

Rebuild your workspace

Now that the workspace is up to date with the latest sources, rebuild it:

$ ./src/catkin/bin/catkin_make_isolated --install

If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace

Once your workspace has been rebuilt, you should source the setup files again:

$ source ~/ros_catkin_ws/install_isolated/setup.bash
时间: 2024-12-30 15:42:39

ROS-Jade版在UbuntuKylin15.04上的源码安装的相关文章

ROS-Jade版在UbuntuKylin15.04上的安装和源码编译完整脚本

ROS(http://www.ros.org/about-ros/)是一个机器人操作系统,源于斯坦福,现在由开源机器人基金会(http://www.osrfoundation.org/)进行发展.目前最新的版本是Jade.ROS并不是完整的操作系统,而是一个应用层的运行环境,支持很多种宿主操作系统,如Ubuntu,也支持Mac OS X,支持ARM上的Ubuntu和Android.设想的生态链如下所示: 一.安装编译好的版本的脚本 完整的说明请参阅:http://my.oschina.net/u

UbuntuKylin15.04编译OpenSCAD源码

OpenSCAD(http://www.openscad.org)是一个简单高效的三维建模软件,使用模型描述脚本进行建模,使用CGAL引擎进行几何体的空间布尔运算.这里介绍其源码编译方法,使用UbuntuKylin15.04. 把下面的内容存为脚本文件openscad_build.sh,修改属性为可执行,然后运行:./openscad_build.sh即可. git clone git://github.com/openscad/openscad.git cd openscad git subm

哈工大分词器在 mac os 10.13上的源码安装

之前安装了几次没有成功, PengYi <[email protected]>,这哥们发email说: 看源代码里面,ltp是一个link.所以,git clone下来,这个目录下面是空的.需要进入源代码目录.把ltp删掉,然后在执行 git clone [email protected]:HIT-SCIR/ltp.git,把ltp这个源码下载下来,再执行 python setup.py install $git clone https://github.com/HIT-SCIR/pyltp

postgresql 在linux上的源码安装

http://my.oschina.net/hippora/blog/375292 下载源码并解压 [root@fnddb ~]# wget https://ftp.postgresql.org/pub/source/v9.4.0/postgresql-9.4.0.tar.bz2 [root@fnddb ~]# tar -xjvf postgresql-9.4.0.tar.bz2 [root@fnddb ~]# cd postgresql-9.4.0 开始编译安装 [[email protect

在UbuntuKylin15.04上安装GIScript

GIScript2015版采用了新的SIP封装,从而可以更好地与C++接口保持一致. 最近有了一些进展,尝试在在UbuntuKylin15.04上安装GIScript. 由于要使用MetaSIP,需要Python3,先输入python3确认一下当前的环境. 安装python3 sudo apt-get install python-pip sudo apt-get install python3-dev 安装SIP #下载:http://www.riverbankcomputing.com/so

CentOS-6.4-minimal版中源码安装MySQL-5.5.38

/** * CentOS-6.4-minimal版中源码安装MySQL-5.5.38 * ---------------------------------------------------------------------------------------------------------------------- * 三种安装方式 * 1)源码安装 * 2)二进制包安装 * 3)rpm或yum安装 * 本文演示的是源码安装,并且,从mysql-5.5开始,源码安装要通过cmake安装

Ubuntu15.04下源码安装MySQL5.6.26数据库

解决Ubuntu 15.04版下源码编译安装MySQL5.6.26数据库问题,这里提供依赖包下载,源码安装方法. (1)安装编译源码需要的包 sudoapt-get install make cmake gcc g++ bison libncurses5-dev 依赖包在博客附件里有下载.下面也有说明一些解决方法. 另外的:cmake-2.8.3.tar.gz安装啊.bison_3.0.2.dfsg-2_i386.deb.ncurses-5.9.tar.gz的依赖缺少的话自己可以去下载安装,由于

在 Linux 系统上源码安装 GTK+ 2.0

在 Linux 系统上源码安装 GTK+ 2.0==================================================Keywords: GTK+, Install, Linux, SourceAuthor:       whyglinux (whyglinux AT hotmail DOT com)Date:          2007-01-07==================================================目录0. 前言1.

Linux服务器--CentOS6上源码安装LAMP(实现WordPress,PhpMyAdmin)

Linux服务--CentOS6实现LAMP(源码安装) 实验要求: 安装php时实现php模块嵌入到httpd中和实现fpm两种方式.在fpm下,提供两个虚拟主机: 分别用于实现PHPMyadmin和WordPress,其中PhpMyAdmin提供ssl. 实验环境: CentOS系统一台(IP:172.16.99.4),所需的httpd,mariadb,php,PhpAdmin,WordPress的源码包. 实验步骤: 安装顺序:httpd-->mariadb-->php. 安装前的准备工