This ROS2 (Robot Operating System) package provides an interface for the KUKA Agilus KR6 R900-2 robot arm. It enables users to programmatically control the arm, facilitating the development of complex automation scripts and programs within the ROS ecosystem. The package is based on the KVP (KUKA Variable Protocol) for communication with the robot controller. It was originally inspired by:
-
kvp protocol
-
ROS2 Interface of the KUKA Agilus KR6 R900-2 arm
-
Tested on ROS2 Humble & Ubuntu 22.04
-
KVP protocol implementation for robot communication
-
ROS2 Humble
-
Ubuntu 22.04
-
KUKA Agilus KR6 R900-2 Robot Arm
-
KR C4 Compact controller
Try following the instructions in the links below. Better documentation is coming soon
You MUST log in as an Administrator in the Teach Pendant for the steps below.
This server is a TCP Server built on Visual Basic that allows connection between the Remote PC's client program (Custom ROS2 Node) and the controller's KVP space.
Read more about the server here.
-
Download the server from here
-
Copy it to a USB stick
-
The USB stick is then inserted in the Teach Pendant's USB Port
-
[Admin Role] On the Teach Pendant, go to
KUKA > Startup > Minimize HMI -
Use the File Explorer to view files in the USB. Copy the KUKAVARPROXY folder onto the Desktop
-
Click on the KukavarProxy.exe in the
src/directory -
In case you get an error (
cswsk32.ocx missing) follow the instructions here to resolve the issue. -
Additionally, you can add the server to Windows Startup Programs so that it starts automatically whenever the robot is powered up.
-
Click on the Controller Interface icon to return to the main interface for the upcoming steps.
-
The server communicates via TCP on Port 7000. Therefore, we must allow this port from the Controller so that external communication is allowed.
-
On the Teach Pendant, navigate to
Startup > NetworkConfiguration > NAT -
AddPort: 7000 TCP/UDP
This script reads from the KVP space and moves the robot arm to the target position if the current position is not equal to the target position.
-
The script in the
KRL/folder of this repository should be copied to a USB Stick -
The USB stick is then inserted in the Teach Pendant's USB Port
-
Copy the script to the location:
R/Program/ -
Click on the script, then press the
Selectoption that appears at the bottom of the Teach Pendant. -
Once done, proceed to setting up your PC or laptop (I'll refer to this as the Remote PC) by following the steps below.
-
We will come back to this script later on.
-
You have Ubuntu 22.04 installed on your system, or
-
You have an Ubuntu 22.04 docker container running.
-
A docker image with the necessary setup will be provided once ready.
mkdir -p robot_ws/src
cd robot_ws
colcon build
source install/setup.bash
cd robot_ws/src
# Clone Using HTTPS
git clone https://github.com/roboticsdojo/kuka_kvp_command_interface.git
# Or clone using SSH (If you have set up SSH)
git clone git@github.com:roboticsdojo/kuka_kvp_command_interface.git
rosdep install -y --from-paths . --ignore-src
# Build packages
cd ..
colcon build
- You are running the commands below in the Docker Container or Ubuntu 22.04 system with ROS2 Humble Installed and Sourced.
To use the package and its examples, you need to run several commands in different terminal sessions:
- Start the kuka_kvp_interface node:
ros2 run kuka_kvp_command_interface kuka_kvp_interface
- Send demo coordinates (we are sending different predefined joint positions):
ros2 run kuka_kvp_command_interface simulate_coordinates
-
For the robot to move to the different positions, the Start Key on the Teach Pendant needs to be pressed (if operating in T1 Mode)
-
Press and Release the Play Button to first initialize the arm's position
-
Press and Hold the Play button for the Robot Arm to move to the target positions (demo coordinates)
- Get live joint states from the arm
- Visualize the robot's movements (live joint states)
- Simulate the Robot in gazebo
Contributions are welcome! If you'd like to contribute to this project, please follow the guidelines outlined in the CONTRIBUTING.md file.
Whether it's reporting bugs, suggesting new features, or submitting pull requests, your help is greatly appreciated. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the Apache License 2.0. You are free to use, modify, and distribute this software under the terms of the license.
For more details, see the LICENSE file in the repository or visit the Apache 2.0 License page.
- Maintainer: Lenny Ng'an'ga
- X (formerly Twitter): @codewithlenny
- LinkedIn: Lenny Ng'ang'a
- Email: codewithlennylen254@gmail.com