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
Next revisionBoth sides next revision
tutorials:pycram:setup [2021/07/16 10:52] jdechtutorials:pycram:setup [2022/02/01 15:34] jdech
Line 8: Line 8:
 All dependencies are available via PyPi All dependencies are available via PyPi
  
-PyCRAM is developed and tested with Python3.8, Ubuntu 20.04 and ROS Melodic.+PyCRAM is developed and tested currently with Python3.8, Ubuntu 20.04 and ROS Noetic. However, it does still support Ubuntu 18.04 and ROS Melodic. Please see below for installation instructions for both variants.
  
 ===== Installing ROS ===== ===== Installing ROS =====
Line 14: Line 14:
 For information on how to install ROS please referee to the offical documentation [[http://wiki.ros.org/ROS/Installation | here]].   For information on how to install ROS please referee to the offical documentation [[http://wiki.ros.org/ROS/Installation | here]].  
  
-===== Dependencies ===== +===== PyCRAM on Ubuntu 20.04 (ROS Noetic) =====
-To install PyCRAM firstly the required packages must be installed. These are:  +
-    * Pip +
-    * CRAM/kdl_ik_service +
-    * pybullet +
-    * Pathlib +
-    * numpy +
-    * urdfpy +
-    * graphviz +
-    * urdf-parser-py +
- +
-Firstly Pip needs to be installed, on Ubuntu this can be done vie the following command: +
-<code>sudo apt-get install python3-pip</code> +
- +
-PyCRAM uses the the KDL Inverse Kinematic service of CRAM, to use the IK service CRAM needs to be installedFor instructions on how to install CRAM click [[../../installation | here]]. +
- +
-The rest can be installed using Pip by typing the following command into a terminal: +
-<code>pip3 install <DEPENDENCY> </code> +
- +
-===== PyCRAM =====+
 To get PyCRAM simply clone the repository with the following command into your ROS workspace: To get PyCRAM simply clone the repository with the following command into your ROS workspace:
 <code> <code>
Line 46: Line 27:
  
 The cloned repository contains the source code for PyCRAM as well as two short demos which demonstrate how to use it.  The cloned repository contains the source code for PyCRAM as well as two short demos which demonstrate how to use it. 
 +
 +
 +===== Python Dependencies =====
 +To install the Python dependencies Pip is used. To install Pip type the following command into a terminal. 
 +<code>
 +sudo apt-get install python3-pip
 +</code> 
 +
 +Now the actual Python packages can be installed, these are summarized in the requirements.txt in the PyCRAM repo. 
 +For this first navigate to your PyCRAM repo. 
 +<code>
 +cd <path-to-your-pycram-repo>
 +</code>
 +Then install the Python packages in the requirements.txt file 
 +<code>
 +sudo pip install -r requirements.txt
 +</code>
  
 ===== Building your ROS workspace =====  ===== Building your ROS workspace ===== 
Line 57: Line 55:
 </code>  </code> 
  
-===== PyCRAM on Ubuntu 18.04 =====+===== PyCRAM on Ubuntu 18.04 (ROS Melodic) =====
 To be able to use PyCRAM on Ubuntu 18.04 you need a few extra steps because ROS melodic doesn't fully support Python 3. The first thing you need to do is install Python3 pip. To be able to use PyCRAM on Ubuntu 18.04 you need a few extra steps because ROS melodic doesn't fully support Python 3. The first thing you need to do is install Python3 pip.
-<code> +<code>
 apt-get install python3-pip apt-get install python3-pip
 </code>  </code> 
Line 69: Line 67:
 ==== Build Tf for Python 3 ==== ==== Build Tf for Python 3 ====
 Firstly you need to clone the geometry and geometry2 repos into your ROS workspace and select the melodic branches. Firstly you need to clone the geometry and geometry2 repos into your ROS workspace and select the melodic branches.
-<code> +<code>
 cd ur_ros_ws/src cd ur_ros_ws/src
 git clone git@github.com:ros/geometry.git git clone git@github.com:ros/geometry.git
Line 75: Line 73:
 git checkout melodic-devel git checkout melodic-devel
 cd .. cd ..
-git clone git@github.com:ros/geometry2.git +git clone git@github.com:ros/geometry2.git 
 +cd geometry2 
 git checkout melodic-devel git checkout melodic-devel
 </code> </code>
Line 91: Line 90:
 <code> <code>
 echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc && echo "source $(pwd)/devel/setup.bash" >> ~/.bashrc echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc && echo "source $(pwd)/devel/setup.bash" >> ~/.bashrc
 +</code>
 +
 +==== Build PyKDL for Python 3 ====
 +Now you need to build PyKDL as well as kdl_parser_py for Python 3.  This is done in two distinctive steps, first build orocos_kdl using cmake outside of your catkin workspace and then building your catkin workspace containing PyKDL and kdl_parser_py for Python 3. 
 +First clone the orocos kinematics dynamicas Repo, outside of your catkin workspace.
 +<code>
 +git clone git@github.com:orocos/orocos_kinematics_dynamics.git
 +</code>
 +Now build the orocos_kdl library, by pasting the following commands in a terminal. 
 +<code>
 +cd orocos_kinematics_dynamics/orocos_kdl
 +mkdir build
 +cd build
 +cmake ..
 +make
 +sudo make install
 +</code>
 +
 +Now all you have to do is copy the PyKDL package from the orocos kinematics dynamics folder to your catkin workspace, clone the kdl_parser_py and build. 
 +<code>
 +cd orocos_kinematics_dynamics
 +git submodule update --init
 +cp python_orocos_kdl path/to/your/catkin/workspace 
 +cd <path to yourt catkin workspace>/python_orocos_kdl
 +cd ../
 +</code>
 +This will copy python orocos kdl into your catkin workspace and clone the submodules contained in the repo. Now we have to clone the kdl_parser_py and build.
 +<code>
 +git clone git@github.com:ros/kdl_parser.git
 +cd ../..
 +catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3.6
 </code> </code>