ROS KUKA robot control (simulation & physical)
Clone or download
Latest commit c09e857 Sep 7, 2018

README.md

kuka-lwr-ros

Build Status

A ROS package to control the KUKA LWR 4 (both simulation and physical robot). This was originally forked from CentroEPiaggio/kuka-lwr.

Installation

Do the following steps:

  • In your catkin src directory clone the repository
$ git clone https://github.com/epfl-lasa/kuka-lwr-ros.git
  • wstool gets all other git repository dependencies, after the following steps you should see extra catkin packages in your src directory.
$  wstool init
$  wstool merge kuka-lwr-ros/dependencies.rosinstall 
$  wstool up 
  • Query and installs all libraries and packages
$ rosdep install --from-paths . --ignore-src --rosdistro indigo 
  • Install Gazebo, follow this link for instructions on how to install it on ubuntu. Make sure that the ros libraries of Gazebo are also installed:
$ sudo apt-get install ros-indigo-gazeboX-*

Software Version Combinations

  • ROS-Indigo + Gazebo2 (If you are having troubles starting-up the simulation, you need to install Gazebo7)
  • ROS-Kinetic + Gazebo7

Description

Set of packages for simulating and controlling the KUKA Light Weight Robot (LWR).

  • kuka_lwr contains URDF robot description, hardware interface, controllers with configuration files.

  • lwr_ros_client basic implemenation of action handling such that it is easy to call different types of policies.

  • robot_motion_generation utilities such as filters for smoothing robot motion.

  • kuka-lwr-ros-examples set of examples.

Quick Start (Simulation)

Download the kuka-lwr-ros-examples into your catkin_ws and after compling them are ready to run the lwr_simple_example.

Open a new terminal and run the following:

$ roslaunch lwr_simple_example sim.launch

This will run the simulator and the Gazebo simulator and ROS Rviz visualiser GUIs should both open. If the Gazebo window does not open this is because a flag is set in the sim.launch file. In the caption below Rviz is on the left and Gazebo is on the right.

alt text

Now that the simulations are up and running we are ready to control the robot. In on terminal run the following:

$ roslaunch lwr_simple_example client.launch

and in another:

$ roslaunch lwr_simple_example console.launch

You should have the following triptych view in your console alt text

Notice on the bottom right console the heading is "KUKA PLANNING INTERFACE" and a prompt Cmd>. This is the main interface from which you will be starting and stopping policies to be run on the robot. If you press tab (in this console window) a list of possible actions (robot policies) will be displayed, which in the simple example case are; go_front, go_home, go_left, grav_comp and linear (note that grav_comp only works on the real physical robot).

Quick start (real robot)

You first have to make sure that your network configurations are set correctly and you can ping the robot. If you are unsure about this, take a look at Network setup

Once the robot is turned on and you have loaded your script open the FRI such that in the KUKA interface you see the following message: FRI-Ctrl FRI successfully opened.

In a terminal run the following:

$ roslaunch lwr_simple_example real.launch

You should see an Rviz window with the Robot displayed in the correct configuration. alt text Now in another terminal run:

$ roslaunch lwr_fri lwr_fri_console.launch

In the terminal you should see the following: alt text

Here you can see all the different state information of the robot. You can notice that the FRI State is in MONITOR mode which means that you cannot control the robot for the moment. Next go to this console and press tab. You will see that a control cmd is avaiable. Now we are going to change the FRI State to COMMAND which will allow use to run the simple example (see quick start simulation). In the terminal type the follwoing:

FRI> control 

In the terminal where you run real.lauch you will see the lign: Waiting for script.... This statement means that you have to press the green button on the KUKA interface panel until you hear a click originating from the robot.

alt text

Once this is down you will see in the FRI terminal that the FRI State is now in COMMAND mode and that the Drives are in state GO.

To send actions to the robot proceed as in Quick start (simulation). Essentially open two new terminals and launch the simple client and server nodes.

FAQ

If the real-time control interface is not working, you might need to provide your user name with real time priority and memlock limits higher than the default ones. You can do it permanently like this:

  1. sudo nano /etc/security/limits.conf and add these lines:
YOUR_USERNAME hard rtprio 95
YOUR_USERNAME soft rtprio 95
YOUR_USERNAME hard memlock unlimited
YOUR_USERNAME soft memlock unlimited
  1. sudo nano /etc/pam.d/common-session and add session required pam_limits.so
  2. Reboot, open a terminal, and check that ulimit -r -l gives you the values set above.