Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
installation [2017/07/07 10:26] – [Prerequisites] gkazhoyainstallation [2023/05/12 18:05] (current) – [Quickstart with Docker] arthur
Line 1: Line 1:
 ====== CRAM installation ====== ====== CRAM installation ======
  
 +===== Quickstart with Docker =====
 +
 +For a quick peek into CRAM, check out [[https://github.com/cram2/cram_teaching|the Docker setup]] and the [[ https://seafile.zfn.uni-bremen.de/f/04e12809b4d347bebf71/| visual setup procedure]].
 ===== Prerequisites ===== ===== Prerequisites =====
  
 == OS and ROS == == OS and ROS ==
  
-The recommended setup is Ubuntu 14.04 LTS with ROS Indigo. \\+The recommended setup is Ubuntu 20.04 LTS with ROS Noetic. \\
 This is the setup under which the CRAM team is working and it is best supported. This is the setup under which the CRAM team is working and it is best supported.
  
-The core components of CRAM should also work on newer Ubuntu versions under ROS Jade, as well as on older systems but with no guarantee. If you encounter any incompatibilities / bugs, [[/support|please let us know]].+Most CRAM components should also work on older Ubuntu versions under ROS Kinetic 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/indigo/Installation/Ubuntu|install it]] (the desktop non-full version should be enough). \\+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 Don't forget to source the environment setup file and
  
Line 26: Line 29:
 </code> </code>
  
