ROS 2¶
First steps¶
Install Ubuntu 24.04, upgrade all packages and reboot.
Install ROS 2 Jazzy following the official instructions. Please use
ros-jazzy-desktopand install the dev tools.-
Install RoboKudo apt dependencies and tooling:
sudo apt install ros-jazzy-py-trees ros-jazzy-py-trees-ros ros-jazzy-py-trees-ros-viewer ros-jazzy-compressed-image-transport ros-jazzy-image-transport ros-jazzy-image-transport-plugins git-lfs colcon
-
Creating a ROS 2 workspace:
-
Source the ROS 2 installation:
source /opt/ros/jazzy/setup.bash
Do this once per shell instance or automate this by adding the above line at the end of your
~/.bashrc. -
Create a ROS 2 workspace for RK development
mkdir -p ~/robokudo_ws/src cd ~/robokudo_ws colcon build --symlink-install source ~/robokudo_ws/install/setup.bash
The workspace has to be sourced after re-building it. However, by using the
--symlink-installoption all python scripts are symlinked instead of copied. This means that changes to python scripts will not require a rebuild of the workspace and thus also does not require sourcing it again. When changing C++ code, you will still have to rebuild and source the workspace.
-
-
Clone the RoboKudo repository into the workspace:
cd ~/robokudo_ws/src # as a user: git clone --recurse-submodules -b ros2_jazzy https://gitlab.informatik.uni-bremen.de/robokudo/robokudo.git # or as a contributing developer with privileged access to the repo: git clone --recurse-submodules -b ros2_jazzy git@gitlab.informatik.uni-bremen.de:robokudo/robokudo.git
-
Install python dependencies using pip:
sudo apt install virtualenvwrapper python3-pip echo "export WORKON_HOME=~/venvs" >> ~/.bashrc echo "source /usr/share/virtualenvwrapper/virtualenvwrapper.sh" >> ~/.bashrc source ~/.bashrc mkdir -p $WORKON_HOME mkvirtualenv robokudo --system-site-packages workon robokudo pip install -r ~/robokudo_ws/src/robokudo/requirements.txt
Execute
workon robokudoin every new shell to activate the virtual environment before running robokudo commands. -
Build the Workspace again to get RK components compiled and source workspace:
cd ~/robokudo_ws python3 -m colcon build --symlink-install
Using
python3 -m colconis necessary so that the correct python interpreter is used for ROS commands.
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.shfor convenience:ln -s ~/pycharm-<version>/bin/pycharm.sh ~/pycharm.sh
-
Start Pycharm:
source ~/robokudo_ws/install/setup.bash ~/pycharm.sh
Open the workspace as by clicking
Openon the welcome screen and selecting~/robokudo_ws.In the folder view, right-click on
buildand select Mark Directory as → Excluded. Repeat this forinstallandlog.-
Make pycharm use the venv if created in step 6 of First steps:
Go to File → Settings → Project → Python 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
~/venvs/robokudo/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 ~/robokudo_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 ~/robokudo_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 ~/robokudo_ws/
python3 -m colcon build --symlink-install
To run the tests, you can either use the terminal:
cd ~/robokudo_ws/src/robokudo/robokudo/test
source ~/robokudo_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 ~/robokudo_ws/install/setup.bash ~/pycharm.sh
-
Open a new terminal and execute:
ros2 bag play ~/robokudo_ws/test --loop
-
Open a new terminal and execute:
ros2 run robokudo 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