ROS 2

First steps

  1. Install Ubuntu 24.04, upgrade all packages and reboot.

  2. Install ROS 2 Jazzy following the official instructions. Please use ros-jazzy-desktop and install the dev tools.

  3. Follow the installation instructions on the CRAM2 repository

Attention

Ubuntu 24.04 now defaults to the Gnome Wayland Session, which is currently not supported by any release of Open3D used by RoboKudo. To be able to run RoboKudo properly, you can use the Gnome X11 Session instead. To do so, you need to log out of your current session and enter the login screen of your user. Then press the little gear icon at the bottom right of the screen and select “Ubuntu on Xorg”. Now continue with the login process and you should be able to use 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

  • Download Pycharm for Linux from Jetbrains into your home directory.

  • Extract the archive to ~/pycharm-<version>:

    tar -xzf ~/pycharm-<version>.tar.gz -C ~/
    
  • Create a symlink to ~/pycharm.sh for convenience:

    ln -s ~/pycharm-<version>/bin/pycharm.sh ~/pycharm.sh
    
  • Start Pycharm:

    source ~/ros2_ws/install/setup.bash
    ~/pycharm.sh
    
  • Open the CRAM2 repository as by clicking Open on the welcome screen and selecting the location of your local CRAM2 repository.

  • Open the ROS2 workspace by clicking File then Open and select the location of your local ROS2 workspace. The select “Attach” in the popup.

  • In the folder view, right-click on build and select Mark Directory asExcluded. Repeat this for install and log.

  • Make pycharm use the venv if created in step 6 of First steps:

    • Go to FileSettingsProjectPython Interpreter.

    • Click on Add Interpreter and select Add local interpreter.

    • Select Select Existing, click on the small folder icon next to the current python path and select ~/.virtualens/cram-env/bin/python3.

    • Make sure to select the virtualenv interpreter as the default for the project.

  • Restart PyCharm before continuing.

Get data for development

Currently, we are working with the standard RoboSherlock tutorial bag file. Please download the ROS bag file from here to you ~/Downloads/ folder and unpack the archive:

curl https://robokudo.ai.uni-bremen.de/_static/test.tar.gz --output ~/Downloads/test.tar.gz

tar -xzf ~/Downloads/test.tar.gz -C ~/ros2_ws/

Pull test data to run the unit tests

To get the official test data for the pytests, please clone an additional repo into your workspace. It requires git-lfs installed. Make sure you installed it before.

cd ~/ros2_ws/src/
git clone https://gitlab.informatik.uni-bremen.de/robokudo/robokudo_test_data.git -b ros2_jazzy
cd robokudo_test_data
git lfs pull
cd ~/ros2_ws/
colcon build --merge-install

To run the tests, you can either use the terminal:

cd ~/ros2_ws/src/robokudo/robokudo/test
source ~/ros2_ws/install/setup.bash; python3 -m pytest

or execute it in PyCharm (see instructions in following section) by right-clicking the test folder and select Run ‘pytest in test’. If you use PyCharm and you’ve followed the instructions above to get the test data, make sure to close PyCharm, source your workspace setup.bash in the corresponding terminal and then re-open PyCharm.

Start development

  • Start PyCharm as explained above:

    source ~/ros2_ws/install/setup.bash
    ~/pycharm.sh
    
  • Open a new terminal and execute:

    ros2 bag play ~/ros2_ws/test --loop
    
  • Open a new terminal and execute:

    ros2 run robokudo_ros main _ae=demo
    

    Attention

    Ubuntu 24.04 now defaults to the Gnome Wayland Session, which is currently not supported by any release of Open3D used by RoboKudo. To be able to run RoboKudo properly, you can use the Gnome X11 Session instead. To do so, you need to log out of your current session and enter the login screen of your user. Then press the little gear icon at the bottom right of the screen and select “Ubuntu on Xorg”. Now continue with the login process and you should be able to use RoboKudo.

PyCharm Plugins

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

  • Grep Console

  • IdeaVim (for all the vim lovers)

  • Line Profiler