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.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.shfor 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
Openon the welcome screen and selecting the location of your local CRAM2 repository.Open the ROS2 workspace by clicking
FilethenOpenand select the location of your local ROS2 workspace. The select “Attach” in the popup.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
~/.virtualens/cram-env/bin/python3.Make sure to select the virtualenv interpreter as the default for the project.
Restart
PyCharm Plugins¶
Just a list of PyCharm plugins that might be useful for development:
Grep Console
IdeaVim (for all the vim lovers)
Line Profiler Charm 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/
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.
Running unit tests¶
Follow the instructions from the CRAM2 repository to set up the test environment.
-
Running the tests is possible from the terminal:
source ~/ros2_ws/install/setup.bash workon cram-env pytest test/robokudo_test/
or from PyCharm by right-clicking the
test/robokudo_testfolder in directory view of PyCharm and selecting Run ‘pytest in robokudo_test’.
Warning
If you have a computer with many CPU cores the tests might run slower by default
when using pytest-xdist as it will use all available cores.
You can change the number of cores by providing the -n <number of cores>
flag in the pytest command:
pytest -n 4 test/robokudo_test/
You can also add this flag to the pytest command in the PyCharm run configuration
by right-clicking the robokudo_test folder and selecting “Modify Run Configuration…”
under the submenu “More Run/Debug”.
Simply add the -n <number of cores> flag to the “Additional arguments” field.
Installing additional RoboKudo packages¶
RoboKudo’s architecture allows for separate modules to be installed in addition to the main RoboKudo package. To install an additional package:
-
Clone the module repository to your ROS 2 workspace:
cd ~/ros2_ws/src git clone https://gitlab.informatik.uni-bremen.de/robokudo/robokudo-<module>.git
-
Build the workspace again to install the new package:
colcon build --merge-install
-
Source the workspace again to make the new package available:
source ~/ros2_ws/install/setup.bash
-
If necessary install the module’s dependencies:
pip install -r ~/ros2_ws/src/robokudo-<module>/requirements.txt