Installation

First steps

  • Install Ubuntu 20.04

  • Upgrade all packages after the installation

  • Reboot

  • Install ROS Noetic. You can follow the whole first chapter from the official docs: http://wiki.ros.org/noetic/Installation/Ubuntu . Please install ros-noetic-desktop-full .

  • In addition, install the following package to get catkin build functionality: sudo apt-get install python3-catkin-tools

  • Install the following package for later: sudo apt-get install ros-noetic-rqt-py-trees ros-noetic-ddynamic-reconfigure-python python3-venv

  • Create a ROS workspace called robokudo_ws for RK development:

source /opt/ros/noetic/setup.bash
mkdir -p ~/robokudo_ws/src
cd ~/robokudo_ws/
catkin build
source ~/robokudo_ws/devel/setup.bash
  • Clone the RoboKudo repo to your workspace:

cd ~/robokudo_ws/src/
# as a user:
git clone --recurse-submodules https://gitlab.informatik.uni-bremen.de/robokudo/robokudo.git
# or as a contributing developer with privileged access to the repo:
git clone --recurse-submodules git@gitlab.informatik.uni-bremen.de:robokudo/robokudo.git
  • Install the dependencies of RoboKudo:

cd ~/robokudo_ws/src/robokudo/
rosdep install --from-path . --ignore-src # If you get an error related to ddynamic-reconfigure-python, ensure you installed it in the first section of this manual and then go to the next command.

python3 -m pip install --upgrade pip
pip3 install -r requirements.txt

If the installation of the requirements.txt fails, please see the troubleshooting section at the bottom of the page for a possible workaround.

  • Build the Workspace again to get RK components compiled and source workspace:

catkin build
source ~/robokudo_ws/devel/setup.bash

Congratulations! You are now set and can head over to the first tutorial: Running a pipeline in RoboKudo.

If you want to setup a development environment with our recommended settings, continue with the following section. You can also do this step later.

IDE Setup

  • Go to https://www.jetbrains.com/pycharm/download/#section=linux . Download the Professional Edition and extract it. Put the pycharm folder in your home directory. It should be in a path like /home/YOURUSERNAME/pycharm-2021.3.2/ (depending on the downloaded version). Please note that versions after 2022.1.4 might contain a bug regarding package paths. Version 2023.2 works.

  • Create a symlink to the pycharm executable in your home (~/pycharm.sh) to start Pycharm. Make sure to adjust the path to your pycharm folder. The following is just an example path:

cd ~
ln -s ~/pycharm-professional-2021.2.3/pycharm-2021.2.3/bin/pycharm.sh
  • Start Pycharm from a terminal with ~/pycharm.sh where you have sourced your ROS workspace. This ensures that all the ROS paths are loaded properly.

source ~/robokudo_ws/devel/setup.bash
~/pycharm.sh
  • The next steps follow basically this tutorial from giskard: https://github.com/SemRoCo/giskardpy/wiki/PyCharm-Setup

  • Don’t create a new project, but rather ‘Open’ the complete RoboKudo Workspace. i.e. /home/YOURUSERNAME/robokudo_ws/

  • Go to File → Settings → Project: → Python interpreter

  • Click on the little cog icon next to the Project Interpreter and select ‘Add’. Create a new ‘Virtualenv Environment’ in /home/YOURUSERNAME/rk_venv . The BaseInterpreter can be left on the default (It should be the system python under /usr/bin/python3.X). Activate ‘Inherit global site-packages’.

  • Close the settings and go to ‘Python Console’ in the lower part of the Pycharm GUI. import rospy Should work there now.

  • In the project file explorer on the left, go to devel → lib → python3 → dist-packages. It should contain ‘robokudo_msgs’. Rightclick the dist-packages folder → ‘Mark directory as’ → Sources Root . Check out the giskard tutorial above to see a screenshot of that. If the python3 folder doesn’t exist, please make sure that you called catkin build in the previous step after cloning RoboKudo.

  • In the dist-packages folder of the previous step, mark all robokudo packages (except robokudo_msgs) as ‘Excluded’. This ensures to avoid naming conflicts.

  • Mark the ‘src’ directory of robokudo also as ‘Source’. Analogous to the previous step. The path should be robokudo_ws/src/robokudo/robokudo/src

  • Install/update the pip dependencies for your virtual environment. In PyCharm, go to File → Settings → Project: → Project interpreter, and install the following packages:

pytest
open3d
numpy # atleast version 1.22.2 must be installed for numpy.typing
pydot
scipy
pymongo
numba
pyyaml
  • Note: The current list of dependencies is the requirements.txt file in the root folder of this repo.

Get data for development

Currently, we are working with the standard RoboSherlock tutorial bag file. Please download the ROS bag file from here: test bag file and place it into your ~/Downloads/ folder.

Start development

  • Start PyCharm as explained above: Source your RoboKudo Workspace and start PyCharm with the shell script from the terminal:

source ~/robokudo_ws/devel/setup.bash # if you don't source it automatically in your .bashrc
~/pycharm.sh
  • Open a new terminal and execute:

roscore
  • Open a new terminal and execute:

rosbag play ~/Downloads/test.bag --loop
  • Open a new terminal and execute (behaviour tree visualization):

rosrun rqt_py_trees rqt_py_trees
  • In PyCharm, go to robokudo/robokudo/scripts/ and either ‘run’ or ‘debug’ main.py. If you would like to specify a specific Analysis Engine you want to run, supply the _ae parameter to the run configuration. Example: _ae=mydemo

PyCharm Plugins

Just a list of PyCharm plugins that might be useful for development:

  • Grep Console

  • IdeaVim (for all the vim lovers)

  • Line Profiler

Adding new RoboKudo packages and get autocompletion

RoboKudo is highly modularized. Much of its functionality is split between multiple packages. If you want to use more RoboKudo packages, please make sure to ‘exclude’ the package in the dist-packages folder and ‘mark as source’ the individual src/ folder in each package. This will get you proper autocompletion. Refer to the IDE Setup chapter on this page on how to do this.

Troubleshooting

If you get an error like ‘Import Error: No module named rospy’ when you try to verify your installation, using the import rospy command in PyCharm’s Python console, make sure that you have installed a supported PyCharm version, as version 2022.2.3 might not work properly. Download and use version 2023.2 from the JetBrains website instead.

When installing the python requirements for RoboKudo, you might encounter an issue that states: No matching distribution found for open3d>=0.15.2. In that case, you can try to avoid the package cache of pip to get the newest version of Open3D: python3 -m pip install --no-cache-dir --upgrade open3d. If this command is successful, you can try to execute the python requirements installation step again to get the remaining dependencies installed. If more requirements/dependencies couldn’t be installed, try the following command: python3 -m pip install --no-cache-dir --upgrade --ignore-installed numba numpy pytest pymongo matplotlib open3d.