Note: This tutorial assumes that you have completed the previous tutorials: Upgrading the Kuka youBot to Fuerte.
(!) Please ask about problems and questions regarding this tutorial on Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Adding a User and Installing their Local Drivers

Description: This tutorial explains how to create a new user on the youBot and install the drivers on their local account.

Keywords: youBot, youBot Drivers, youBot Users

Tutorial Level: BEGINNER

Creating the User and Assigning Groups

The first step in adding a new user to your Kuka youBot is to create the user profile and assign them the appropriate groups. From your local account (most likely the pre-installed youbot account), enter the following command to create the user:

  • sudo adduser <username>

After entering the appropriate information (e.g., password, full name), you will want to assign them to their groups. This is required if, for example, you want to grant your new user sudo access. In many cases, you are creating a new admin account and want to assign the new user to the same groups as other administrators. Note that in order to initialize the motors on the youBot, sudo access is required. To see a list of the groups an admin belongs to (e.g, the youbot account), simply enter the following command:

  • groups <admin-username>

Once you have decided on the groups you user will belong to, issue the following command with a comma-separated list of groups:

  • sudo usermod -a -G <list,of,groups> <username>

Installing the youBot Drivers on a Local User Account

Once the user is created, you will be able to login to the account. However, since the youBot ships with its drives installed locally on each account, you will need to manually re-install the drives on the accounts. Assuming you have ROS installed (see the previous tutorial for instructions on upgrading the youBot to Fuerte), this process is straightforward. To do so, move to your local ROS package directory, download the drives, and use rosmake to build them.

Note that before you can user ROS with this new user, you will have to edit the users .bashrc file to export the appropriate environment variables as defined in the installation notes. To do so, edit the .bashrc file (located in the user's home directory) and add the following lines. Be sure to have a dedicated location where you will download and maintain your local ROS packages (e.g., /home/<username>/ROS). This directory is referenced as /path/to/your/ros/packages in the following instructions.

  •    1 source /opt/ros/fuerte/setup.bash
       2 export ROS_PACKAGE_PATH=/path/to/your/ros/packages:$ROS_PACKAGE_PATH
       3 export ROS_WORKSPACE=/path/to/your/ros/packages

Once the file is saved, you can re-initialize your shell session with the following command:

  • . ~/.bashrc

Now you are ready to download and install the required youBot drivers.

  •    1 cd /path/to/your/ros/packages
       2 git clone
       3 roscd youbot_driver
       4 rosmake youbot_driver

Once finished, your youBot should have all the necessary drivers installed to control the arm and the base. To test your installation, you can execute the youBot test code provided with the drivers. Note that this test will moved both the base and the arm. It is recommended that you raise the youBot up so that its wheels are floating and make sure the arm has enough room to move around.

  •    1 roscd youbot_driver/bin
       2 sudo ./base_arm_gripper_test

In some cases, the configuration file may have your EtherCAT attempting to find the arm on the wrong device. If this is the case, you may encounter the following error when trying to run the above test:

  •    1 Info: Initializing EtherCAT on eth0
       2 terminate called after throwing an instance of 'std::runtime_error'
       3   what():  No slaves found!
       4 Aborted

If this is the case, edit the file youbot_driver/config/youbot-ethercat.cfg with the correct EthernetDevice parameter (e.g., eth1 instead of eth0). Once saved, attempt to run the test again.

Installing the Kuka youBot ROS Stack

With the drivers installed, you can now write lower-level controllers with the youBot API, however you still need Kuka's youBot ROS Stack in order to use control the youBot via ROS. Before installing the stack, there are several addition ROS packages that must be installed globally on the system. To do so, execute the following command:

  • sudo apt-get install ros-fuerte-pr2-controllers ros-fuerte-pr2-mechanism ros-fuerte-cob-common

Next, you can download and install the youBot stack with the following commands:

  •    1 cd /path/to/your/ros/packages
       2 git clone
       3 roscd youbot_drivers
       4 rosmake youbot_drivers

Note that the installation will attempt to display a window prompting you for a sudo password. If you installing these files through SSH, be sure to enable X-forwarding (i.e., pass in the -X argument) before installing the package. If you fail to do so, you will see the following error:

  • (gksu:3705): Gtk-WARNING **: cannot open display:

If you do receive this error, re-connect to the youBot with X-forwarding enabled, remove the stack completely, and re-install the stack.

Patching `youbot_common` (Fuerte Only)

At this time, the youbot_common package does not build on Fuerte. To fix this and build the package, run the following commands:

  •    1 roscd youbot_common
       2 rosrun tf
       3 rosmake youbot_common


Please send bug reports to the GitHub Issue Tracker. Feel free to contact me at any point with questions and comments.



Wiki: rail_youbot/Tutorials/AddingAUserAndInstallingTheirLocalDrivers (last edited 2012-12-29 21:08:21 by Russell Toris)