Youbot driver

From youBot wiki
Jump to: navigation, search

The youBot driver consists of C++ classes that provide low-level access to the KUKA youBot hardware. It implements an EtherCAT master based on the free SOEM library, tailored to the specific EtherCAT protocol of the youBot.

The C++ interface provided by the youbot driver is also called KUKA youBot API. Originally it was called OODL (Object Oriented Device Layer), being developed in the European research project BRICS. So a little bit simplified you can remember: youbot-driver = KUKA-youbot-API = OODL.

For ROS a wrapper of the driver exists that allows to control the robot via ROS messages see ROS Wrapper.


Installation

Windows

Windows support for the youbot driver has been added only recently, so some things may be still subject to change.

Requirements

  • Windows XP/Vista/7
Other Windows versions could work as well, but were not tested so far.
  • Visual Studio / Visual C++
We tested with Visual Studio 2010 and 2013. The free Express versions are sufficient, compiler is needed only for C++.
  • CMake, version 2.8 or above:
Installation using the Win32 installer may be most convenient. During installation you are asked if you want to add CMake to the system PATH. Choose yes (for all or current user) to make the following steps a bit easier. Though, if you don't want to clutter your PATH variable, just add the full path to the CMake binary when calling "cmake" in a shell.
  • Boost, version 1.48 or above:
The easiest way for installation is to download the precompiled files from http://sourceforge.net/projects/boost/files/boost-binaries/
You might want to change the proposed installation folder from "C:/local" to your program files folder.
This library provides lowlevel access to the network adapter required for the EtherCAT master. As WinPcap installs a Windows driver, you don't need administrator rights later to start youbot programs (in contrast to Linux).
Unzip the downloaded file into your program files folder, (depending on your system) e.g. to C:\Program Files (x86)\WpdPack. If done right, there should be (amongst others) a file C:\Program Files (x86)\WpdPack\Include\pcap.h

Installation (without ROS)

  • Get youBot driver sources
Checkout or download the driver from
https://github.com/youbot/youbot_driver/tree/cmake
into any folder on your harddisk. Download might be the quicker option if you don't have already git installed.
  • To download: On that webpage there is a "Download zip" link which you can use to get the files; then you have to extract them. Change the folder name from "youbot_driver-cmake" to "youbot_driver"
  • To checkout: Enter "git clone http://github.com/youbot/youbot_driver -b cmake" in a terminal.
  • Generate Visual Studio project file
Open a console (e.g. type "cmd" into the search field of the start menu) and change into the youbot driver folder. Assuming you downloaded (or checked out) the driver into the folder "D:\", this is as follows:
 cd d:\youbot_driver
 mkdir build
 cd build
 cmake ..
If no errors occured, you should see at the end of the output something like
 -- Configuring done
 -- Generating done
 -- Build files have been written to: D:/youbot_driver/build
This has generated the file youbot_driver.sln (described as "Microsoft Visual Studio Solution" file) in the folder listed above.
  • Compile the driver
Open the .sln file generated above, for example by double-clicking in a file browser. It should open the project in Visual Studio.
In Visual Studio, select menu "Build/Build solution" (or press F7) in order to compile the driver. You will see several warnings, but if all runs well there should be no errors.
This should create in particular the file youbot_driver/build/Debug/YouBotDriver.lib
  • Determine the network adapter id
The step is described at Find network adapter ID for youbot driver on Windows
  • Install in Program Files folder
This step is optional, but can make later use easier. In order to install in the Program Files folder, you need administrator rights.
  • Either start Visual Studio as administrator as described here
  • Or create the target folder manually under C:\(your program files folder)\youbot_driver and give complete access rights to that folder to your normal account.
Afterwards, in Visual Studio right click on the "INSTALL" project in the Solution Explorer View and select Build.


Ubuntu with ROS Indigo

The easiest way is to install as debian package. In a terminal enter

 sudo apt-get install ros-indigo-youbot-driver
 sudo ldconfig /opt/ros/indigo/lib

If you installed ROS in a non-default location the last line must be changed accordingly. That line is still required unfortunately up to now to let other executables find the driver's library.


Ubuntu with ROS Hydro

The easiest way is to install as debian package. In a terminal enter

 sudo apt-get install ros-hydro-youbot-driver
 sudo ldconfig /opt/ros/hydro/lib

If you installed ROS in a non-default location the last line must be changed accordingly. That line is still required unfortunately up to now to let other executables find the driver's library.

Alternatively you can also download and compile the source code of the driver as described below.

To do that, create a catkin workspace and in a terminal change to the catkin's src folder. Then type

 (cd into the workspace/src folder)
 git clone http://github.com/youbot/youbot_driver -b hydro-devel
 cd ..
 catkin_make

Ubuntu with ROS Groovy

Debian package

A debian package for Groovy has been provided by WPI. You can install it by entering in a terminal

 sudo apt-get install ros-groovy-youbot-driver
 export YOUBOT_CONFIG_FOLDER_LOCATION=/opt/ros/groovy/etc/youbot_driver/config/

You might want to copy the last line into the file ~/.bashrc, otherwise you will have to repeat it in every new terminal.

In contrast to installing for the other ROS distributions, the Groovy install will also setup an udev rule for Hokuyo laser scanners. See here for more information on this.

Source install

Create a catkin workspace, in a terminal cd into its src folder and enter

 git pull http://github.com/WPI-RAIL/youbot_driver.git
 cd ..
 catkin_make


Ubuntu with ROS Fuerte or ROS Electric

First you have to download the source files into any folder as following:

 git clone https://github.com/youbot/youbot_driver.git

You need to add the youbot_driver folder that was just created to the $ROS_PACKAGE_PATH environment variable, so that ROS can find this directory (for more information see KUKA-youBot-UserManual, chapter 8.1.1). After that you can compile the driver as follows:

 rosmake youbot_driver


Raspberry PI

The youbot driver has been tested only under Wheezy with ROS Indigo, though other setups should work as well. In any case you need to install the driver by source, there are no precompiled packages for the Raspberry.

If you installed ROS Hydro or ROS Indigo on the Raspberry, just follow the instructions above under ROS Indigo.

If you installed an older version of ROS (Electric, Fuerte, Groovy), follow the instructions above for the respective ROS version on how to download the driver source files. Before compiling, you will have to change two files:

  • For ROS Electric/Fuerte, these are in (youbot-driver-root-dir)/src/generic/dataobjectlockfree/os
  • For ROS Groovy, these are in (youbot-driver-root-dir)/include/youbot_driver/generic/dataobjectlockfree/os
  • In that folder, replace the file oro_arch.h with this one.
  • Create a new folder ...dataobjectlockfree/os/oro_arm and copy this file into that folder (also with name oro_arch.h).

Afterwards you can compile the driver as described for the respective ROS version.

You can also compile the driver using its cmake branch if you don't want to install/use ROS.

Usage

For using with ROS, see ROS Wrapper.

For C++ example code that uses the youbot driver (using ROS as compile-tool) see C++ Hello World example.

For a C++ example under Windows, without ROS, see Youbot_Windows_demo


Go back to Software