Kuka Setup and Startup Guide

Welcome to the Setup and Startup Guide for the Kuka robot.

Ubuntu System

The following instructions has been tested on Ubuntu 14.04 only.

  • You can get the 64 bits system here.
  • To create a bootable USB, please refer to information here.
  • You are recommended to partition the harddrive with the Disks that comes with Ubuntu. Otherwise, you might see this during installation:

    The partition * assigned to / starts at an offset of * bytes from the minimum alignment for this disk, which may lead to very poor performance.

Ubuntu doesn’t automatically use the nvidia driver. You can search for Additional Drivers to use them. You might need to setup the correct ppa

sudo add-apt-repository ppa:xorg-edgers/ppa -y
sudo apt-get update

ROS

The version indigo is used for Kuka. Basically, you just need to follow these instructions, or the following instructions copied below for your convenience.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update && sudo apt-get install dpkg
sudo apt-get install ros-indigo-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential

You are also recommended to get the catkin tools, the official installation guide is here:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install python-catkin-tools

Kuka ROS driver

You will need to install the Youbot ros driver, the instruction was referenced from here:

sudo apt-get install ros-indigo-youbot-driver

Next install the ros interface

sudo apt-get install ros-indigo-youbot-driver-ros-interface ros-indigo-youbot-description
sudo setcap cap_net_raw+ep /opt/ros/indigo/lib/youbot_driver_ros_interface/youbot_driver_ros_interface
sudo ldconfig /opt/ros/indigo/lib

If you see the error that libYouBotDriver.so cannot be found, run the command again:

sudo ldconfig /opt/ros/indigo/lib

Install moveit lib and other ros dependencies

sudo apt-get install python-wstool ros-indigo-roscpp ros-indigo-pluginlib ros-indigo-urdf \
  ros-indigo-tf-conversions ros-indigo-joint-state-publisher \
  ros-indigo-robot-state-publisher ros-indigo-xacro \
  ros-indigo-moveit-core ros-indigo-moveit-ros-move-group \
  ros-indigo-moveit-planners-ompl ros-indigo-moveit-ros-visualization
sudo apt install ros-indigo-moveit

Config the driver for arm-only

The driver installed is configed as a Youbot with a base, but we only have an arm. Two changes needs to be made, one is the launch file, and the other is the manipulator config.

Launch file

The launch file is youbot_driver.launch in the package youbot_driver_ros_interface. If you followed the previous installation instructions, it should be located at /opt/ros/indigo/share/youbot_driver_ros_interface/launch. You should create another launch file called youbot_driver_arm_only.launch, and copy and paste the file contents from youbot_driver.launch. Open youbot_driver_arm_only.launch

Change 1: modify line 16

from:

<param name="youBotHasBase" type="bool" value="true"/>

to:

<param name="youBotHasBase" type="bool" value="false"/>

Change 2: comment line 37

From:

<param name="youBotBaseName" type="str" value="youbot-base"/>

To:

<!-- <param name="youBotBaseName" type="str" value="youbot-base"/> -->

Change 3: comment line 43

From:

<remap from="base/joint_states" to="/joint_states"/> 

To:

<!-- <remap from="base/joint_states" to="/joint_states"/>  -->

Change 4: modify line 48

from:

<param name="robot_description" command="$(find xacro)/xacro.py '$(find youbot_description)/robots/youbot.urdf.xacro'"/>

to:

<param name="robot_description" command="$(find xacro)/xacro.py '$(find youbot_description)/robots/youbot_arm_only.urdf.xacro'"/>

Robot config file

The config file youbot-manipulator.cfg is located at /opt/ros/indigo/share/youbot_driver/config. You can just follow the following instructions from official instructions to modify it.

Basically, you just need to change the JointTopology (and do not modify anything else) to:

[JointTopology]
ManipulatorJoint1 = 1
ManipulatorJoint2 = 2
ManipulatorJoint3 = 3
ManipulatorJoint4 = 4
ManipulatorJoint5 = 5

Notice

The joint limits showed in http://www.youbot-store.com/wiki/index.php/YouBot_Detailed_Specifications does NOT match the actual joint limit. The actual joint limit should be (unit: degrees):

joint_1: 0 to (169 + 169)
joint_2: 0 to (90 + 65)
joint_3: -(146 + 151) to 0
joint_4: 0 to (102.5 + 102.5)
joint_5: 0 to (167.5 + 167.5)

Install IK solver and Youbot moveit

Create a folder to install all ros libs, the lib is called ros_lib_ws on the Kuka computer.

cd ~
mkdir ros_lib_ws
cd ros_lib_ws
mkdir src
catkin build

Then download the solver and youbot moveit

cd src
git clone https://github.com/ScazLab/youbot-manipulation.git
cd ..
catkin build

