-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from SalvoVirga/development
iiwa_stack 1.2
- Loading branch information
Showing
59 changed files
with
2,685 additions
and
1,447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |
Most of the files were drastically modified, but the original authors inspired our work. | ||
For everything else : | ||
|
||
Copyright (c) 2016, Salvatore Virga - [email protected], Marco Esposito - [email protected] | ||
Copyright (c) 2016-2017, Salvatore Virga - [email protected], Marco Esposito - [email protected] | ||
Technische Universität München | ||
Chair for Computer Aided Medical Procedures and Augmented Reality | ||
Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,42 @@ | ||
## IIWA STACK | ||
ROS indigo metapackage that contains ROS packages to work with the KUKA LBR IIWA R800/R820 (7/14 Kg). | ||
ROS Indigo/Kinetic metapackage for the KUKA LBR IIWA R800/R820 (7/14 Kg). | ||
|
||
**Current version : v-1.1.0 for Sunrise 1.11** | ||
**Current version : v-1.2.0 for Sunrise 1.11** | ||
[Using a previous version of Sunrise?](https://github.com/SalvoVirga/iiwa_stack/wiki/FAQ#which-version-of-sunriseossunrise-workbench-is-supported) | ||
|
||
[![Build Status](https://travis-ci.org/SalvoVirga/iiwa_stack.svg?branch=master)](https://travis-ci.org/SalvoVirga/iiwa_stack) | ||
___ | ||
### Features | ||
- rosjava node running on the robot as a Sunrise RoboticApplication: supports ROS parameters, topics, services, actions | ||
- SmartServo integration | ||
- default: position control (joint or cartesian) | ||
- joint or cartesian impedance control reconfigurable through a ROS service | ||
- Sunrise tool can be attached to the flange in order to consider its mass for impedance control | ||
- monitor mode with gravity compensation, enabled through SmartPad keys | ||
- optional autonomous publication of joint_states topic | ||
- NTP synchronization if server is running on ROS master | ||
- Native ROSJava nodes running on the robot as a Sunrise RoboticApplication: supports ROS parameters, topics, services, etc. | ||
- Integration of KUKA's SmartServo motions: | ||
- joint position, joint velocity and cartesian position control via simple ROS messages. | ||
- online configuration of JointImpedance, CartesianImpedance, DesiredForce and Sine(Force)Pattern via ROS service. | ||
- online configuration of joint velocity and acceleration via ROS service. | ||
- updates on the time left to reach the commanded destination via ROS service. | ||
- The Sunrise tool to use can be selected via a ROS parameter. | ||
- Gravity compensation by setting the appropriate JointImpedance values. | ||
- NTP synchronization with a server running on the ROS master | ||
- full MoveIt! integration | ||
- Gazebo support | ||
|
||
There are two RoboticApplications included in our software stack: | ||
- ROSMonitor does not perform any motion, but it constantly publishes the current | ||
state of the robot. This is suitable for procedures in the native teaching mode | ||
or in the custom-made gravity compensation mode. | ||
- ROSSmartServo allows to use the Sunrise SmartServo control modes to move the robot. | ||
The motion is fully reconfigurable at runtime, allowing to switch from any control | ||
strategy to any other, and to change the respective parameters at runtime through a | ||
ROS service. | ||
|
||
Both applications look for ROS parameters at startup, including the ID of the Sunrise | ||
tool to attach to the flange. The IP of the robot is automatically discovered, while | ||
the ROS master IP should be set in the configuration file included in the project. | ||
|
||
The communication with the robot is implemented through ROS topics: a rosjava node | ||
runs in the context of a Sunrise application on the robot cabinet, which in turn | ||
performs a SmartServo motion. This approach allows great flexibility, as we can | ||
use a ROS service to reconfigure the ServoMotion at runtime (e.g. stiffness of | ||
certain joints or around cartesian axes). Even if not real-time, we never incurred | ||
in any communication problems on our setup: the TCP topics could scale up to 4 KHz | ||
without compromising the ordering of the received packets. However, we also plan | ||
to offer FRI as a drop-in replacement for ROS-topic communication as soon as it is stable. | ||
|
||
The state of the robot is published through a set of topics, and optionally through | ||
the joint_states topic for compatibility with the robot_state_publisher even when | ||
not using MoveIt!. The timestamps are correct if an NTP server runs on the ROS master, | ||
such that the system can also be used for latency-sensitive application. | ||
|
||
The impedance control can be configured with respect to the stiffness and damping | ||
for each joint, or for each and about each direction in the cartesian space. It is | ||
possible to switch the control mode at runtime safely. | ||
___ | ||
### Usage | ||
__The features and usage of the stack are described in depth on its [WIKI][8].__ | ||
We **_strongly_** suggest to have a look at the wiki to have a better understanding of the code, both for its use and its extension. | ||
Do you have problems? First, please check the [**FAQs**](https://github.com/SalvoVirga/iiwa_stack/wiki/FAQ). Issues or emails are always welcome. | ||
Do you have problems? First, please check the [**FAQs**](https://github.com/SalvoVirga/iiwa_stack/wiki/FAQ). Issues or emails are always welcome! | ||
|
||
___ | ||
### Citation | ||
|
||
If you use iiwa_stack for reseach, you could cite the following work. It is the first publication where it is used. | ||
|
||
@article{hennersperger2016towards, | ||
title={Towards MRI-based Autonomous Robotic US Acquisitions: A First Feasibility Study}, | ||
author={Hennersperger, Christoph and Fuerst, Bernhard and Virga, Salvatore and Zettinig, Oliver and Frisch, Benjamin and Neff, Thomas and Navab, Nassir}, | ||
journal={IEEE transactions on medical imaging}, | ||
year={2016}, | ||
publisher={IEEE} | ||
} | ||
|
||
___ | ||
### Acknowledgements | ||
|
@@ -62,18 +46,6 @@ This repository takes inspiration from the work of : | |
- _Robert Krug_ and his [IIWA URDF and Gazebo package][7] | ||
|
||
Most of the original files were completely refactored though. | ||
___ | ||
### Overview | ||
This packages contained in this repository are : | ||
- __iiwa__ : the ROS metapackage | ||
- __iiwa_control__: contains the joint and trajectory controllers used by MoveIt! and Gazebo. | ||
- __iiwa_description__: URDF for both KUKA LBR IIWA R800 and R820. | ||
- __iiwa_gazebo__: launch files to run a Gazebo simulation. | ||
- __iiwa_hw__: implements the ROS hardware interface and the communication interface with the real robot (using iiwa_ros). | ||
- __iiwa_moveit__: a MoveIt! configuration for controlling the robot (either a Gazebo simulation or a real one). | ||
- __iiwa_msgs__: creates ROS messages to be used for communication with a real robot. | ||
- __iiwa_ros__: an interface to send and receive messages defined in iiwa_msgs to and from a real robot. | ||
- __iiwa_ros_java__: the ROSJava interface to use on SunriseApplications - it allows to send and receive messages defined in iiwa_msgs. | ||
|
||
### Contacts | ||
Salvatore Virga : [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,38 +10,32 @@ | |
* Manuel Bonilla - [email protected] | ||
* | ||
* LICENSE : | ||
* | ||
* Copyright (C) 2016 Salvatore Virga - [email protected], Marco Esposito - [email protected] | ||
* Copyright (C) 2016-2017 Salvatore Virga - [email protected], Marco Esposito - [email protected] | ||
* Technische Universität München | ||
* Chair for Computer Aided Medical Procedures and Augmented Reality | ||
* Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany | ||
* http://campar.in.tum.de | ||
* All rights reserved. | ||
* | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, | ||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, | ||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, | ||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, | ||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* \author Salvatore Virga | ||
* \version 1.4.0 | ||
* \date 07/03/2016 | ||
*/ | ||
|
||
#ifndef IIWA_HW_H_ | ||
#define IIWA_HW_H_ | ||
#pragma once | ||
|
||
// iiwa_msgs and ROS inteface includes | ||
#include "iiwaRos.h" | ||
#include "iiwa_ros.h" | ||
#include <iiwa_msgs/JointPosition.h> | ||
#include <iiwa_msgs/JointTorque.h> | ||
|
||
|
@@ -205,7 +199,7 @@ class IIWA_HW : public hardware_interface::RobotHW { | |
ros::Rate* loop_rate_; | ||
double control_frequency_; | ||
|
||
iiwaRos iiwa_ros_conn_; | ||
iiwa_ros::iiwaRos iiwa_ros_conn_; | ||
iiwa_msgs::JointPosition joint_position_; | ||
iiwa_msgs::JointTorque joint_torque_; | ||
|
||
|
@@ -238,5 +232,3 @@ void vectorToIiwaMsgsJoint(const std::vector<T>& v, iiwa_msgs::JointQuantity& ax | |
ax.a6 = v[5]; | ||
ax.a7 = v[6]; | ||
} | ||
|
||
#endif //IIWA_HW_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,31 +10,27 @@ | |
* Manuel Bonilla - [email protected] | ||
* | ||
* LICENSE : | ||
* | ||
* Copyright (C) 2016 Salvatore Virga - [email protected], Marco Esposito - [email protected] | ||
* | ||
* Copyright (C) 2016-2017 Salvatore Virga - [email protected], Marco Esposito - [email protected] | ||
* Technische Universität München | ||
* Chair for Computer Aided Medical Procedures and Augmented Reality | ||
* Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany | ||
* http://campar.in.tum.de | ||
* All rights reserved. | ||
* | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, | ||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, | ||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, | ||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, | ||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* \author Salvatore Virga | ||
* \version 1.4.0 | ||
* \date 07/03/2016 | ||
*/ | ||
|
||
#include "iiwa_hw.h" | ||
|
@@ -99,7 +95,7 @@ bool IIWA_HW::start() { | |
throw std::runtime_error("No URDF model available"); | ||
} | ||
|
||
iiwa_ros_conn_.init(false); | ||
iiwa_ros_conn_.init(); | ||
|
||
// initialize and set to zero the state and command values | ||
device_->init(); | ||
|
@@ -215,8 +211,8 @@ bool IIWA_HW::read(ros::Duration period) | |
|
||
if (iiwa_ros_conn_.getRobotIsConnected()) { | ||
|
||
iiwa_ros_conn_.getReceivedJointPosition(joint_position_); | ||
iiwa_ros_conn_.getReceivedJointTorque(joint_torque_); | ||
iiwa_ros_conn_.getJointPosition(joint_position_); | ||
iiwa_ros_conn_.getJointTorque(joint_torque_); | ||
|
||
device_->joint_position_prev = device_->joint_position; | ||
iiwaMsgsJointToVector(joint_position_.position, device_->joint_position); | ||
|
@@ -263,7 +259,7 @@ bool IIWA_HW::write(ros::Duration period) { | |
vectorToIiwaMsgsJoint(device_->joint_position_command, command_joint_position_.position); | ||
command_joint_position_.header.stamp = ros::Time::now(); | ||
|
||
iiwa_ros_conn_.setCommandJointPosition(command_joint_position_); | ||
iiwa_ros_conn_.setJointPosition(command_joint_position_); | ||
} | ||
// Joint Impedance Control | ||
else if (interface_ == interface_type_.at(1)) { | ||
|
@@ -274,9 +270,8 @@ bool IIWA_HW::write(ros::Duration period) { | |
// TODO | ||
} | ||
|
||
iiwa_ros_conn_.publish(); | ||
} else if (delta.toSec() >= 10) { | ||
ROS_INFO("No LBR IIWA is connected. Waiting for the robot to connect before writing ..."); | ||
ROS_INFO_STREAM("No LBR IIWA is connected. Waiting for the robot to connect before writing ..."); | ||
timer_ = ros::Time::now(); | ||
} | ||
|
||
|
Oops, something went wrong.