Skip to content

Commit

Permalink
Modified this PR to be exactly the same as RobotLocomotion#2755.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chien-Liang Fok committed Jul 8, 2016
1 parent eec3ae4 commit bd251e6
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 3 deletions.
20 changes: 17 additions & 3 deletions drake/doc/from_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ Before running build, you will need to follow the instructions for your host sys

Build the collection
====================
There are two supported ways to build Drake:
`Make <https://www.gnu.org/software/make/>`_ and
`Ninja <https://ninja-build.org/>`_.
There are three ways to build Drake:

1. Using `Make <https://www.gnu.org/software/make/>`_
2. Using `Ninja <https://ninja-build.org/>`_
3. Using `ROS Catkin <http://wiki.ros.org/catkin>`_

Because the Drake build is not entirely out-of-source, you must pick one build
system and stick to it. Switching build systems within the same working tree
Expand Down Expand Up @@ -179,6 +181,18 @@ To review the raw shell commands, compiler flags, and linker flags that CMake
generated, consult ``build.ninja`` and ``drake/build.ninja``, or run
``ninja -v`` for a verbose build.

.. _build_with_ros_catkin:

Build with ROS Catkin
---------------------

See:

.. toctree::
:maxdepth: 1

from_source_ros

Test Your Installation
======================

Expand Down
81 changes: 81 additions & 0 deletions drake/doc/from_source_ros.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
.. _build_from_source_using_ros_catkin:

**************************************
Building Drake as a ROS Catkin Package
**************************************

.. _drake_ros_catkin_introduction:

Introduction
============

The `Robot Operating System (ROS) <http://www.ros.org/>`_ provides a software
platform for conducting advanced robotics research and development. Since its
`creation in the mid 2000s <http://www.ros.org/history/>`_, ROS has
attained a `tremendous following <http://wiki.ros.org/Metrics>`_ due in part to
its integration of many infrastructure-level components that are important to
robotics and the increased collaborative potential resulting from platform
standardization. It is arguably among the most successful open source robotics
platforms to date in terms of fostering collaboration, research, and innovation
within robotics.


Drake can be configured to be a package within a ROS workspace. Instructions for
how to do this are given below. Before starting, ensure
`ROS is installed <http://wiki.ros.org/ROS/Installation>`_
and your public SSH key is
`added to your github account <https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/>`_.

The following instructions are known to work on
`Ubuntu 14.04.4 LTS (Trusty Tahr) <http://releases.ubuntu.com/14.04/>`_ and
`ROS Indigo <http://wiki.ros.org/indigo>`_. Other versions of the OS and ROS
may or may not work. They also assume you want to create a *new* ROS workspace
in ``~/dev`` called ``drake_catkin_workspace``. The commands below can be
customized with a different workspace name and location.

If you already have a ROS Catkin workspace and simply want to add Drake as a
package within it, you can skip :ref:`create_catkin_workspace` and proceed to
:ref:`add_and_compile_drake_to_ros_workspace`.

.. _create_catkin_workspace:

Step 1: Create a ROS Catkin Workspace
=====================================

To create a ROS Catkin workspace, open a terminal and execute the following
commands::

mkdir -p ~/dev/drake_catkin_workspace/src
cd ~/dev/drake_catkin_workspace/src
source /opt/ros/indigo/setup.bash
catkin_init_workspace
cd ..
catkin_make

.. _add_and_compile_drake_to_ros_workspace:

Step 2: Add Drake to the ROS Catkin Workspace and Re-Build the Workspace
========================================================================

To add Drake to your ROS Catkin workspace, execute the following commands (note:
you may need to customize the commands below if you elected to place the
workspace in a different location)::

cd src
git clone [email protected]:RobotLocomotion/drake.git
cd ..
catkin_make

There are numerous optional flags that can be included after the ``catkin_make``
command listed above. For example, one flag is ``-DDISABLE_MATLAB=TRUE`, which
disables MATLAB support, which may be useful if you have MATLAB installed but
don't have access to a license server. There are many additional command line
flags that, for example, enables support for certain optimizers like
`SNOPT <http://www.sbsi-sol-optimize.com/asp/sol_product_snopt.htm>`_.
For a full list of these optional command line flags, see the variables defined
in ``~/dev/drake_catkin_workspace/src/drake/CMakeLists.txt``.

Note also that Catkin by default performs a multi-threaded build.
If your computer does not have sufficient computational resources to support
this, you can add a ``-j1`` flag after the ``catkin_make`` command to force a
single-threaded build, which uses fewer resources.
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This XML file is used by ROS. It declares that this directory and all of its
subdirectories constitute a ROS package. It further enables Drake to be compiled
by the Catkin build system. For more information see the following websites:
http://wiki.ros.org/catkin
http://wiki.ros.org/catkin/package.xml
-->
Expand Down

0 comments on commit bd251e6

Please sign in to comment.