This ROS1 (Robot Operating System) package provides an interface for the KUKA Agilus 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:
- kuka_kvp_hw_interface
- kvp protocol
- ROS1 Interface of the KUKA Agilus R900-2 arm
- Tested on ROS1 Noetic & Ubuntu 20.04
- KVP protocol implementation for robot communication
- ROS1 Noetic
- Ubuntu 20.04
- KUKA Agilus R900-2 robot arm and controller
- Tested on the KRC4 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 ROS1 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
Select
option 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 20.04 installed on your system, or
- You have an Ubuntu 20.04 docker container running.
- A docker image with the necessary setup will be provided once ready by clicking < here >
First, set up your ROS1 workspace:
mkdir -p robot_ws/src
cd robot_ws
catkin_make
source devel/setup.bash
Importance: getting the KUKA KR6 files e.g. URDF files used for robot_description
cd robot_ws/src
git clone https://github.com/ros-industrial/kuka_experimental.git
rosdep install -y --from-paths . --ignore-src
Importance: getting access to the robot's joint states
git clone https://github.com/itk-thrivaldi/kuka_kvp_hw_interface
rosdep install -y --from-paths . --ignore-src
# Remember to Edit params.yaml to your robot's IP Address
- Ensure that you've edited the
params.yaml
file in thekuka_kvp_hw_interface/config/
directory to include your robot's IP address.- For example: Change from the default address
10.0.0.1
to172.31.1.147
- For example: Change from the default address
Importance: This is the package of interest.
cd robot_ws/src
git clone https://github.com/codewithlennylen/kuka-kvp-command
rosdep install -y --from-paths . --ignore-src
# Build packages
cd ..
catkin_make
- You are running the commands below in the Docker Container or Ubuntu 20.04 system with ROS1 Noetic Installed.
To use the package and its dependencies, you need to run several commands in different terminal sessions:
-
Start the ROS master:
roscore
-
Send data (in the example provided, we are sending different predefined joint positions) to the robot via KVP:
rosrun kuka_kvp_command_interface send_to_robot
-
Send demo coordinates (joint positions):
rosrun 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:
roslaunch kuka_kvp_hw_interface test_joint_trajectory_interface.launch
-
Visualize the robot's movements:
rviz
- In RViz, set the map to base
- Click Plugins: add TF and Robot Model
- Maintainer: Lenny Ng'an'ga
- X (formerly Twitter): @codewithlenny
- LinkedIn: Lenny Ng'ang'a