## For instruction on writing tutorials ## http://www.ros.org/wiki/WritingTutorials #################################### ##FILL ME IN #################################### ## for a custom note with links: ## note = ## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links ## note.0= [[rail_youbot/Tutorials/UpgradingTheKukaYouBotToFuerte|Upgrading the Kuka youBot to Fuerte]] ## descriptive title for the tutorial ## title = Adding a User and Installing their Local Drivers ## multi-line description to be displayed in search ## description = This tutorial explains how to create a new user on the youBot and install the drivers on their local account. ## the next tutorial description (optional) ## next = ## links to next tutorial (optional) ## next.0.link= ## next.1.link= ## what level user is this tutorial for ## level= BeginnerCategory ## keywords = youBot, youBot Drivers, youBot Users #################################### <<IncludeCSTemplate(TutorialCSHeaderTemplate)>> <<TableOfContents(4)>> == 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 [[rail_youbot/Tutorials/UpgradingTheKukaYouBotToFuerte|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 [[fuerte/Installation/Ubuntu|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. {{{#!shell source /opt/ros/fuerte/setup.bash export ROS_PACKAGE_PATH=/path/to/your/ros/packages:$ROS_PACKAGE_PATH 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. {{{#!shell cd /path/to/your/ros/packages git clone https://github.com/youbot/youbot_driver.git roscd youbot_driver 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. {{{#!shell roscd youbot_driver/bin 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: {{{#!shell Info: Initializing EtherCAT on eth0 terminate called after throwing an instance of 'std::runtime_error' what(): No slaves found! 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 [[http://www.youbot-store.com/programming-interfaces/13/software.aspx|youBot API]], however you still need [[http://www.youbot-store.com/frameworks/8/software.aspx|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: {{{#!shell cd /path/to/your/ros/packages git clone https://github.com/youbot/youbot-ros-pkg.git roscd youbot_drivers 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: {{{#!shell roscd youbot_common rosrun tf bullet_migration_sed.py rosmake youbot_common }}} == Support == Please send bug reports to the [[https://github.com/WPI-RAIL/rail_youbot/issues|GitHub Issue Tracker]]. Feel free to contact me at any point with questions and comments. * [[Russell Toris|Russell Toris]] * [[mailto:rctoris@wpi.edu|rctoris@wpi.edu]] * [[http://users.wpi.edu/~rctoris/|Academic Website]] ---- ||<tablewidth="100%"> {{attachment:wpi.png}} ||<:99%> || {{attachment:rail.png}} || ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## FILL IN THE STACK TUTORIAL CATEGORY HERE