no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Previous revision
Next revision
installation [2018/10/16 14:58] – [Installation] gkazhoya
Line 1: Line 1:
 +====== CRAM installation ======
 +
 +===== Prerequisites =====
 +
 +== OS and ROS ==
 +
 +The recommended setup is Ubuntu 16.04 LTS with ROS Kinetic. \\
 +This is the setup under which the CRAM team is working and it is best supported.
 +
 +Most CRAM components should also work on older Ubuntu versions under ROS Indigo etc. but with no guarantee. If you encounter any incompatibilities / bugs, [[/support|please let us know]].
 +
 +If you don't have the latest version of ROS, [[http://wiki.ros.org/kinetic/Installation/Ubuntu|install it]] (the desktop non-full version should be enough). \\
 +Don't forget to source the environment setup file and
 +
 +<code bash>
 +$ sudo rosdep init
 +$ rosdep update
 +</code>
 +
 +== IDE and the interactive shell ==
 +
 +Your chance to get a bit acquainted with Emacs if you've never used it before.
 +
 +<code bash>
 +$ sudo apt-get install ros-DISTRO-roslisp-repl
 +</code>
 +
 +where ''DISTRO'' is your ROS version, e.g., ''indigo'' or ''kinetic''.
 +
 +For information on how to use the IDE check the [[http://cram-system.org/doc/ide|Setup and IDE page]].
 +
 +== ROS workspace management tools ==
 +
 +You will need those for setting up the ROS workspace and checking out code.
 +
 +<code bash>
 +$ sudo apt-get install python-rosinstall python-wstool
 +</code>
 +
 +===== Installation =====
 +
 +<html><!--
 +If you are new to CRAM and are curious to test the ideas behind it, you can try the [[/installation#minimal_installation|Minimal  installation]], which will install all the packages necessary to go through the [[/tutorials#beginner_tutorials|CRAM beginner tutorials]]: these explain the main concepts of CRAM and present the CRAM Plan Language.
 +
 +If you want to see the full power of CRAM, [[/installation#full_installation|Full installation]] is recommended.
 +
 +Please note that [[/installation#minimal_installation|Minimal installation]] and [[/installation#full_installation|Full installation]] are mutually exclusive.
 +If you first tried the minimal version and are now curious to see the full CRAM, please first remove the ''cram_3rdparty'' and ''cram_core'' directories from the ''src'' directory of your ROS workspace and then proceed with the full installation.
 +
 +==== Minimal installation ====
 +
 +This is a guide for installing the core CRAM packages. It installs the prerequisites of [[/tutorials#beginner_tutorials|CRAM beginner tutorials]], leaving out big dependencies such as [[http://knowrob.org|KnowRob]].
 +
 +In the ''src'' directory of your ROS workspace execute the following commands:
 +
 +<code bash>
 +$ git clone https://github.com/cram2/cram_3rdparty.git
 +$ git clone https://github.com/cram2/cram_core.git
 +$ rosdep install --ignore-src --from-paths cram_3rdparty cram_core
 +$ cd .. && catkin_make
 +</code>
 +
 +Now you just need to [[/installation#get_ready_for_development|get ready for development]] and then get started with the [[/tutorials#beginner_tutorials|beginner tutorials]]!
 +
 +==== Full installation ====
 +
 +--></html>
 +
 +
 +
 +
 +This is a guide for installing the main CRAM packages. It covers installing the packages you need to get the system up and running to the point where you can run and test it in a simulation mode. Setting up the system on a real robot is more complex (mostly involving the usual ROS-based platform setup) and is out of scope of this guide.
 +
 +Nevertheless, CRAM is a big system that has some external dependencies. Most of them are automatically installed as Debian packages, some you need to install from source. 
 +
 +=== ROS workspace setup ===
 +
 +Skip this part if you already have a ROS workspace.
 +
 +
 +
 +
 +<html><!--
 +We recommend to create separate chained (overlaid) ROS workspaces for different components to make compilation faster and easier. (KnowRob is partly written in rosjava and if you will have it in the same workspace with another 10 packages its sole presence in the workspace will make the compilation of your 10 packages many times longer.) You can read more on workspace overlaying [[http://wiki.ros.org/catkin/Tutorials/workspace_overlaying#Chaining_catkin_workspaces|here]].
 +
 +We recommend to create 3 new workspaces chained as following:
 +
 +  bottom -> knowledge base workspace -> cram workspace -> your cram development or top-level workspace
 +
 +where bottom is either your current workspace, or if you don't have one, the ROS preinstalled workspace in ''/opt/ros/...''.
 +
 +To make sure your bottom workspace exists, execute ''$ roscd'' in the shell. If that doesn't work, go through ROS installation page again (specifically, the part with sourcing ''/opt/ros/indigo/setup.bash'' ;) ).
 +
 +We create the workspaces in the ''$HOME/workspace'' directory. Make sure you adjust the paths if you want to create them somewhere else.
 +
 +<code bash>
 +$ mkdir -p ~/workspace/ros_knowrob/src
 +$ cd ~/workspace/ros_knowrob
 +$ catkin_make
 +$ source devel/setup.bash
 +
 +$ mkdir -p ~/workspace/ros_lisp/src
 +$ cd ~/workspace/ros_lisp
 +$ catkin_make
 +$ source devel/setup.bash
 +
 +$ mkdir -p ~/workspace/ros_top/src
 +$ cd ~/workspace/ros_top
 +$ catkin_make
 +$ source devel/setup.bash
 +</code>
 +
 +Now if you execute ''roscd'' you will end up in ''ros_top/devel''. In this workspace you can put your own packages that are based on CRAM. You can also omit the part with ''ros_top'' and just use the ''ros_lisp'' workspace for your own roslisp packages.
 +
 +In any case, don't forget to change the corresponding entry of your ''~/.bashrc'':
 +
 +<code bash>
 +  source $HOME/workspace/ros_top/devel/setup.bash
 +</code>
 +
 +
 +=== KnowRob installation ===
 +
 +The knowledge base workspace will be used for installing KnowRob, which is a knowledge management system that CRAM uses for retrieving knowledge mostly about the environment, sometimes common-sense knowledge etc. We only need the basic installation from the [[http://knowrob.org/installation/catkin|official Knowrob installation webpage]]. It comes down to, first, installing ''rosjava'', which can be done through ''apt-get'', and then checking out and compiling KnowRob code:
 +
 +<code bash>
 +$ sudo apt-get install ros-DISTRO-rosjava # where DISTRO is Indigo or Jade etc.
 +$ rosdep update
 +$ cd ~/workspace/ros_knowrob/src
 +$ wstool init
 +$ wstool merge https://raw.github.com/knowrob/knowrob/master/rosinstall/knowrob-base.rosinstall
 +$ wstool update
 +$ rosdep install --ignore-src --from-paths .
 +$ cd ~/workspace/ros_knowrob
 +$ catkin_make
 +</code>
 +--></html>
 +
 +
 +
 +If you don't have a ROS workspace, please create one. For example, you can do the following:
 +
 +<code bash>
 +$ mkdir -p ~/workspace/ros/src
 +$ cd ~/workspace/ros
 +$ catkin_make
 +$ source devel/setup.bash
 +</code>
 +
 +We create the workspace in the ''$HOME/workspace'' directory. Make sure you adjust the paths if you want to create them somewhere else.
 +
 +If during ''catkin_make'' you got an error that it is not defined, it means that you didn't finish the ROS installation.
 +Here is a hint: you need to source the ROS environment for ''catkin_make'' to work:
 +
 +<code bash>
 +$ source /opt/ros/DISTRO/setup.bash
 +</code>
 +where ''DISTRO'' is, e.g., kinetic.
 +
 +Execute these commands and continue from the ''catkin_make'' step.
 +
 +Now if you execute ''roscd'' you will end up in ''ros/devel''.
 +
 +Don't forget to add the corresponding entry to the bottom of your ''~/.bashrc'':
 +
 +<code bash>
 +  source $HOME/workspace/ros/devel/setup.bash
 +</code>
 +
 +
 +=== CRAM and dependencies installation (ROS Kinetic Ubuntu 16.04) ===
 +
 +Check out and compile all the necessary repositories:
 +
 +<code bash>
 +$ cd ~/workspace/ros/src
 +$ wstool init
 +$ wstool merge https://raw.githubusercontent.com/cram2/cram/master/cram-16.04.rosinstall
 +$ wstool update
 +$ touch iai_maps/iai_dlr_cutting_demo/CATKIN_IGNORE
 +$ cd ~/workspace/ros
 +$ rosdep update
 +$ rosdep install --ignore-src --from-paths src/
 +$ catkin_make
 +</code>
 +
 +Note that the ''wstool update'' command is the one that downloads the source code of CRAM and its dependencies.
 +
 +<html><!--
 +Before executing this step you can edit your ''~/workspace/ros/src/.rosinstall'' file and comment out the CRAM repositories that you don't expect to be using. See the comments inside the [[https://github.com/cram2/cram_projection_demos/blob/master/cram.rosinstall|.rosinstall file]] for more details.
 +--></html>
 +
 +If something went wrong consult the [[/support|Support page]] or feel free to drop an email to the person maintaining this page (check the "Last edited by" part of the footer).
 +
 +
 +=== CRAM and dependencies installation (ROS Indigo Ubuntu 14.04) ===
 +
 +CRAM uses the newest version of the Lisp compiler which is not available on 14.04.
 +That is not a problem as we can install it ourselves.
 +For that please download the SBCL version 1.3.1 from the [[https://sourceforge.net/projects/sbcl/files/sbcl/1.3.1/|SBCL webpage]]. You will most likely need the [[https://sourceforge.net/projects/sbcl/files/sbcl/1.3.1/|64 bit Linux version]].
 +Then extract the archive (in Nautilus, the file browser, it will be ''right click'' -> ''extract here''). Then go to the place where you extracted the archive in the terminal and execute the install script:
 +
 +<code bash>
 +$ cd ~/Downloads/sbcl-1.3.1-x86-64-linux && sh install.sh
 +</code>
 +
 +<html><!--
 +KnowRob seems to have some issues with Java 7, so if the compilation step below complains about rosjava or gradle, [[https://askubuntu.com/questions/464755/how-to-install-openjdk-8-on-14-04-lts|please install Java 8]].
 +--></html>
 +
 +Next step is to check out and compile all the necessary repositories:
 +
 +<code bash>
 +$ cd ~/workspace/ros/src
 +$ wstool init
 +$ wstool merge https://raw.githubusercontent.com/cram2/cram/master/cram-14.04.rosinstall
 +$ wstool update
 +$ cd ~/workspace/ros
 +$ rosdep update
 +$ rosdep install --ignore-src --from-paths src/
 +$ catkin_make
 +</code>
 +
 +Note that the ''wstool update'' command is the one that downloads the source code of CRAM and its dependencies such as KnowRob.
 +
 +If something went wrong consult the [[/support|Support page]] or feel free to drop an email to the person maintaining this page (check the "Last edited by" part of the footer).
 +
 +
 +===== Get ready for development =====
 +
 +Before you open emacs you might want to configure it, at least set up the clipboard properly to enable copy/paste from/to other apps. That is described in the [[http://cram-system.org/doc/ide|Setup and IDE]] and [[http://cram-system.org/doc/emacs-config|Emacs Initialization File]] pages and there is also more than enough material available online.
 +
 +Open your emacs and wait until "ROS welcomes you":
 +
 +<code bash>
 +$ roslisp_repl &
 +</code>
 +
 +Compiling packages using the ROS build system is not enough for code written in Lisp. To compile the CRAM packages that you want to use in Lisp, type the following in the REPL in your Emacs:
 +
 +<code>
 +  ,
 +  r-l-s
 +  cram_NAME
 +  RET
 +</code>
 +where NAME is e.g. ''language''.
 +
 +You're ready for some awesome programming! We recommend to go through the [[/tutorials|tutorials]] first. You might also find some useful links on the [[/doc/getting_started|Getting Started page]].