To work with the youbot moveit, you also need to update the urdf file of the robot. It is located at /opt/ros/indigo/share/youbot_description\robots\youbot_arm_only.urdf.xacro. Add the following to the end of the robot description:

  <link name="virtual_ee_link" />
  <joint name="virtual_ee_joint" type="fixed">
    <parent link="gripper_palm_link" />
    <child link = "virtual_ee_link" />
    <origin xyz="0.0 0.0 0.04" rpy="0.0 0.0 0.0" />
    <!-- <origin xyz="0.0 0.0 0.1445" rpy="0.0 0.0 0.0" /> -->
  </joint>

You will need to source ros_lib_ws so that ros can find it. You can add the information with echo, or you can edit the bash file with whatever text editor you like, in the example below, we used sublime

subl ~/.bashrc

and add source ~/ros_lib_ws/devel/setup.bash to the last line and save it

Kuka Gazebo Simulator

Documentation here

sudo apt-get install ros-indigo-ros-control ros-indigo-ros-controllers ros-indigo-gazebo-ros-control
cd ~/ros_lib_ws/src
git clone https://github.com/ScazLab/youbot_simulation.git
cd ..
catkin build

Note that we skipped cloning the description as in the documentation, as it was already installed in the previous step. And then run catkin build

To launch it, run (start in a new terminal):

roslaunch youbot_gazebo_robot youbot_arm_only.launch 

run the hello world program

Create your workspace

Please feel free to create the directory anywhere you want and with any names you like

mkdir -p ~/ros_devel_ws/src
cd ~/ros_devel_ws
catkin build

Later you can save all your projects in ros_devel_src . The same rules applies to the Kuka laptop.

echo "source ~/ros_devel_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

download the example

cd ~/ros_devel_ws/src
git clone https://github.com/wnowak/youbot_ros_samples

Since we don’t have a base, the example needs to be modified. Open the file youbot_ros_hello_world.cpp located at ~\ros_devel_ws_src\youbot_ros_examples\youbot_ros_hello_world\src

Comment out line 141:

// movePlatform();

Compile the code:

cd ~/ros_devel_ws/
catkin build

Run the example

Run it on a real robot arm

First start the robot:

roslaunch youbot_driver_ros_interface youbot_driver_arm_only.launch

Then run the example:

rosrun youbot_ros_hello_world youbot_ros_hello_world

Other

The screws on the grippers

It is M4-10 or M4-12 hex socket head cap screws. The ones that are slightly longer also works, such as M4-16 as long as the extra part doesn’t matter.

Change the grasp force

Changing StallGuard2Threshold in the config file (…./youbot_driver/config/youbot-manipulator.cfg). It is a value between -63 to 64. reference is here: https://janpaulus.github.io/dd/d6c/classyoubot_1_1_stall_guard2_threshold.html

use API without ROS example

[https://janpaulus.github.io/da/d1b/usage.html]

If import youbot lib doesn’t work, and gives the osal.h error, change # include <osal.h> to #include </opt/ros/indigo/include/youbot_driver/soem/osal/osal.h> in youbot-driver.

Install Kuka on Ubuntu 18

I was not be able to get this part to work, as both ros and the kuka driver has to be run with super user privilige, as it needs to access a port < 1024.

### Driver Installation

Assuming ros melodic has been installed. Install moveit if you haven’t:

sudo apt-get install ros-melodic-moveit

Instructions on install melodic and moveit can be found https://scazlab.github.io/ur5e_setup_guide.html.Get the robot driver and kuka ros interface, and build from source

cd ~/ros_lib_ws
git clone https://github.com/ScazLab/brics_actuator.git
git clone https://github.com/ScazLab/pr2_msgs.git
git clone https://github.com/ScazLab/youbot_driver.git
git clone https://github.com/ScazLab/youbot_description.git
git clone https://github.com/ScazLab/youbot_driver_ros_interface.git
git clone -b melodic https://github.com/ScazLab/youbot-manipulation.git
cd ..
catkin build

### Simulator Installation

Install the controllers if you haven’t:

sudo apt-get install ros-melodic-ros-control ros-melodic-ros-controllers ros-melodic-gazebo-ros-control

Then install the simulator with:

cd ~/ros_lib_ws/src
git clone https://github.com/ScazLab/youbot_simulation.git
cd ..
catkin build

References

Kuka official documentation: http://www.youbot-store.com/wiki/index.php/Software

Useful link: https://github.com/LCAS/lincoln_youbot

Collaboration

  • Please edit this file to add things you think are going to be useful. You can edit it by modifying this file

Dissertation Guide

Guide for the dissertation process and paperwork needed Continue reading

Hello Stretch Setup Guide

Published on January 22, 2021

Azure Kinect Setup and Startup Guide

Published on August 31, 2020