Skip to content
Salvo Virga edited this page Aug 26, 2016 · 54 revisions

HOME

This wiki aims to give all the information needed to use and extend the ROS packages for the KUKA IIWA LWR.

It is aimed to readers familiar with both ROS and KUKA's Sunrise Workbench and Robotics API. This wiki might briefly introduces some concepts from both frameworks, but it doesn't want to replace their original documentation. Therefore, please refer to their respective documentation if needed.

Overview

The KUKA LBR IIWA redundant manipulator is programmed using the KUKA's Sunrise Workbench platform and its Java APIs.
A Sunrise project, containing one of more Robotic Application, can be synchronized to the robot cabinet and executed from the SmartPad.

Within this software package you will find two Robotic Applications that can be used with the robot.
They establish a connection with an external machine connected via Ethernet to the robot cabinet using ROS.
The external machine, having ROS installed, will be able to send and receive ROS messages to and from the aforementioned Robotic Applications.
We make use of ROS messages already available in a mint ROS distribution as well as custom ones, made to work with the KUKA arm (iiwa_msgs).
A user is then able to manipulate the messages received from the robot and to send new ones as commands to it, simply within C++ or python code, taking leverage of all the ROS functionalities.

In this wiki we will refer to the ROSCORE side for the external machine equipped with ROS and to the SUNRISE side for anything included in robot cabinet. The following image shows a schematic overview of the system architecture :

system overview

Setup

IMPORTANT : A version of Sunrise Workbench with the Sunrise.Connectivity module is required to use this stack. Read more about it here.

First of all, you need to allow the comunication between SUNRISE and ROSCORE :
SUNRISE
ROSCORE

Then, synchronize our Robotic Applications on your robot :
SUNRISE PROJECT

Safety Configuration

❗ SAFETY FIRST! ❗
An industrial robot is not a toy and you may harm yourself due to misuse. In general, it is a good practice to test your code in T1 mode and have your hand close to the emergency stop. More on safety can be found in the manuals given out by KUKA, you should read them carefully before using the robot.
Within a Sunrise Project is possible to set a Safety Configuration for the robot. This should be done properly, following the KUKA manuals and your needs.
In industrial scenario a technician should be responsible for it.

We are no industrial safety experts and we don't take any responsibility about the Safety Configuration you are going to use. What we can do, however, is to show you what we use and why. You could take our settings as a starting point, but we don't guarantee it is optimal for you. The file for the Safety Configuration varies along different versions of Sunrise OS, so we are not able to share the file itself.

Our Safety Configuration

Use with a real robot

After the setup is done there should be (at least) two Robotics Applications installed on the robot.

Noted : These applications requires to have an instance of ROS running on the machine connected to the cabinet. That basically means running a roscore or a launch file with a rosnode on a terminal.

Here is what the applications allow to do once they are started from the robot's SmartPad :
ROSMonitor
ROSSmartServo

Since it's quite unlikely for any user to want to control the robot without attaching any tool to it, we show now how to extend the iiwa_stack for that.
You will have to create small ROS packages that make use of iiwa_stack.
For educational purpose, we created an additional repository that simulate that.

HERE you can find the exemplary packages.

  • iiwa_tool_description : shows how to define a URDF to work with a robot equipped with a tool.
  • iiwa_tool_moveit : shows how to use the URDF defined above with MoveIt!
  • iiwa_tool_examples : contains small and trivial examples on how to control the robot.

Step-by-step, we will:
Attach a tool to the robot - Create a new robot definition
Create a MoveIt! package with the new robot definition (Optional, but recommended.)

With that done, we will now show how to access the robot state and control it via ROS Nodes (C++/Python).
That means having your code running on the ROSCORE machine, while ROSMonitor or ROSSmartServo are running on the SmartPad.
We will only cover the common usage alongside ROSSmartServo, as ROSMonitor use is limited and it is already tackled in its wiki page. Remember that ROSSmartServo basically contains ROSMonitor, the functionalities of the second are also inside the first.
Once you start ROSSmartServo, you probably want to :
Read the robot state
Command the robot
Command the robot using MoveIt!
Setting a ControlMode at runtime

Extra :
Naming your robot - TODO
Work with multiple robots - TODO
Add a new message to iiwa_msgs

Simulation

Simulation with Gazebo is works for both iiwa model using Position controllers.
The inertia values in the URDF are not accurate.
You can run :
roslaunch iiwa_gazebo.launch model:=[iiwa7|iiwa14]
to load the robot into Gazebo with an empty world, you can follow the includes in the launch file to modify it to your needs.

FAQs / Troubleshooting

Which version of Sunrise.OS/Sunrise Workbench is supported?
I have Sunrise version x.x.x, can I downgrade to a previous version?
Is Gravity Compensation mode supported?
Are the inertia values in the URDF accurate?
Launching roscore or a launch file nothing happens
I can read the state of the robot, but it doesn't move when I send commands
Other useful Robotic Applications that you might want to have on the robot
...

Contacts

Salvatore Virga : [email protected]
Marco Esposito : [email protected]

Clone this wiki locally