Skip to content

lrubior88/kuka-lwr

 
 

Repository files navigation

KUKA LWR

Build Status (<- waiting for Ubuntu 14.04 support)

ROS indigo metapackage that contains ROS related code to work with the KUKA LWR 4+

Overview

This repository contains:

  • lwr_hw: a package that allows communication with an LWR 4+ through FRI
  • lwr_hw_sim: a package that implements the default interface with the simulated LWR 4+ as if you were using the joint impedance control strategy (it adds the gravity term computed from the URDF model)
  • lwr_controllers: implementation of a series of advanced controlling strategies
  • lwr_launch: launch files for these advanced controllers (to control either a Gazebo simulation or the real hardware)
  • lwr_moveit: a MoveIt! configuration for controlling the robot (either a Gazebo simulation or the real hardware)

IMPORTANT: this repository is to be considered experimental! Please do not try the MoveIt! package yet with a real robot, as the PID gains are under tuning. The OneTask- and MultiTaskInverseKinematics controllers are already in a working condition.

Dependencies

For control and simulation (lwr_controllers):

sudo apt-get install gazebo ros-indigo-gazebo-ros-control ros-indigo-ros-control ros-indigo-effort-controllers ros-indigo-joint-state-controller ros-indigo-joint-trajectory-controller ros-indigo-joint-trajectory-action

For planning (lwr_moveit):

sudo apt-get install ros-indigo-moveit-full

Usage

Prerequisites

  • load the script lwr_hw/krl/ros_control.src and the relative .dat on the robot
  • bring the robot in a position where the joints 1 and 3 are as bent as possible (at least 45 degrees) to avoid the "FRI interpolation error"
  • put the robot in Position control
  • start the script with the grey and green buttons; the scripts stops at a point and should be started again by releasing and pressing again the green button (you can also use the script in automatic mode)
  • the script should reach the loop where it waits for commands; now you can proceed by loading the custom controllers or MoveIt!

Custom Controllers

Bringup

Launch the desired controller from the available described here and Gazebo to try it out:
roslaunch lwr_launch lwr.launch controller:=YOURCONTROLLER

Use it with a real robot:
roslaunch lwr_launch lwr.launch controller:=YOURCONTROLLER use_lwr_sim:=false ip:=192.168.0.20 port:=49939

NOTE: in the lwr.launch file, there are start controllers (only one allowed), and stopped controllers (as many as you want). This way you load all controllers you want for an experiment, and you can switch between them as long as they act on the same interface (Effort, Position, Velocity, Stiffness) for the same joints (names from the URDF).

Gravity compensation

In this mode the robot can be moved manually, while the position of each joint is available in TF (IMPORTANT: due to the robot's own software policies, this mode is only available in T1). This mode can be very useful for calibration or tracking procedures.

  • load the script lwr_hw/krl/ros_monitor.src on the robot
  • put the robot in Position control (it will be changed to Gravity Compensation inside the script)
  • start the script with the grey and green buttons; the scripts stops at a point and should be started again by releasing and pressing again the green button (you can also use the script in automatic mode)
  • the script should reach the loop where it waits for commands
  • start the FRI interface with 'roslaunch lwr_hw lwr_hw.launch'
  • start the publisher node with 'roslaunch lwr_launch state_publisher.launch'

Motion commands

Send commands to the controller in another terminal:

rostopic pub -1 /lwr/OneTaskInverseKinematics/command_configuration lwr_controllers/PoseRPY '{id: 0, position: {x: -0.4, y: 0.3, z: 1.5}, orientation: {roll: 0.1, pitch: 0.2, yaw: 0.0}}'

Please refer to the lwr_controllers documentation for further information about the single controllers.

MoveIt!

IMPORTANT: This is still an EXPERIMENTAL package! Try it out on real hardware at your own risk, and with the red button next to you.

Demo

This launch file loads a very simple fake controller that never fails (useful for evaulation of the inverse kinematics):
roslaunch lwr_moveit demo.launch

Gazebo Simulation

This launch configuration starts a Gazebo simulation that is controlled by MoveIt!: roslaunch lwr_moveit moveit_planning_execution.launch

Real Robot

This is how MoveIt! can be connected to a real robot:

  • roslaunch lwr_launch lwr.launch controller:=YOURCONTROLLER use_lwr_sim:=false ip:=192.168.0.20 port:=49939
  • Ensure that the controller you configure in moveit has been loaded&started.
  • roslaunch lwr_moveit move_group.launch
  • Open the moveit GUI with roslaunch lwr_moveit moveit_rviz.launch

About

Software related to work with the KUKA LWR 4+: for real and for simulation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 89.0%
  • C 6.3%
  • CMake 4.5%
  • Perl 0.2%