ROS Wrapper

From youBot wiki
Jump to: navigation, search

The ROS wrapper of the youbot driver (or KUKA youBot API) provides an interface of the youbot driver to the ROS framework. With this wrapper you can move the base and the arm of the youBot by sending ROS messages. The proprioceptive sensor measurements like odometry and joint angles of the youBot arm and the wheels are published on ROS topics.

ROS Indigo

Installation

Debian packages

First you need to install ROS Indigo as it is described in [1] We recommend to use the ros-indigo-desktop or a more complete version.

To install the youBot API wrapper enter in a command shell

 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

The first line will install the required dependencies as well, in particular

  • ros-indigo-youbot-driver for the KUKA youBot API itself and
  • ros-indigo-brics-actuator for the ROS messages to control the youBot arm

The configuration files for the youbot driver are stored in the folder /opt/ros/hydro/shared/youbot_driver/config

ROS Hydro

Installation

Debian packages

First you need to install ROS Hydro as it is described in [2] We recommend to use the ros-hydro-desktop or a more complete version.

To install the youBot API wrapper enter in a command shell

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

The first line will install the required dependencies as well, in particular

  • ros-hydro-youbot-driver for the KUKA youBot API itself and
  • ros-hydro-brics-actuator for the ROS messages to control the youBot arm

The configuration files for the youbot driver are stored in the folder /opt/ros/hydro/shared/youbot_driver/config


Installation by source

You are free to compile and change the source code of the driver and the ROS wrapper yourself.

It is not required to uninstall the youbot driver and the ROS wrapper if installed from the debian packages. Nevertheless you still may want to do that in order to avoid possible confusion:

 sudo apt-get remove ros-hydro-youbot-driver

If not already done, create a catkin workspace that will hold the youBot ROS packages (see the catkin documentation for more information). In the following we assume the workspace folder as ~/catkin_ws. If you chose another folder just adatpt the following instructions accordingly.

In order to checkout the KUKA youBot API and the wrapper into the catkin workspace, to compile and set the required rights for EtherCAT access, enter

 cd ~/catkin_ws/src
 git clone http://github.com/youbot/youbot_driver.git -b hydro-devel
 git clone http://github.com/youbot/youbot_driver_ros_interface.git -b hydro-devel
 cd ..
 catkin_make
 sudo setcap cap_net_raw+ep devel/lib/youbot_driver_ros_interface/youbot_driver_ros_interface

In this setup, the configuration files for the youBot driver are stored in the folder ~/catkin_ws/src/youbot_driver/config

Usage

To start the driver and the wrapper open a terminal and enter the following command:

roslaunch youbot_driver_ros_interface youbot_driver.launch

The driver should now try to detect the youBot's EtherCAT slaves. If any error occurs check here for possible solutions.

For moving the arm you can enter in another terminal (while the wrapper keeps running)

rostopic pub /arm_1/arm_controller/position_command brics_actuator/JointPositions '{positions:[ {joint_uri: arm_joint_1, unit: rad, value: 1.0}]}'

This will turn the first joint a little bit.

Two test programs come with the wrapper in addition. A keyboard teleoperation:

 rosrun youbot_driver_ros_interface youbot_keyboard_teleop.py

and a test program to set all joints

 rosrun youbot_driver_ros_interface youbot_arm_test

ROS Groovy

see youBot OODL


ROS Fuerte / Electric

Installation

This install guide assumes that ROS is already installed, preferably the Ubuntu package based installation for Ubuntu 10.04, as described in http://www.ros.org/wiki/electric/Installation/Ubuntu. The ros-electric-ros-base installation will be sufficient. The KUKA youBot OODL API is required as well. To install the wrapper issue these commands:

    $ sudo apt-get install ros-electric-pr2-controllers # required for trajectory_msgs
    $ mkdir ~/ros_stacks   # (if not done already)
    $ cd ~/ros_stacks
    $ git clone https://github.com/youbot/youbot-ros-pkg.git
    $ git clone git://github.com/ipa320/cob_common.git 

In case ~/ros_stacks (the folder you have chosen to place the youbot-ros-pkg) has not yet been added to the $ROS_PACKAGE_PATH, you need to add this directory, by appending it in the /opt/ros/electric/setup.sh and either restarting the terminal window or typing:

$ source /opt/ros/electric/setup.bash 

You can check if it works if the command roscd youbot_oodl goes to the youbot_oodl folder. To compile the wrapper driver use rosmake:

 $ rosmake --rosdep-install youbot_oodl

Usage

To start the driver you have to open a terminal window and start the roscore:

  $ roscore

Then open another terminal and go to the launch folder of the youbot oodl driver (e.g. by typing roscd

youbot oodl/launch) and use the start script:

  $ roslaunch youbot_oodl youbot_oodl_driver.launch
    $ roslaunch youbot_oodl youbot_joint_state_publisher.launch

Please note, that currently there is no roslaunch file because the driver needs root permissions for the EtherCAT access.

The youbot_oodl package comes with two simple example applications. The first one is a keyboard based teleoperation application for the base. You can start it with:

 $ rosrun youbot_oodl youbot_keyboard_teleop.py

The following keys can be used to move the KUKA youBot:

       u      i     o
       j      k     l
       m      ,     .

Where as i means forward, , backwards, j left, l right, m turn left on spot, . turn right on spot, u move an left-sided arc and o an right-sided arc. All other keystrokes will stop the KUKA youBot.

The second sample application allows to set joint angles for an arm. It asks for values for each arm. When all values are specified, the command will be executed. You can start the sample with:

  $ rosrun youbot_oodl youbot_arm_test

Further documentation on the wrapper can be found in the KUKA youBot User Manual.


Go back to Software