-where ''DISTRO'' is your ROS version, e.g., ''indigo'' or ''kinetic''.+where ''DISTRO'' is your ROS version, e.g., ''melodic'' or ''noetic''
  
 For information on how to use the IDE check the [[http://cram-system.org/doc/ide|Setup and IDE page]]. For information on how to use the IDE check the [[http://cram-system.org/doc/ide|Setup and IDE page]].
Line 34: Line 37:
 You will need those for setting up the ROS workspace and checking out code. You will need those for setting up the ROS workspace and checking out code.
  
 +__**18.04 / Melodic:**__
 <code bash> <code bash>
 $ sudo apt-get install python-rosinstall python-wstool $ sudo apt-get install python-rosinstall python-wstool
 </code> </code>
 +__**20:04 / Noetic:**__ 
 +<code bash> 
 +$ sudo apt-get install python3-wstool 
 +</code>
 ===== Installation ===== ===== 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 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.
  
Line 63: Line 71:
  
 ==== Full installation ==== ==== 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. 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 === === ROS workspace setup ===
  
-CRAM is a big system that has some external dependencies. Most of them are automatically installed as Debian packages, one you need to install from source: the knowledge processing system [[http://knowrob.org/|KnowRob]]. 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]].+Skip this part if you already have a ROS workspace.
  
-(If you don't like the idea of having a separate workspace for KnowRob and you're well familiar with ROS the only thing you will need to install CRAM is [[https://raw.githubusercontent.com/cram2/cram_projection_demos/master/cram.rosinstall|this .rosinstall file]] where you should uncomment the ''knowrob'' entry.)+ 
 + 
 + 
 +<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: We recommend to create 3 new workspaces chained as following:
Line 84: Line 102:
  
 <code bash> <code bash>
-$ mkdir -p ~/workspace/ros_kb/src # kb for knowledge base +$ mkdir -p ~/workspace/ros_knowrob/src 
-$ cd ~/workspace/ros_kb+$ cd ~/workspace/ros_knowrob
 $ catkin_make $ catkin_make
 $ source devel/setup.bash $ source devel/setup.bash
Line 116: Line 134:
 $ sudo apt-get install ros-DISTRO-rosjava # where DISTRO is Indigo or Jade etc. $ sudo apt-get install ros-DISTRO-rosjava # where DISTRO is Indigo or Jade etc.
 $ rosdep update $ rosdep update
-$ cd ~/workspace/ros_kb/src+$ cd ~/workspace/ros_knowrob/src
 $ wstool init $ wstool init
 $ wstool merge https://raw.github.com/knowrob/knowrob/master/rosinstall/knowrob-base.rosinstall $ wstool merge https://raw.github.com/knowrob/knowrob/master/rosinstall/knowrob-base.rosinstall
 $ wstool update $ wstool update
-$ rosdep install --ignore-src --from-paths stacks/ +$ rosdep install --ignore-src --from-paths . 
-$ cd ~/workspace/ros_kb+$ cd ~/workspace/ros_knowrob
 $ catkin_make $ catkin_make
 </code> </code>
 +--></html>
  
  
-=== CRAM package installation === 
  
-Check out and compile all the necessary repositories.+If you don't have a ROS workspace, please create oneFor example, you can do the following:
  
 <code bash> <code bash>
-$ cd ~/workspace/ros_lisp/src+$ 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 Noetic Ubuntu 20.04) === 
 + 
 +Please checkout the [[https://github.com/cram2/cram/blob/devel/README.md|README]] on the devel branch of the [[https://github.com/cram2/cram/tree/devel|CRAM github repository]] for the most recent installation instructions. The noetic support is currently still in development. 
 + 
 +<code bash> 
 +$ sudo apt install ros-noetic-roslisp-repl 
 +$ sudo apt-get install python-rosinstall python-wstool 
 +$ cd ~/workspace/src
 $ wstool init $ wstool init
-$ wstool merge https://raw.githubusercontent.com/cram2/cram_projection_demos/master/cram.rosinstall+$ wstool merge https://raw.githubusercontent.com/cram2/cram/devel/cram-20.04.rosinstall
 $ wstool update $ wstool update
-$ cd ~/workspace/ros_lisp+$ cd ~/workspace/ 
 +$ rosdep update 
 +$ rosdep install --ignore-src --from-paths src/ -r 
 +$ catkin_make 
 +</code> 
 + 
 +=== CRAM and dependencies installation (ROS Melodic Ubuntu 18.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-melodic/cram-18.04.rosinstall 
 +$ wstool update 
 +$ cd ~/workspace/ros 
 +$ rosdep update 
 +$ rosdep install --ignore-src --from-paths src/ -r 
 +$ catkin_make 
 +</code> 
 + 
 +Note that the ''wstool update'' command is the one that downloads the source code of CRAM and its dependencies. 
 + 
 +For ROS melodic and the current packages, one thing needs to be fixed. The package ''octomap'' contains a dependency to a ROS2 package, which can be ignored. Open the ''package.xml'' of octomap. 
 +<code bash> 
 +roscd octomap 
 +sudo nano package.xml 
 +</code> 
 + 
 +Now remove the following line within: 
 +<code xml> 
 +<exec_depend condition="$ROS_VERSION == 2">ament_cmake</exec_depend> 
 +</code> 
 + 
 +The installation is finished, please continue to the section **Get ready for development** down below. 
 + 
 +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 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/ -r 
 +$ 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 update
 $ rosdep install --ignore-src --from-paths src/ $ rosdep install --ignore-src --from-paths src/
Line 141: Line 278:
 </code> </code>
  
-Note that the ''wstool update'' command is the one that downloads the source code of CRAM+Note that the ''wstool update'' command is the one that downloads the source code of CRAM and its dependencies such as KnowRob.
-Before executing this step you can edit your ''~/workspace/ros_lisp/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.+
  
 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). 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).
  
 +==== Windows Install ====
 +  - Enable Hardware Virtualization in your BIOS settings
 +  - [[https://medium.com/javarevisited/using-wsl-2-with-x-server-linux-on-windows-a372263533c3|Install, configure and launch VcXsrv]]
 +  - Enable the WSL 2 feature in ''Turn Windows features on or off'' 
 +  - Set Firewall to allow WSL comunication. Easiest way is by disabling Firewall for public networks, or add a rule for WSL.
 +  - [[https://seafile.zfn.uni-bremen.de/f/8960a515395f4a96b97b/|Download the WSL image]]
 +  - Import the image into WSL from Powershell with <code> wsl --import Ubuntu-20.04-Cram C:\Users\$env:UserName\Documents\Ubuntu-20.04-Cram C:\Users\$env:UserName\Downloads\Ubuntu2004RosCramJupyter.tar </code>
 +  - Set the image as default with <code>wsl --set-default Ubuntu-20.04-Cram</code>
 +  - Launch Ubuntu-20.04 from the windows menu. The username and password is ''cram''
 +  - ''glxgears'' will test the x-forwarding to VcXsrv. If nothing happens, check the VcXsrv setup and Firewall rules.
 +  - ''roslisp_repl &'' will launch Emacs.
 +
 +Happy hacking!
 +
 +=== How to launch the Jupyter Notebook ===
 +
 +  - ''roslaunch cram_pr2_pick_place_demo sandbox.launch &''
 +  - ''jupyter-lab --allow-root --no-browser --port 8888''
 +  - Open the URL in your browser
  
 ===== Get ready for development ===== ===== Get ready for development =====
Line 151: Line 306:
 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. 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 enjoy the repl animation ;)+Open your emacs and wait until "ROS welcomes you":
  
 <code bash> <code bash>