Skip to content

Creating/Formatting a ROS2 Workspace for KUKA LBR iiwa 7 R800 via FRI

Note: the steps to create this working environment may change as both the LBR FRI ROS2 Stack and MItHRIL's VR-HRI workspaces are currently under development. Last updated 17-07-2024.

This tutorial runs through the steps to create and format a ROS2 workspace compatible with the LBR FRI ROS2 Stack and MItHRIL's VR-HRI codebase. It assumes:

  • you are using Ubuntu 22.04 LTS;
  • you have basic knowledge of ROS2, packages, workspaces, bash files, and other fundamental ROS2 concepts;
  • you have ROS2 Humble installed on your computer;
  • you have sufficient storage space to download new packages; and
  • you have git, rosdep, and colcon installed.

To begin, create a "Devel" folder within root to store all workspaces:

mkdir Devel && cd Devel

Part 1: LBR FRI ROS2 Stack

This is more of a "back-end" that doesn't get touched very often. From within the "Devel" folder:

1. Install ROS 2 development tools

sudo apt install ros-dev-tools

2. Create a workspace, clone, and install dependencies

source /opt/ros/humble/setup.bash
export FRI_CLIENT_VERSION=1.15
mkdir -p lbr-stack/src && cd lbr-stack
vcs import src --input https://raw.githubusercontent.com/lbr-stack/lbr_fri_ros2_stack/humble/lbr_fri_ros2_stack/repos-fri-${FRI_CLIENT_VERSION}.yaml

3. Add a package missing from lbr-stack, needed for compatibility between the lbr-stack workspace and the lbr-fri-ros2-ws workspace created below:

cd src  # you should be in Devel/lbr-stack/src after this command
git clone https://github.com/lbr-stack/fri_vendor.git

4. Build and source

cd ..  # back to the root of the lbr-stack workspace
rosdep install --from-paths src -i -r -y
colcon build --symlink-install
source install/setup.bash

5. Add to bashrc so lbr-stack executables are available in every new terminal:

echo "source ~/Devel/lbr-stack/install/setup.bash" >> ~/.bashrc

Part 2: lbr-fri-ros2-ws

This houses the "front end" files that communicate through ROS2 to the lbr-stack created above. Create a directory under Devel:

cd && cd Devel
mkdir lbr-fri-ros2-ws && cd lbr-fri-ros2-ws
mkdir src && cd src

Clone the following workspaces from GitLab (note: at the time of writing, some active development repos are branched, hence the -b syntax; if a branch no longer exists, check the latest repos in development for the most accurate files):

git clone -b Summer2024 https://code.smithengineering.queensu.ca/mithril/robot-kuka/vr-hri.git
git clone -b Summer2024 https://code.smithengineering.queensu.ca/mithril/ros2-tools/data-bridges.git
git clone https://code.smithengineering.queensu.ca/mithril/ros2-tools/ros2-realtime-tools.git
git clone https://code.smithengineering.queensu.ca/mithril/robot-kuka/kinematics.git

Build:

cd ..  # you should be in ~/Devel/lbr-fri-ros2-ws
colcon build

Source and add to bashrc:

source install/setup.bash
echo "source ~/Devel/lbr-fri-ros2-ws/install/setup.bash" >> ~/.bashrc

Once this is done, you should be able to run the demos on the real robot.