├── .circleci └── config.yml ├── .clang-format ├── .gitignore ├── CHANGELOG.txt ├── LICENSE ├── README.md ├── iiwa_control ├── CMakeLists.txt ├── config │ └── iiwa_control.yaml ├── launch │ ├── iiwa_control.launch │ └── iiwa_sunrise.launch ├── package.xml └── src │ └── iiwa_sunrise.py ├── iiwa_description ├── CMakeLists.txt ├── launch │ ├── iiwa14_upload.launch │ └── iiwa7_upload.launch ├── meshes │ ├── iiwa14 │ │ ├── collision │ │ │ ├── link_0.stl │ │ │ ├── link_1.stl │ │ │ ├── link_2.stl │ │ │ ├── link_3.stl │ │ │ ├── link_4.stl │ │ │ ├── link_5.stl │ │ │ ├── link_6.stl │ │ │ └── link_7.stl │ │ └── visual │ │ │ ├── link_0.stl │ │ │ ├── link_1.stl │ │ │ ├── link_2.stl │ │ │ ├── link_3.stl │ │ │ ├── link_4.stl │ │ │ ├── link_5.stl │ │ │ ├── link_6.stl │ │ │ └── link_7.stl │ └── iiwa7 │ │ ├── collision │ │ ├── link_0.stl │ │ ├── link_1.stl │ │ ├── link_2.stl │ │ ├── link_3.stl │ │ ├── link_4.stl │ │ ├── link_5.stl │ │ ├── link_6.stl │ │ └── link_7.stl │ │ └── visual │ │ ├── link_0.stl │ │ ├── link_1.stl │ │ ├── link_2.stl │ │ ├── link_3.stl │ │ ├── link_4.stl │ │ ├── link_5.stl │ │ ├── link_6.stl │ │ └── link_7.stl ├── package.xml └── urdf │ ├── iiwa.gazebo.xacro │ ├── iiwa.transmission.xacro │ ├── iiwa14.urdf.xacro │ ├── iiwa14.xacro │ ├── iiwa7.urdf.xacro │ ├── iiwa7.xacro │ ├── materials.xacro │ └── utilities.xacro ├── iiwa_gazebo ├── CMakeLists.txt ├── launch │ ├── iiwa_gazebo.launch │ ├── iiwa_gazebo_with_sunrise.launch │ └── iiwa_world.launch ├── package.xml └── worlds │ └── iiwa.world ├── iiwa_hw ├── .gitignore ├── CMakeLists.txt ├── config │ └── joint_names.yaml ├── iiwa_hw_plugin.xml ├── include │ ├── iiwa_hw.hpp │ └── iiwa_hw │ │ └── iiwa_hw.hpp ├── launch │ └── iiwa_hw.launch ├── package.xml └── src │ ├── iiwa_hw.cpp │ └── main.cpp ├── iiwa_moveit ├── .gitignore ├── .setup_assistant ├── CMakeLists.txt ├── config │ ├── EffortJointInterface_controllers.yaml │ ├── PositionJointInterface_controllers.yaml │ ├── VelocityJointInterface_controllers.yaml │ ├── fake_controllers.yaml │ ├── iiwa14.srdf │ ├── iiwa7.srdf │ ├── joint_limits.yaml │ ├── kinematics.yaml │ └── ompl_planning.yaml ├── launch │ ├── default_warehouse_db.launch │ ├── demo.launch │ ├── fake_moveit_controller_manager.launch.xml │ ├── iiwa_moveit_controller_manager.launch.xml │ ├── iiwa_moveit_sensor_manager.launch.xml │ ├── joystick_control.launch │ ├── move_group.launch │ ├── moveit.rviz │ ├── moveit_planning_execution.launch │ ├── moveit_rviz.launch │ ├── ompl_planning_pipeline.launch.xml │ ├── planning_context.launch │ ├── planning_pipeline.launch.xml │ ├── run_benchmark_ompl.launch │ ├── sensor_manager.launch.xml │ ├── setup_assistant.launch │ ├── trajectory_execution.launch.xml │ ├── warehouse.launch │ └── warehouse_settings.launch.xml └── package.xml ├── iiwa_msgs ├── CMakeLists.txt ├── action │ ├── MoveAlongSpline.action │ ├── MoveToCartesianPose.action │ └── MoveToJointPosition.action ├── msg │ ├── CartesianControlModeLimits.msg │ ├── CartesianEulerPose.msg │ ├── CartesianImpedanceControlMode.msg │ ├── CartesianPlane.msg │ ├── CartesianPose.msg │ ├── CartesianQuantity.msg │ ├── CartesianVelocity.msg │ ├── CartesianWrench.msg │ ├── ControlMode.msg │ ├── DOF.msg │ ├── DesiredForceControlMode.msg │ ├── JointDamping.msg │ ├── JointImpedanceControlMode.msg │ ├── JointPosition.msg │ ├── JointPositionVelocity.msg │ ├── JointQuantity.msg │ ├── JointStiffness.msg │ ├── JointTorque.msg │ ├── JointVelocity.msg │ ├── RedundancyInformation.msg │ ├── SinePatternControlMode.msg │ ├── Spline.msg │ └── SplineSegment.msg ├── package.xml └── srv │ ├── ConfigureControlMode.srv │ ├── SetEndpointFrame.srv │ ├── SetPTPCartesianSpeedLimits.srv │ ├── SetPTPJointSpeedLimits.srv │ ├── SetSmartServoJointSpeedLimits.srv │ ├── SetSmartServoLinSpeedLimits.srv │ ├── SetSpeedOverride.srv │ ├── SetWorkpiece.srv │ └── TimeToDestination.srv ├── iiwa_ros ├── CMakeLists.txt ├── include │ └── iiwa_ros │ │ ├── command │ │ ├── cartesian_pose.hpp │ │ ├── cartesian_pose_linear.hpp │ │ ├── generic_command.hpp │ │ ├── joint_position.hpp │ │ ├── joint_position_velocity.hpp │ │ └── joint_velocity.hpp │ │ ├── conversions.hpp │ │ ├── iiwa_ros.hpp │ │ ├── service │ │ ├── control_mode.hpp │ │ ├── iiwa_services.hpp │ │ ├── path_parameters.hpp │ │ ├── path_parameters_lin.hpp │ │ └── time_to_destination.hpp │ │ └── state │ │ ├── cartesian_pose.hpp │ │ ├── cartesian_wrench.hpp │ │ ├── destination_reached.hpp │ │ ├── external_joint_torque.hpp │ │ ├── generic_state.hpp │ │ ├── joint_position.hpp │ │ ├── joint_torque.hpp │ │ └── joint_velocity.hpp ├── launch │ └── toolbar_example.launch ├── package.xml ├── scripts │ ├── ntp_verifier.py │ └── toolbar_event_publisher └── src │ ├── command │ ├── cartesian_pose.cpp │ ├── cartesian_pose_linear.cpp │ ├── generic_command.cpp │ ├── joint_position.cpp │ ├── joint_position_velocity.cpp │ └── joint_velocity.cpp │ ├── iiwa_ros.cpp │ ├── main.cpp │ ├── service │ ├── control_mode.cpp │ ├── path_parameters.cpp │ ├── path_parameters_lin.cpp │ └── time_to_destination.cpp │ └── state │ ├── cartesian_pose.cpp │ ├── cartesian_wrench.cpp │ ├── destination_reached.cpp │ ├── external_joint_torque.cpp │ ├── joint_position.cpp │ ├── joint_torque.cpp │ └── joint_velocity.cpp └── iiwa_ros_java ├── ROSJavaLib ├── actionlib_msgs-1.11.8.jar ├── apache_xmlrpc_client_0.3.7.jar ├── apache_xmlrpc_common_0.3.7.jar ├── apache_xmlrpc_server_0.3.7.jar ├── com.springsource.org.apache.commons.codec-1.3.0.jar ├── com.springsource.org.apache.commons.httpclient-3.1.0.jar ├── com.springsource.org.apache.commons.io-1.4.0.jar ├── com.springsource.org.apache.commons.lang-2.4.0.jar ├── com.springsource.org.apache.commons.logging-1.1.1.jar ├── com.springsource.org.apache.commons.net-2.0.0.jar ├── commons-pool-1.6.jar ├── dnsjava-2.1.8.jar ├── geometry_msgs-1.11.8.jar ├── guava-18.0.jar ├── iiwa_msgs-2.3.1.jar ├── jgrapht-core-0.9.0.jar ├── message_generation-0.3.3.jar ├── netty-3.5.2.Final.jar ├── rosgraph_msgs-1.11.1.jar ├── rosjava_0.3.7_custom.jar ├── rosjava_actionlib-0.4.4.jar ├── rosjava_tf_core-0.2.2.jar ├── sensor_msgs-1.11.8.jar ├── std_msgs-0.5.9.jar ├── tf2_msgs-0.5.12.jar ├── vecmath-1.5.2.jar └── ws-commons-util-1.0.1.jar ├── iiwa_stack_style.xml └── src └── de └── tum └── in └── camp └── kuka └── ros ├── ActionServerThread.java ├── ActiveTool.java ├── ActiveToolThread.java ├── AddressGenerator.java ├── CommandTypes.java ├── Configuration.java ├── ControlModeHandler.java ├── Conversions.java ├── GoalReachedEventListener.java ├── Logger.java ├── MessageGenerator.java ├── Motions.java ├── MoveAsyncErrorHandler.java ├── PTPMotionFinishedEventListener.java ├── PublisherThread.java ├── SpeedLimits.java ├── UnsupportedControlModeException.java ├── Utility.java ├── app ├── ROSBaseApplication.java └── ROSSmartServo.java ├── iiwaActionServer.java ├── iiwaPublisher.java └── iiwaSubscriber.java /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Use the latest 2.1 version of CircleCI pipeline process engine. 2 | # See: https://circleci.com/docs/configuration-reference 3 | version: 2.1 4 | 5 | # Define a job to be invoked later in a workflow. 6 | # See: https://circleci.com/docs/configuration-reference/#jobs 7 | jobs: 8 | build: 9 | # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. 10 | # See: https://circleci.com/docs/configuration-reference/#executor-job 11 | docker: 12 | - image: moveit/moveit:noetic-release 13 | # Add steps to the job 14 | # See: https://circleci.com/docs/configuration-reference/#steps 15 | steps: 16 | - run: 17 | name: "APT update" 18 | command: "apt update" 19 | - run: 20 | name: "Install Build Tools" 21 | command: "apt install -y git python3-catkin-tools" 22 | - run: 23 | name: "Checkout" 24 | command: "mkdir -p ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts && mkdir src && cd src && git clone -b \"$CIRCLE_BRANCH\" \"$CIRCLE_REPOSITORY_URL\" && cd .." 25 | - run: 26 | name: "Catkin Build" 27 | command: "source /opt/ros/noetic/setup.bash && catkin build --no-status --summarize" 28 | 29 | # Orchestrate jobs using workflows 30 | # See: https://circleci.com/docs/configuration-reference/#workflows 31 | workflows: 32 | ci: 33 | jobs: 34 | - build 35 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Google 3 | AccessModifierOffset: -2 4 | ConstructorInitializerIndentWidth: 2 5 | AlignEscapedNewlinesLeft: false 6 | AlignTrailingComments: true 7 | AllowAllParametersOfDeclarationOnNextLine: false 8 | AllowShortIfStatementsOnASingleLine: true 9 | AllowShortLoopsOnASingleLine: true 10 | AllowShortFunctionsOnASingleLine: Inline 11 | AllowShortLoopsOnASingleLine: true 12 | AlwaysBreakTemplateDeclarations: true 13 | AlwaysBreakBeforeMultilineStrings: false 14 | BreakBeforeBinaryOperators: false 15 | BreakBeforeTernaryOperators: false 16 | BreakConstructorInitializersBeforeComma: true 17 | BinPackParameters: true 18 | ColumnLimit: 120 19 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 20 | DerivePointerBinding: false 21 | PointerBindsToType: true 22 | ExperimentalAutoDetectBinPacking: false 23 | IndentCaseLabels: true 24 | MaxEmptyLinesToKeep: 1 25 | NamespaceIndentation: None 26 | ObjCSpaceBeforeProtocolList: true 27 | PenaltyBreakBeforeFirstCallParameter: 19 28 | PenaltyBreakComment: 60 29 | PenaltyBreakString: 1 30 | PenaltyBreakFirstLessLess: 1000 31 | PenaltyExcessCharacter: 1000 32 | PenaltyReturnTypeOnItsOwnLine: 90 33 | SpacesBeforeTrailingComments: 2 34 | Cpp11BracedListStyle: true 35 | Standard: Auto 36 | IndentWidth: 2 37 | TabWidth: 2 38 | UseTab: Never 39 | IndentFunctionDeclarationAfterType: false 40 | SpacesInParentheses: false 41 | SpacesInAngles: false 42 | SpaceInEmptyParentheses: false 43 | SpacesInCStyleCastParentheses: false 44 | SpaceAfterControlStatementKeyword: true 45 | SpaceBeforeAssignmentOperators: true 46 | ContinuationIndentWidth: 4 47 | SortIncludes: false 48 | SpaceAfterCStyleCast: false 49 | 50 | # Configure each individual brace in BraceWrapping 51 | BreakBeforeBraces: Custom 52 | 53 | # Control of individual brace wrapping cases 54 | BraceWrapping: { 55 | AfterClass: 'true' 56 | AfterControlStatement: 'true' 57 | AfterEnum : 'true' 58 | AfterFunction : 'true' 59 | AfterNamespace : 'true' 60 | AfterStruct : 'true' 61 | AfterUnion : 'true' 62 | BeforeCatch : 'true' 63 | BeforeElse : 'true' 64 | IndentBraces : 'false' 65 | } 66 | ... 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Lines that start with '#' are comments. 2 | 3 | # Backup and data files 4 | eg/eg.* 5 | *~ 6 | *.bak 7 | *.off 8 | *.x 9 | x.* 10 | r 11 | x 12 | x? 13 | r? 14 | 15 | #Misc 16 | 17 | lbr_fri/fri 18 | 19 | # patch results 20 | *.rej 21 | 22 | # Build products 23 | tmp/* 24 | build/Makefile* 25 | build/CMakeFiles 26 | build/CMakeCache.txt 27 | build/*/Makefile* 28 | build/*/object_script* 29 | build/*/Release/* 30 | build/*/Debug/* 31 | build/*/MinSizeRel/* 32 | build/*/RelWithDebInfo/* 33 | build 34 | 35 | *# 36 | *.# 37 | *.obj 38 | *.zip 39 | *.a 40 | *.dll 41 | *.lib 42 | *.exe 43 | *.bag 44 | *.o 45 | *.md5sum 46 | 47 | # Qt files 48 | *.pro.user 49 | 50 | # DevStudio files 51 | *.bsc 52 | *.ncb 53 | *.pdb 54 | *.suo 55 | *.user 56 | *.ilk 57 | 58 | # CVS files 59 | CVS/* 60 | */CVS/* 61 | */*/CVS/* 62 | */*/*/CVS/* 63 | *.cvsignore 64 | 65 | # Vim files 66 | *.swp 67 | 68 | # Other files 69 | working/ 70 | Status API Training Shop Blog About 71 | © 2014 GitHub, Inc. Terms Privacy Security Contact 72 | 73 | /CMakeLists.txt 74 | *.kdev4 75 | *.project 76 | *.cproject 77 | /config 78 | *.kdev_include_paths 79 | *.orig 80 | -------------------------------------------------------------------------------- /CHANGELOG.txt: -------------------------------------------------------------------------------- 1 | # IIWA_STACK Changelog 2 | 3 | ## Version 1.2.5 4 | 5 | #### New 6 | * `NTP updates are now automatic` 7 | * `Desired force accepts also negative force values (force toward the negative axis)` 8 | 9 | 10 | #### Bug Fixes 11 | * `Fixed joint velocity command mode` 12 | * `Removed useless "iiwa_link_ee_kuka" frame from URDF` 13 | * `Small fixes in the URDF: link misalignments, robot_name specific variables` 14 | * `Small fixes and improvements` 15 | 16 | ## Version 1.2.0 (release date: 01.02.2016) 17 | 18 | #### New 19 | * `An approximation of the inertia parameters was added to the URDF of the iiwa7.` 20 | * `Commanding in joint velocity available.` 21 | * `Added a service to get the time left to reach the commanded destination and topic that publishes when the destination is reached.` 22 | * `Moved the feature to change the joing velocity and acceleration to its own service.` 23 | * `Refactored the code in iiwa_ros, now it provides wrappers for all the state/command messages and the service calls.` 24 | * `Tested and workin on ROS Kinetic` 25 | 26 | #### Bug Fixes 27 | * `The online change of the joint velocity now works properly` 28 | * `Got rid of minor compiler warning` 29 | * `Got rid of the errors and most of the warning from Rviz and MoveIn in Kinect, some are left but they clash with Indigo atm.` 30 | 31 | ## Version 1.1.0 (release date: 26.08.2016) 32 | 33 | Completely refactoring of the Java applications led to various improvements in terms of performance. 34 | 35 | #### New 36 | * `ConstantForce via SmartServo service` 37 | * `Added JointPositionVelocity commands` 38 | 39 | #### Bug Fixes 40 | * `Tool selection from ROS param` 41 | * `CartesianPose published from the robot now depends on the tool selected` 42 | * `Fixed URDF xacro files` 43 | * `ROSMonitor shouts down cleanly` 44 | 45 | ## Version 1.0.0 46 | Initial release -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2016-2019, Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 4 | Technische Universität München 5 | Chair for Computer Aided Medical Procedures and Augmented Reality 6 | Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 7 | http://campar.in.tum.de 8 | All rights reserved. 9 | 10 | Copyright (c) 2015, Robert Krug & Todor Stoyanov, AASS Research Center, Orebro University, Sweden 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 16 | * Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above copyright notice, 20 | this list of conditions and the following disclaimer in the documentation 21 | and/or other materials provided with the distribution. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 27 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## IIWA STACK 2 | ROS Indigo/Kinetic metapackage for the KUKA LBR IIWA R800/R820 (7/14 Kg). 3 | 4 | **Current version : v-1.3.0 for Sunrise 1.10 - 1.16** 5 | [Using a previous version of Sunrise?](https://github.com/SalvoVirga/iiwa_stack/wiki/FAQ#which-version-of-sunriseossunrise-workbench-is-supported) 6 | 7 | [![Build Status](https://dl.circleci.com/status-badge/img/gh/IFL-CAMP/iiwa_stack/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/IFL-CAMP/iiwa_stack/tree/master) 8 | 9 | ___ 10 | ### Features 11 | - Native ROSJava nodes running on the robot as a Sunrise RoboticApplication: supports ROS parameters, topics, services, etc. 12 | - Integration of KUKA's SmartServo and PTP motions: 13 | - joint position, joint velocity and cartesian position control via simple ROS messages. 14 | - online configuration of JointImpedance, CartesianImpedance, DesiredForce and Sine(Force)Pattern via ROS service. 15 | - online configuration of joint/cartesian velocity and acceleration via ROS service. 16 | - updates on the time left to reach the commanded destination via ROS service. 17 | - Selection of the tool and endframe to use via ROS parameters and services. 18 | - 'Fake' hand-guidance mode. 19 | - NTP synchronization with a server running on the ROS master 20 | - full MoveIt! integration 21 | - Gazebo support 22 | 23 | ___ 24 | ### Usage 25 | __The features and usage of the stack are described in depth on its [WIKI][8].__ 26 | 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. 27 | Do you have problems? First, please check the [**FAQs**](https://github.com/SalvoVirga/iiwa_stack/wiki/FAQ). Issues or emails are always welcome! 28 | 29 | ___ 30 | ### Citation 31 | 32 | If you use iiwa_stack for reseach, you could cite the following work. It is the first publication where it was used. 33 | 34 | @article{hennersperger2017towards, 35 | title={Towards MRI-based autonomous robotic US acquisitions: a first feasibility study}, 36 | author={Hennersperger, Christoph and Fuerst, Bernhard and Virga, Salvatore and Zettinig, Oliver and Frisch, Benjamin and Neff, Thomas and Navab, Nassir}, 37 | journal={IEEE transactions on medical imaging}, 38 | volume={36}, 39 | number={2}, 40 | pages={538--548}, 41 | year={2017}, 42 | publisher={IEEE} 43 | } 44 | 45 | ___ 46 | ### Acknowledgements 47 | This repository takes inspiration from the work of : 48 | - _Centro E. Piaggio_ and their [ROS interface for the KUKA LBR 4+][1] 49 | - _Mohammad Khansari_ and his [IIWA-ROS communication inteface][2] 50 | - _Robert Krug_ and his [IIWA URDF and Gazebo package][7] 51 | 52 | Most of the original files were completely refactored though. 53 | 54 | 55 | ### Contacts 56 | 57 | [![TUM](http://campar.in.tum.de/files/goeblr/TUM_Web_Logo_blau.png "TUM Logo")](http://www.tum.de) 58 | [Chair for Computer Aided Medical Procedures](http://campar.in.tum.de/) 59 | [Technical University of Munich](http://www.tum.de), Germany. 60 | 61 | Salvatore Virga : [salvo.virga@tum.de](mailto:salvo.virga@tum.de) 62 | Marco Esposito : [marco.esposito@tum.de](mailto:marco.esposito@tum.de) 63 | 64 | [1]: https://github.com/CentroEPiaggio/kuka-lwr 65 | [2]: https://bitbucket.org/khansari/iiwa.git 66 | [3]: https://bitbucket.org/khansari/iiwa/src/c4578460d79d5d24f58bf94bd97fb6cb0b6f280f/msg/IIWAMsg.msg 67 | [4]: https://bitbucket.org/khansari/iiwa/wiki/Home 68 | [5]: https://bitbucket.org/khansari/iiwa/src/c4578460d79d5d24f58bf94bd97fb6cb0b6f280f/JavaNode/?at=master 69 | [6]: http://git.lcsr.jhu.edu/cgrauma1/kuka_iiwa_shared 70 | [7]: https://github.com/rtkg/lbr_iiwa 71 | [8]: https://github.com/SalvoVirga/iiwa_stack/wiki 72 | -------------------------------------------------------------------------------- /iiwa_control/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(iiwa_control) 3 | 4 | find_package(catkin REQUIRED) 5 | catkin_package() 6 | 7 | foreach(dir config launch) 8 | install(DIRECTORY ${dir} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 9 | endforeach() 10 | -------------------------------------------------------------------------------- /iiwa_control/launch/iiwa_control.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /iiwa_control/launch/iiwa_sunrise.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /iiwa_control/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | iiwa_control 4 | 1.4.0 5 | A package containing controllers used by MoveIt! and Gazebo 6 | Salvo Virga 7 | Salvo Virga 8 | 9 | BSD 10 | 11 | catkin 12 | 13 | controller_manager 14 | 15 | 16 | -------------------------------------------------------------------------------- /iiwa_description/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(iiwa_description) 3 | 4 | find_package(catkin REQUIRED) 5 | catkin_package() 6 | 7 | foreach(dir launch meshes urdf) 8 | install(DIRECTORY ${dir} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 9 | endforeach() 10 | -------------------------------------------------------------------------------- /iiwa_description/launch/iiwa14_upload.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /iiwa_description/launch/iiwa7_upload.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/collision/link_0.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/collision/link_0.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/collision/link_1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/collision/link_1.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/collision/link_2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/collision/link_2.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/collision/link_3.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/collision/link_3.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/collision/link_4.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/collision/link_4.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/collision/link_5.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/collision/link_5.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/collision/link_6.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/collision/link_6.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/collision/link_7.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/collision/link_7.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/visual/link_0.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/visual/link_0.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/visual/link_1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/visual/link_1.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/visual/link_2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/visual/link_2.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/visual/link_3.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/visual/link_3.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/visual/link_4.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/visual/link_4.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/visual/link_5.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/visual/link_5.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/visual/link_6.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/visual/link_6.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa14/visual/link_7.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa14/visual/link_7.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/collision/link_0.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/collision/link_0.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/collision/link_1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/collision/link_1.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/collision/link_2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/collision/link_2.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/collision/link_3.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/collision/link_3.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/collision/link_4.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/collision/link_4.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/collision/link_5.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/collision/link_5.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/collision/link_6.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/collision/link_6.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/collision/link_7.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/collision/link_7.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/visual/link_0.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/visual/link_0.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/visual/link_1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/visual/link_1.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/visual/link_2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/visual/link_2.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/visual/link_3.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/visual/link_3.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/visual/link_4.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/visual/link_4.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/visual/link_5.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/visual/link_5.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/visual/link_6.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/visual/link_6.stl -------------------------------------------------------------------------------- /iiwa_description/meshes/iiwa7/visual/link_7.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_description/meshes/iiwa7/visual/link_7.stl -------------------------------------------------------------------------------- /iiwa_description/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | iiwa_description 4 | 1.4.0 5 | This package contains the URDF of the KUKA LBR IIWA robot 6 | Salvo Virga 7 | Salvo Virga 8 | 9 | BSD 10 | 11 | catkin 12 | force_torque_sensor_controller 13 | 14 | 15 | -------------------------------------------------------------------------------- /iiwa_description/urdf/iiwa.gazebo.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 50.0 16 | /${robot_name}/state/CartesianWrench 17 | ${robot_name}_joint_7 18 | 19 | 20 | 21 | 22 | 23 | 24 | /${robot_name} 25 | 26 | 27 | 28 | 29 | 30 | Gazebo/Grey 31 | 0.2 32 | 0.2 33 | 34 | 35 | 36 | 37 | Gazebo/Orange 38 | 0.2 39 | 0.2 40 | 41 | 42 | 43 | 44 | Gazebo/Orange 45 | 0.2 46 | 0.2 47 | 48 | 49 | 50 | 51 | Gazebo/Orange 52 | 0.2 53 | 0.2 54 | 55 | 56 | 57 | 58 | 59 | Gazebo/Orange 60 | 0.2 61 | 0.2 62 | 63 | 64 | 65 | 66 | Gazebo/Orange 67 | 0.2 68 | 0.2 69 | 70 | 71 | 72 | 73 | Gazebo/Orange 74 | 0.2 75 | 0.2 76 | 77 | 78 | 79 | 80 | Gazebo/Grey 81 | 0.2 82 | 0.2 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /iiwa_description/urdf/iiwa14.urdf.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /iiwa_description/urdf/iiwa7.urdf.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /iiwa_description/urdf/materials.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /iiwa_description/urdf/utilities.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /iiwa_gazebo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(iiwa_gazebo) 3 | 4 | find_package(catkin REQUIRED) 5 | catkin_package() 6 | 7 | foreach(dir launch worlds) 8 | install(DIRECTORY ${dir} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 9 | endforeach() 10 | -------------------------------------------------------------------------------- /iiwa_gazebo/launch/iiwa_gazebo.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /iiwa_gazebo/launch/iiwa_gazebo_with_sunrise.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /iiwa_gazebo/launch/iiwa_world.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /iiwa_gazebo/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | iiwa_gazebo 4 | 1.4.0 5 | This package allows to load a KUKA LBR IIWA robot onto Gazebo 6 | Salvo Virga 7 | Salvo Virga 8 | 9 | BSD 10 | 11 | catkin 12 | 13 | iiwa_description 14 | gazebo_ros 15 | 16 | 17 | -------------------------------------------------------------------------------- /iiwa_gazebo/worlds/iiwa.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | model://ground_plane 10 | 11 | 12 | 13 | 14 | model://sun 15 | 16 | 17 | 18 | 0.01 19 | 1 20 | 100 21 | 22 | 23 | quick 24 | 50 25 | 1.0 26 | false 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 4.927360 -4.376610 3.740080 0.000000 0.275643 2.356190 35 | orbit 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /iiwa_hw/.gitignore: -------------------------------------------------------------------------------- 1 | *.directory 2 | -------------------------------------------------------------------------------- /iiwa_hw/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(iiwa_hw) 3 | 4 | set(CMAKE_CXX_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 6 | 7 | find_package(catkin REQUIRED COMPONENTS 8 | control_toolbox 9 | controller_interface 10 | controller_manager 11 | hardware_interface 12 | realtime_tools 13 | joint_limits_interface 14 | urdf 15 | cmake_modules 16 | iiwa_msgs 17 | iiwa_ros 18 | pluginlib 19 | ) 20 | 21 | catkin_package( 22 | INCLUDE_DIRS include 23 | LIBRARIES ${PROJECT_NAME} 24 | CATKIN_DEPENDS 25 | iiwa_ros 26 | iiwa_msgs 27 | pluginlib 28 | controller_interface 29 | controller_manager 30 | hardware_interface 31 | control_toolbox 32 | ) 33 | 34 | add_library(${PROJECT_NAME} src/iiwa_hw.cpp) 35 | add_executable(${PROJECT_NAME}-bin src/main.cpp) 36 | 37 | target_include_directories(${PROJECT_NAME} PUBLIC include ${catkin_INCLUDE_DIRS}) 38 | target_include_directories(${PROJECT_NAME}-bin PRIVATE include ${catkin_INCLUDE_DIRS}) 39 | 40 | target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) 41 | target_link_libraries(${PROJECT_NAME}-bin ${PROJECT_NAME}) 42 | 43 | add_dependencies(${PROJECT_NAME} iiwa_msgs_generate_messages_cpp) 44 | add_dependencies(${PROJECT_NAME}-bin iiwa_msgs_generate_messages_cpp) 45 | 46 | install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}-bin 47 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 48 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 49 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 50 | ) 51 | 52 | install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}/) 53 | 54 | foreach(dir config launch) 55 | install(DIRECTORY ${dir} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 56 | endforeach() 57 | -------------------------------------------------------------------------------- /iiwa_hw/config/joint_names.yaml: -------------------------------------------------------------------------------- 1 | joints: 2 | - iiwa_joint_1 3 | - iiwa_joint_2 4 | - iiwa_joint_3 5 | - iiwa_joint_4 6 | - iiwa_joint_5 7 | - iiwa_joint_6 8 | - iiwa_joint_7 -------------------------------------------------------------------------------- /iiwa_hw/iiwa_hw_plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Interface for an KUKA LBR iiwa arm. 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iiwa_hw/include/iiwa_hw.hpp: -------------------------------------------------------------------------------- 1 | #error "#include is no longer available, use #include instead" 2 | -------------------------------------------------------------------------------- /iiwa_hw/launch/iiwa_hw.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /iiwa_hw/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | iiwa_hw 4 | 1.4.0 5 | The hardware interface to an KUKA LBR IIWA Robot 6 | Salvo Virga 7 | Salvo Virga 8 | 9 | BSD 10 | 11 | catkin 12 | 13 | pluginlib 14 | controller_manager 15 | controller_interface 16 | joint_limits_interface 17 | hardware_interface 18 | control_toolbox 19 | realtime_tools 20 | roscpp 21 | iiwa_msgs 22 | iiwa_ros 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /iiwa_hw/src/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | 34 | #include "iiwa_hw/iiwa_hw.hpp" 35 | 36 | static bool quit{false}; 37 | 38 | void signalHandler(int /*unused*/) { quit = true; } 39 | 40 | int main(int argc, char** argv) { 41 | // Initialize ROS. 42 | ros::init(argc, argv, "iiwa_hw", ros::init_options::NoSigintHandler); 43 | 44 | // ROS spinner. 45 | ros::AsyncSpinner spinner(1); 46 | spinner.start(); 47 | 48 | // Signal handlers. 49 | signal(SIGTERM, signalHandler); 50 | signal(SIGINT, signalHandler); 51 | signal(SIGHUP, signalHandler); 52 | 53 | // Construct the LBR iiwa. 54 | ros::NodeHandle iiwa_nh; 55 | iiwa_hw::HardwareInterface iiwa_robot; 56 | 57 | // Configuration routines. 58 | iiwa_robot.init(iiwa_nh, iiwa_nh); 59 | 60 | ros::Time last(ros::Time::now()); 61 | ros::Time now; 62 | ros::Duration period(1.0); 63 | 64 | // Controller manager. 65 | controller_manager::ControllerManager manager(&iiwa_robot, iiwa_nh); 66 | 67 | // Run as fast as possible. 68 | while (!quit) { 69 | 70 | // Get the time / period. 71 | now = ros::Time::now(); 72 | period = now - last; 73 | last = now; 74 | 75 | // Read current robot position. 76 | iiwa_robot.read(now, period); 77 | 78 | // Update the controllers. 79 | manager.update(now, period); 80 | 81 | // send command position to the robot 82 | iiwa_robot.write(now, period); 83 | 84 | // wait for some milliseconds defined in controlFrequency 85 | iiwa_robot.getRate().sleep(); 86 | } 87 | 88 | spinner.stop(); 89 | 90 | return 0; 91 | } 92 | -------------------------------------------------------------------------------- /iiwa_moveit/.gitignore: -------------------------------------------------------------------------------- 1 | default_warehouse_mongo_db/ 2 | -------------------------------------------------------------------------------- /iiwa_moveit/.setup_assistant: -------------------------------------------------------------------------------- 1 | moveit_setup_assistant_config: 2 | URDF: 3 | package: iiwa_description 4 | relative_path: urdf/iiwa14.urdf 5 | SRDF: 6 | relative_path: config/iiwa14.srdf 7 | CONFIG: 8 | generated_timestamp: 1445789930 -------------------------------------------------------------------------------- /iiwa_moveit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(iiwa_moveit) 3 | 4 | find_package(catkin REQUIRED) 5 | 6 | catkin_package() 7 | 8 | install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 9 | install(DIRECTORY config DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 10 | -------------------------------------------------------------------------------- /iiwa_moveit/config/EffortJointInterface_controllers.yaml: -------------------------------------------------------------------------------- 1 | controller_list: 2 | - name: EffortJointInterface_trajectory_controller 3 | action_ns: follow_joint_trajectory 4 | type: FollowJointTrajectory 5 | default: true 6 | joints: 7 | - iiwa_joint_1 8 | - iiwa_joint_2 9 | - iiwa_joint_3 10 | - iiwa_joint_4 11 | - iiwa_joint_5 12 | - iiwa_joint_6 13 | - iiwa_joint_7 14 | 15 | -------------------------------------------------------------------------------- /iiwa_moveit/config/PositionJointInterface_controllers.yaml: -------------------------------------------------------------------------------- 1 | controller_list: 2 | - name: PositionJointInterface_trajectory_controller 3 | action_ns: follow_joint_trajectory 4 | type: FollowJointTrajectory 5 | default: true 6 | joints: 7 | - iiwa_joint_1 8 | - iiwa_joint_2 9 | - iiwa_joint_3 10 | - iiwa_joint_4 11 | - iiwa_joint_5 12 | - iiwa_joint_6 13 | - iiwa_joint_7 14 | 15 | -------------------------------------------------------------------------------- /iiwa_moveit/config/VelocityJointInterface_controllers.yaml: -------------------------------------------------------------------------------- 1 | controller_list: 2 | - name: VelocityJointInterface_trajectory_controller 3 | action_ns: follow_joint_trajectory 4 | type: FollowJointTrajectory 5 | default: true 6 | joints: 7 | - iiwa_joint_1 8 | - iiwa_joint_2 9 | - iiwa_joint_3 10 | - iiwa_joint_4 11 | - iiwa_joint_5 12 | - iiwa_joint_6 13 | - iiwa_joint_7 14 | 15 | -------------------------------------------------------------------------------- /iiwa_moveit/config/fake_controllers.yaml: -------------------------------------------------------------------------------- 1 | controller_list: 2 | - name: fake_manipulator_controller 3 | joints: 4 | - iiwa_joint_1 5 | - iiwa_joint_2 6 | - iiwa_joint_3 7 | - iiwa_joint_4 8 | - iiwa_joint_5 9 | - iiwa_joint_6 10 | - iiwa_joint_7 -------------------------------------------------------------------------------- /iiwa_moveit/config/joint_limits.yaml: -------------------------------------------------------------------------------- 1 | # joint_limits.yaml allows the dynamics properties specified in the URDF to be overwritten or augmented as needed 2 | # Specific joint properties can be changed with the keys [max_position, min_position, max_velocity, max_acceleration] 3 | # Joint limits can be turned off with [has_velocity_limits, has_acceleration_limits] 4 | joint_limits: 5 | iiwa_joint_1: 6 | has_velocity_limits: true 7 | max_velocity: 10 8 | has_acceleration_limits: false 9 | max_acceleration: 0 10 | iiwa_joint_2: 11 | has_velocity_limits: true 12 | max_velocity: 10 13 | has_acceleration_limits: false 14 | max_acceleration: 0 15 | iiwa_joint_3: 16 | has_velocity_limits: true 17 | max_velocity: 10 18 | has_acceleration_limits: false 19 | max_acceleration: 0 20 | iiwa_joint_4: 21 | has_velocity_limits: true 22 | max_velocity: 10 23 | has_acceleration_limits: false 24 | max_acceleration: 0 25 | iiwa_joint_5: 26 | has_velocity_limits: true 27 | max_velocity: 10 28 | has_acceleration_limits: false 29 | max_acceleration: 0 30 | iiwa_joint_6: 31 | has_velocity_limits: true 32 | max_velocity: 10 33 | has_acceleration_limits: false 34 | max_acceleration: 0 35 | iiwa_joint_7: 36 | has_velocity_limits: true 37 | max_velocity: 10 38 | has_acceleration_limits: false 39 | max_acceleration: 0 -------------------------------------------------------------------------------- /iiwa_moveit/config/kinematics.yaml: -------------------------------------------------------------------------------- 1 | manipulator: 2 | kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin 3 | kinematics_solver_search_resolution: 0.005 4 | kinematics_solver_timeout: 0.005 5 | kinematics_solver_attempts: 3 -------------------------------------------------------------------------------- /iiwa_moveit/config/ompl_planning.yaml: -------------------------------------------------------------------------------- 1 | planner_configs: 2 | SBLkConfigDefault: 3 | type: geometric::SBL 4 | range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup() 5 | ESTkConfigDefault: 6 | type: geometric::EST 7 | range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0 setup() 8 | goal_bias: 0.05 # When close to goal select goal, with this probability. default: 0.05 9 | LBKPIECEkConfigDefault: 10 | type: geometric::LBKPIECE 11 | range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup() 12 | border_fraction: 0.9 # Fraction of time focused on boarder default: 0.9 13 | min_valid_path_fraction: 0.5 # Accept partially valid moves above fraction. default: 0.5 14 | BKPIECEkConfigDefault: 15 | type: geometric::BKPIECE 16 | range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup() 17 | border_fraction: 0.9 # Fraction of time focused on boarder default: 0.9 18 | failed_expansion_score_factor: 0.5 # When extending motion fails, scale score by factor. default: 0.5 19 | min_valid_path_fraction: 0.5 # Accept partially valid moves above fraction. default: 0.5 20 | KPIECEkConfigDefault: 21 | type: geometric::KPIECE 22 | range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup() 23 | goal_bias: 0.05 # When close to goal select goal, with this probability. default: 0.05 24 | border_fraction: 0.9 # Fraction of time focused on boarder default: 0.9 (0.0,1.] 25 | failed_expansion_score_factor: 0.5 # When extending motion fails, scale score by factor. default: 0.5 26 | min_valid_path_fraction: 0.5 # Accept partially valid moves above fraction. default: 0.5 27 | RRTkConfigDefault: 28 | type: geometric::RRT 29 | range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup() 30 | goal_bias: 0.05 # When close to goal select goal, with this probability? default: 0.05 31 | RRTConnectkConfigDefault: 32 | type: geometric::RRTConnect 33 | range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup() 34 | RRTstarkConfigDefault: 35 | type: geometric::RRTstar 36 | range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup() 37 | goal_bias: 0.05 # When close to goal select goal, with this probability? default: 0.05 38 | delay_collision_checking: 1 # Stop collision checking as soon as C-free parent found. default 1 39 | TRRTkConfigDefault: 40 | type: geometric::TRRT 41 | range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup() 42 | goal_bias: 0.05 # When close to goal select goal, with this probability? default: 0.05 43 | max_states_failed: 10 # when to start increasing temp. default: 10 44 | temp_change_factor: 2.0 # how much to increase or decrease temp. default: 2.0 45 | min_temperature: 10e-10 # lower limit of temp change. default: 10e-10 46 | init_temperature: 10e-6 # initial temperature. default: 10e-6 47 | frountier_threshold: 0.0 # dist new state to nearest neighbor to disqualify as frontier. default: 0.0 set in setup() 48 | frountierNodeRatio: 0.1 # 1/10, or 1 nonfrontier for every 10 frontier. default: 0.1 49 | k_constant: 0.0 # value used to normalize expresssion. default: 0.0 set in setup() 50 | PRMkConfigDefault: 51 | type: geometric::PRM 52 | max_nearest_neighbors: 10 # use k nearest neighbors. default: 10 53 | PRMstarkConfigDefault: 54 | type: geometric::PRMstar 55 | manipulator: 56 | planner_configs: 57 | - SBLkConfigDefault 58 | - ESTkConfigDefault 59 | - LBKPIECEkConfigDefault 60 | - BKPIECEkConfigDefault 61 | - KPIECEkConfigDefault 62 | - RRTkConfigDefault 63 | - RRTConnectkConfigDefault 64 | - RRTstarkConfigDefault 65 | - TRRTkConfigDefault 66 | - PRMkConfigDefault 67 | - PRMstarkConfigDefault -------------------------------------------------------------------------------- /iiwa_moveit/launch/default_warehouse_db.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/demo.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ["/move_group/fake_controller_joint_states"] 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/fake_moveit_controller_manager.launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/iiwa_moveit_controller_manager.launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/iiwa_moveit_sensor_manager.launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/joystick_control.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/move_group.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/moveit_planning_execution.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/moveit_rviz.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/ompl_planning_pipeline.launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/planning_context.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/planning_pipeline.launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/run_benchmark_ompl.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/sensor_manager.launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/setup_assistant.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/trajectory_execution.launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/warehouse.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /iiwa_moveit/launch/warehouse_settings.launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /iiwa_moveit/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | iiwa_moveit 4 | 1.4.0 5 | 6 | A package with all the configuration and launch files for using the KUKA LBR IIWA with the MoveIt Motion Planning Framework 7 | 8 | Salvo Virga 9 | Salvo Virga 10 | 11 | BSD 12 | 13 | catkin 14 | 15 | moveit_ros_move_group 16 | moveit_setup_assistant 17 | moveit_planners_ompl 18 | moveit_fake_controller_manager 19 | moveit_simple_controller_manager 20 | joint_state_controller 21 | joint_trajectory_controller 22 | position_controllers 23 | velocity_controllers 24 | effort_controllers 25 | gazebo_ros_control 26 | moveit_ros_planning_interface 27 | moveit_ros_warehouse 28 | moveit_ros_visualization 29 | joint_state_publisher 30 | robot_state_publisher 31 | xacro 32 | iiwa_description 33 | iiwa_hw 34 | 35 | 36 | -------------------------------------------------------------------------------- /iiwa_msgs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(iiwa_msgs) 3 | 4 | find_package(catkin REQUIRED COMPONENTS 5 | actionlib_msgs 6 | message_generation 7 | cmake_modules 8 | geometry_msgs 9 | std_msgs 10 | ) 11 | 12 | # Declare the message files to be built 13 | add_message_files(DIRECTORY msg) 14 | add_service_files(DIRECTORY srv) 15 | add_action_files(DIRECTORY action) 16 | 17 | # Actually generate the language-specific message and service files 18 | generate_messages(DEPENDENCIES std_msgs geometry_msgs actionlib_msgs) 19 | 20 | catkin_package(CATKIN_DEPENDS message_runtime std_msgs geometry_msgs) 21 | -------------------------------------------------------------------------------- /iiwa_msgs/action/MoveAlongSpline.action: -------------------------------------------------------------------------------- 1 | # Goal 2 | Spline spline 3 | 4 | --- 5 | # Result 6 | bool success 7 | string error 8 | 9 | --- 10 | # Feedback 11 | -------------------------------------------------------------------------------- /iiwa_msgs/action/MoveToCartesianPose.action: -------------------------------------------------------------------------------- 1 | # Goal 2 | CartesianPose cartesian_pose 3 | 4 | --- 5 | # Result 6 | bool success 7 | string error 8 | 9 | --- 10 | # Feedback 11 | -------------------------------------------------------------------------------- /iiwa_msgs/action/MoveToJointPosition.action: -------------------------------------------------------------------------------- 1 | # Goal 2 | iiwa_msgs/JointPosition joint_position 3 | 4 | --- 5 | # Result 6 | bool success 7 | string error 8 | 9 | --- 10 | # Feedback 11 | -------------------------------------------------------------------------------- /iiwa_msgs/msg/CartesianControlModeLimits.msg: -------------------------------------------------------------------------------- 1 | # Sets the maximum cartesian deviation accepted. If the deviation is exceeded a stop condition occurs. 2 | # [x, y, z] in [mm]. Precondition: value > 0.0. 3 | # [a, b, c] in [rad]. Precondition: value > 0.0. 4 | CartesianQuantity max_path_deviation 5 | 6 | # The maximum control force parameter. 7 | # [x, y, z] in [N]. Precondition: value > 0.0. 8 | # [a, b, c] in [Nm]. Precondition: value > 0.0. 9 | CartesianQuantity max_control_force 10 | 11 | # Indicates whether a stop condition is fired if the maximum control force is exceeded. 12 | bool max_control_force_stop 13 | 14 | # Maximum Cartesian velocity parameter 15 | # [x, y, z] in [mm/s]. Precondition: value > 0.0. 16 | # [a, b, c] in [rad/s]. Precondition: value > 0.0. 17 | CartesianQuantity max_cartesian_velocity 18 | -------------------------------------------------------------------------------- /iiwa_msgs/msg/CartesianEulerPose.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | CartesianQuantity pose -------------------------------------------------------------------------------- /iiwa_msgs/msg/CartesianImpedanceControlMode.msg: -------------------------------------------------------------------------------- 1 | 2 | # Stiffness values [x, y, z, a, b, c] for the cartesian impedance, x, y, z in [N/m], a, b, c in [Nm/rad]. 3 | # Precondition: 0.0 <= x, y, z <= 5000.0 and 0.0 <= a, b, c <= 300.0. 4 | CartesianQuantity cartesian_stiffness 5 | 6 | # Dimensionless damping values for the cartesian impedance control, for all degrees of freedom : [x, y, z, a, b, c]. 7 | # Precondition: 0.1 <= x, y, z, a, b, c <= 1.0. 8 | CartesianQuantity cartesian_damping 9 | 10 | # The stiffness value for null space [Nm/rad]. 11 | # Precondition: 0.0 <= value. 12 | float64 nullspace_stiffness 13 | 14 | # The damping parameter for null space [Nm*s/rad]. 15 | # Precondition: value >= 0.3 and value <= 1.0. - A good damping value is 0.7. 16 | float64 nullspace_damping -------------------------------------------------------------------------------- /iiwa_msgs/msg/CartesianPlane.msg: -------------------------------------------------------------------------------- 1 | int32 XY = 1 2 | int32 XZ = 2 3 | int32 YZ = 3 -------------------------------------------------------------------------------- /iiwa_msgs/msg/CartesianPose.msg: -------------------------------------------------------------------------------- 1 | # Target Pose including redundancy information. 2 | geometry_msgs/PoseStamped poseStamped 3 | 4 | # If you have issues with the robot not executing the motion copy this value from the Cartesian Position Tab of the 5 | # robot SmartPad. Set both parameters to -1 to disable them. 6 | RedundancyInformation redundancy 7 | -------------------------------------------------------------------------------- /iiwa_msgs/msg/CartesianQuantity.msg: -------------------------------------------------------------------------------- 1 | float32 x 2 | float32 y 3 | float32 z 4 | float32 a 5 | float32 b 6 | float32 c -------------------------------------------------------------------------------- /iiwa_msgs/msg/CartesianVelocity.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | CartesianQuantity velocity -------------------------------------------------------------------------------- /iiwa_msgs/msg/CartesianWrench.msg: -------------------------------------------------------------------------------- 1 | # Cartesian Wrench 2 | Header header 3 | geometry_msgs/Wrench wrench 4 | geometry_msgs/Wrench inaccuracy 5 | -------------------------------------------------------------------------------- /iiwa_msgs/msg/ControlMode.msg: -------------------------------------------------------------------------------- 1 | int32 POSITION_CONTROL = 0 2 | int32 JOINT_IMPEDANCE = 1 3 | int32 CARTESIAN_IMPEDANCE = 2 4 | int32 DESIRED_FORCE = 3 5 | int32 SINE_PATTERN = 4 -------------------------------------------------------------------------------- /iiwa_msgs/msg/DOF.msg: -------------------------------------------------------------------------------- 1 | int32 X = 1 2 | int32 Y = 2 3 | int32 Z = 3 4 | int32 A = 4 5 | int32 B = 5 6 | int32 C = 6 7 | int32 ROT = 7 8 | int32 TRANSL = 8 9 | int32 ALL = 9 10 | -------------------------------------------------------------------------------- /iiwa_msgs/msg/DesiredForceControlMode.msg: -------------------------------------------------------------------------------- 1 | # The degree of freedom on which the desired force 2 | int32 cartesian_dof 3 | 4 | # The value of the desired force. In [N]. 5 | float64 desired_force 6 | 7 | # The value of the stiffness. In [N/m]. 8 | float64 desired_stiffness -------------------------------------------------------------------------------- /iiwa_msgs/msg/JointDamping.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | JointQuantity damping -------------------------------------------------------------------------------- /iiwa_msgs/msg/JointImpedanceControlMode.msg: -------------------------------------------------------------------------------- 1 | # Stiffness values in [Nm/rad]. Stiffness values must be >= 0. 2 | JointQuantity joint_stiffness 3 | 4 | # Damping values. Damping values must be between 0 and 1. 5 | JointQuantity joint_damping 6 | -------------------------------------------------------------------------------- /iiwa_msgs/msg/JointPosition.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | JointQuantity position -------------------------------------------------------------------------------- /iiwa_msgs/msg/JointPositionVelocity.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | JointQuantity position 3 | JointQuantity velocity -------------------------------------------------------------------------------- /iiwa_msgs/msg/JointQuantity.msg: -------------------------------------------------------------------------------- 1 | float32 a1 2 | float32 a2 3 | float32 a3 4 | float32 a4 5 | float32 a5 6 | float32 a6 7 | float32 a7 -------------------------------------------------------------------------------- /iiwa_msgs/msg/JointStiffness.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | JointQuantity stiffness -------------------------------------------------------------------------------- /iiwa_msgs/msg/JointTorque.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | JointQuantity torque -------------------------------------------------------------------------------- /iiwa_msgs/msg/JointVelocity.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | JointQuantity velocity -------------------------------------------------------------------------------- /iiwa_msgs/msg/RedundancyInformation.msg: -------------------------------------------------------------------------------- 1 | # E1 parameter 2 | # Specifies Angle of the elbow joint. 3 | float64 e1 4 | 5 | # Status parameter 6 | # Bit 0: 1 - The robot is working above its head 7 | # 0 - The robot is working in the ground area 8 | # Bit 1: 1 - Angle A4 < 0° 9 | # 0 - Angle A4 >= 0° 10 | # Bit 2: 1 - Angle A6 <= 0 11 | # 0 - Angle A6 > 0 12 | int32 status 13 | 14 | # Turn parameter 15 | # According to Sunrise handbook this is not used for the iiwa. 16 | int32 turn 17 | -------------------------------------------------------------------------------- /iiwa_msgs/msg/SinePatternControlMode.msg: -------------------------------------------------------------------------------- 1 | # The degree of freedom for performing the sine oscillation. 2 | int32 cartesian_dof 3 | 4 | # The value of the frequency for the sine oscillation [Hz]. 5 | float64 frequency 6 | 7 | # The value of the amplitude. In [N]. 8 | float64 amplitude 9 | 10 | # The value of the stiffness. In [N/m]. 11 | float64 stiffness -------------------------------------------------------------------------------- /iiwa_msgs/msg/Spline.msg: -------------------------------------------------------------------------------- 1 | # The describes a motion along a spline 2 | 3 | SplineSegment[] segments -------------------------------------------------------------------------------- /iiwa_msgs/msg/SplineSegment.msg: -------------------------------------------------------------------------------- 1 | # This message describes a segment of a spline path 2 | 3 | int32 SPL = 0 4 | int32 LIN = 1 5 | int32 CIRC = 2 6 | 7 | # The type of the spline segment 8 | int32 type 9 | 10 | # The endpoint of the current segment 11 | CartesianPose point 12 | 13 | # Auxiliary point. Only used for circular segments 14 | CartesianPose point_aux -------------------------------------------------------------------------------- /iiwa_msgs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | iiwa_msgs 4 | 2.3.1 5 | ROS Messages to communicate with a KUKA LBR IIWA Robot 6 | Salvo Virga 7 | Salvo Virga 8 | 9 | BSD 10 | 11 | catkin 12 | 13 | actionlib_msgs 14 | message_generation 15 | message_runtime 16 | std_msgs 17 | geometry_msgs 18 | 19 | -------------------------------------------------------------------------------- /iiwa_msgs/srv/ConfigureControlMode.srv: -------------------------------------------------------------------------------- 1 | # This service allows to set a control mode at runtime. 2 | # The user can select control modes defined in iiwa_msgs/ControlMode and set the respective parameters accordingly to the selected mode. 3 | 4 | int32 control_mode 5 | iiwa_msgs/JointImpedanceControlMode joint_impedance 6 | iiwa_msgs/CartesianImpedanceControlMode cartesian_impedance 7 | iiwa_msgs/DesiredForceControlMode desired_force 8 | iiwa_msgs/SinePatternControlMode sine_pattern 9 | iiwa_msgs/CartesianControlModeLimits limits 10 | --- 11 | bool success 12 | string error -------------------------------------------------------------------------------- /iiwa_msgs/srv/SetEndpointFrame.srv: -------------------------------------------------------------------------------- 1 | # This service allows to select the frame that is used for cartesian positioning 2 | 3 | # Id of Sunrise frame 4 | string frame_id 5 | 6 | --- 7 | 8 | bool success 9 | string error -------------------------------------------------------------------------------- /iiwa_msgs/srv/SetPTPCartesianSpeedLimits.srv: -------------------------------------------------------------------------------- 1 | # This service allows to set the speed limits for cartesian PTP motions. 2 | # Set the parameters you do not want to set to -1 to ignore them. 3 | 4 | # Maximum translational speed in m/s 5 | float64 maxCartesianVelocity 6 | 7 | # Maximum rotational speed in rad/s 8 | float64 maxOrientationVelocity 9 | 10 | # Maximum translational acceleration in m/s^2 11 | float64 maxCartesianAcceleration 12 | 13 | # Maximum rotational acceleration in rad/s^2 14 | float64 maxOrientationAcceleration 15 | 16 | # Maximum allowed translational jerk in m/s^3 17 | float64 maxCartesianJerk 18 | 19 | # Maximum allowed rotational jerk in rad/s^3 20 | float64 maxOrientationJerk 21 | 22 | --- 23 | bool success 24 | string error 25 | -------------------------------------------------------------------------------- /iiwa_msgs/srv/SetPTPJointSpeedLimits.srv: -------------------------------------------------------------------------------- 1 | # This service allows to set relative joint velocity and acceleration of the robot. 2 | # Set a parameter to -1 to ignore it 3 | 4 | # Relative velocity of the individual joints, 0.0 < value <= 1 5 | float64 joint_relative_velocity 6 | 7 | # Relative acceleration of the individual joints, 0.0 < value <= 1.0 8 | float64 joint_relative_acceleration 9 | 10 | --- 11 | 12 | bool success 13 | string error 14 | -------------------------------------------------------------------------------- /iiwa_msgs/srv/SetSmartServoJointSpeedLimits.srv: -------------------------------------------------------------------------------- 1 | # This service allows to set relative joint velocity and acceleration of the robot at runtime. 2 | # Set a parameter to -1 to ignore it 3 | 4 | # Relative velocity of the individual joints, 0.0 < value <= 1 5 | float64 joint_relative_velocity 6 | 7 | # Relative acceleration of the individual joints, 0.0 < value <= 1.0 8 | float64 joint_relative_acceleration 9 | 10 | # Override the acceleration factor for all joints. Must be between 0.0 and 10.0. 11 | float64 override_joint_acceleration 12 | 13 | --- 14 | 15 | bool success 16 | string error -------------------------------------------------------------------------------- /iiwa_msgs/srv/SetSmartServoLinSpeedLimits.srv: -------------------------------------------------------------------------------- 1 | # Translational and rotational speed in m/s and rad/s 2 | geometry_msgs/Twist max_cartesian_velocity 3 | 4 | --- 5 | 6 | bool success 7 | string error 8 | -------------------------------------------------------------------------------- /iiwa_msgs/srv/SetSpeedOverride.srv: -------------------------------------------------------------------------------- 1 | # Override the velocity factor for all motions (relative between 0.0 and 1.0) 2 | float64 override_reduction 3 | 4 | --- 5 | 6 | bool success 7 | string error -------------------------------------------------------------------------------- /iiwa_msgs/srv/SetWorkpiece.srv: -------------------------------------------------------------------------------- 1 | # This service allows to attach a workpiece to the robots tool. 2 | # Setting a new workpiece automatically detaches the old one. 3 | 4 | # Id of Sunrise workpiece template. Leave emtpy to detach current workpiece. 5 | string workpiece_id 6 | --- 7 | bool success 8 | string error -------------------------------------------------------------------------------- /iiwa_msgs/srv/TimeToDestination.srv: -------------------------------------------------------------------------------- 1 | --- 2 | float64 remaining_time 3 | -------------------------------------------------------------------------------- /iiwa_ros/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(iiwa_ros) 3 | 4 | set(CMAKE_CXX_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 6 | 7 | find_package(catkin REQUIRED COMPONENTS 8 | iiwa_msgs 9 | cmake_modules 10 | roscpp 11 | ) 12 | 13 | catkin_package( 14 | INCLUDE_DIRS include 15 | LIBRARIES ${PROJECT_NAME} 16 | CATKIN_DEPENDS iiwa_msgs roscpp 17 | ) 18 | 19 | add_library(${PROJECT_NAME} 20 | src/iiwa_ros.cpp 21 | 22 | src/state/cartesian_pose.cpp 23 | src/state/cartesian_wrench.cpp 24 | src/state/joint_position.cpp 25 | src/state/joint_torque.cpp 26 | src/state/external_joint_torque.cpp 27 | src/state/joint_velocity.cpp 28 | src/state/destination_reached.cpp 29 | 30 | src/command/generic_command.cpp 31 | src/command/cartesian_pose.cpp 32 | src/command/cartesian_pose_linear.cpp 33 | src/command/joint_position.cpp 34 | src/command/joint_position_velocity.cpp 35 | src/command/joint_velocity.cpp 36 | 37 | src/service/control_mode.cpp 38 | src/service/path_parameters.cpp 39 | src/service/path_parameters_lin.cpp 40 | src/service/time_to_destination.cpp 41 | ) 42 | 43 | target_include_directories(${PROJECT_NAME} PUBLIC include ${catkin_INCLUDE_DIRS}) 44 | 45 | target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) 46 | 47 | add_executable(iiwa_ros_test src/main.cpp) 48 | target_include_directories(iiwa_ros_test PUBLIC include ${catkin_INCLUDE_DIRS}) 49 | target_link_libraries(iiwa_ros_test ${PROJECT_NAME}) 50 | 51 | ## Add dependence to the iiwa_msg module for the library 52 | add_dependencies(${PROJECT_NAME} iiwa_msgs_generate_messages_cpp) 53 | 54 | install(TARGETS ${PROJECT_NAME} iiwa_ros_test 55 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 56 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 57 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 58 | ) 59 | 60 | install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}/) 61 | install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 62 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/command/cartesian_pose.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include 35 | 36 | namespace iiwa_ros { 37 | namespace command { 38 | 39 | /** 40 | * @brief Sends Cartesian motion commmands to the connected robot. 41 | */ 42 | class CartesianPose : public GenericCommand { 43 | public: 44 | CartesianPose() = default; 45 | 46 | /** 47 | * @brief Initialize the object with a given robot namespace. 48 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 49 | */ 50 | void init(const std::string& robot_namespace) override; 51 | 52 | /** 53 | * @brief Command the robot end-effector to move to the given Cartesian pose. 54 | * @param [in] pose - the commanded Cartesian pose. 55 | */ 56 | void setPose(const geometry_msgs::PoseStamped& pose); 57 | 58 | /** 59 | * @brief Command the robot end-effector to move to the given Cartesian pose. 60 | * @param [in] pose - the commanded Cartesian pose. 61 | * @param [in] callback - a callback function to call when the motion terminates. 62 | */ 63 | void setPose(const geometry_msgs::PoseStamped& pose, const std::function callback); 64 | 65 | private: 66 | Command command_{}; 67 | }; 68 | 69 | } // namespace command 70 | } // namespace iiwa_ros 71 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/command/cartesian_pose_linear.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include 35 | 36 | namespace iiwa_ros { 37 | namespace command { 38 | 39 | /** 40 | * @brief Sends Cartesian linear motion commmands to the connected robot. 41 | */ 42 | class CartesianPoseLinear : public GenericCommand { 43 | public: 44 | CartesianPoseLinear() = default; 45 | 46 | /** 47 | * @brief Initialize the object with a given robot namespace. 48 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 49 | */ 50 | void init(const std::string& robot_namespace) override; 51 | 52 | /** 53 | * @brief Command the robot end-effector to move to the given Cartesian pose using a linear movement. 54 | * @param [in] pose - the commanded Cartesian pose. 55 | */ 56 | void setPose(const geometry_msgs::PoseStamped& pose); 57 | 58 | /** 59 | * @brief Command the robot end-effector to move to the given Cartesian pose using a linear movement. 60 | * @param [in] pose - the commanded Cartesian pose. 61 | * @param [in] callback - a callback function to call when the motion terminates. 62 | */ 63 | void setPose(const geometry_msgs::PoseStamped& pose, const std::function callback); 64 | 65 | private: 66 | Command command_{}; 67 | }; 68 | 69 | } // namespace command 70 | } // namespace iiwa_ros 71 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/command/generic_command.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include "iiwa_ros/iiwa_ros.hpp" 35 | #include "iiwa_ros/service/time_to_destination.hpp" 36 | 37 | namespace iiwa_ros { 38 | namespace command { 39 | 40 | /** 41 | * @brief A class that represents a general command to send to the robot. 42 | * 43 | */ 44 | class GenericCommand : public Robot { 45 | 46 | protected: 47 | GenericCommand() = default; 48 | 49 | std::function callback_{nullptr}; 50 | iiwa_ros::service::TimeToDestinationService time_to_destination_{}; 51 | 52 | /** 53 | * @brief An internal observer, it will wait until the commanded motion is completed and call a given callback function. 54 | */ 55 | void completedMotionWatcher(); 56 | }; 57 | 58 | } // namespace command 59 | } // namespace iiwa_ros 60 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/command/joint_position.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include 35 | 36 | namespace iiwa_ros { 37 | namespace command { 38 | 39 | /** 40 | * @brief Sends joint motion commmands to the connected robot. 41 | */ 42 | class JointPosition : public GenericCommand { 43 | public: 44 | JointPosition() = default; 45 | 46 | /** 47 | * @brief Initialize the object with a given robot namespace. 48 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 49 | */ 50 | void init(const std::string& robot_namespace) override; 51 | 52 | /** 53 | * @brief Command the robot to move to the given joint configuration. 54 | * @param [in] position - the commanded joint configuration. 55 | */ 56 | void setPosition(const iiwa_msgs::JointPosition& position); 57 | 58 | /** 59 | * @brief Command the robot to move to the given joint configuration. 60 | * @param [in] position - the commanded joint configuration. 61 | * @param [in] callback - a callback function to call when the motion terminates. 62 | */ 63 | void setPosition(const iiwa_msgs::JointPosition& position, const std::function callback); 64 | 65 | private: 66 | Command command_{}; 67 | }; 68 | 69 | } // namespace command 70 | } // namespace iiwa_ros 71 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/command/joint_position_velocity.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include 35 | 36 | namespace iiwa_ros { 37 | namespace command { 38 | 39 | /** 40 | * @brief Sends joint motion commmands to the connected robot, 41 | * also including the velocity with which the robot has to reach the target configuration. 42 | */ 43 | class JointPositionVelocity : public GenericCommand { 44 | public: 45 | JointPositionVelocity() = default; 46 | 47 | /** 48 | * @brief Initialize the object with a given robot namespace. 49 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 50 | */ 51 | void init(const std::string& robot_namespace) override; 52 | 53 | /** 54 | * @brief Command the robot to move to the given joint configuration and reach it with the given velocity. 55 | * @param [in] position - the commanded joint position and velocity. 56 | */ 57 | void setPosition(const iiwa_msgs::JointPositionVelocity& position); 58 | 59 | /** 60 | * @brief Command the robot to move to the given joint configuration and reach it with the given velocity. 61 | * @param [in] position - the commanded joint position and velocity. 62 | * @param [in] callback - a callback function to call when the motion terminates. 63 | */ 64 | void setPosition(const iiwa_msgs::JointPositionVelocity& position, const std::function callback); 65 | 66 | private: 67 | Command command_{}; 68 | }; 69 | 70 | } // namespace command 71 | } // namespace iiwa_ros 72 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/command/joint_velocity.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include 35 | 36 | namespace iiwa_ros { 37 | namespace command { 38 | 39 | /** 40 | * @brief Sends joint velocity commmands to the connected robot. 41 | */ 42 | class JointVelocity : public GenericCommand { 43 | public: 44 | JointVelocity() = default; 45 | 46 | /** 47 | * @brief Initialize the object with a given robot namespace. 48 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 49 | */ 50 | void init(const std::string& robot_namespace) override; 51 | 52 | /** 53 | * @brief Command the robot to move with the given joint velocity. 54 | * @param [in] velocity - the commanded joint velocity. 55 | */ 56 | void setVelocity(const iiwa_msgs::JointVelocity& velocity); 57 | 58 | /** 59 | * @brief Command the robot to move with the given joint velocity. 60 | * @param [in] velocity - the commanded joint velocity. 61 | * @param [in] callback - a callback function to call when the motion terminates. 62 | */ 63 | void setVelocity(const iiwa_msgs::JointVelocity& velocity, const std::function callback); 64 | 65 | private: 66 | Command command_{}; 67 | }; 68 | 69 | } // namespace command 70 | } // namespace iiwa_ros 71 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/service/iiwa_services.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | 35 | namespace iiwa_ros { 36 | namespace service { 37 | 38 | template 39 | /** 40 | * @brief This class provides a templated base class for service wrappers. 41 | */ 42 | class iiwaServices : public Robot { 43 | public: 44 | iiwaServices() = default; 45 | virtual ~iiwaServices() = default; 46 | 47 | /** 48 | * @brief Sets the verbosity level. 49 | * If true some ROS_INFO messages will be printed out during service calls. 50 | */ 51 | virtual void setVerbosity(const bool verbose) { verbose_ = verbose; } 52 | 53 | /** 54 | * @brief Returns the error string obtained from the last service call that produced an error. 55 | * Available only if the implementation of the service call produces a string error in case of failure. 56 | * 57 | * @return std::string 58 | */ 59 | virtual std::string getLastError() { return service_error_; } 60 | 61 | protected: 62 | 63 | /** 64 | * @brief Implements the actual service call. 65 | * 66 | * @return bool 67 | */ 68 | virtual bool callService() = 0; 69 | 70 | std::string service_name_{""}; 71 | ros::ServiceClient client_{}; 72 | T config_{}; 73 | bool verbose_{true}; 74 | std::string service_error_{""}; 75 | bool service_ready_{false}; 76 | }; 77 | 78 | } // namespace service 79 | } // namespace iiwa_ros 80 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/service/path_parameters_lin.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include 35 | 36 | namespace iiwa_ros { 37 | namespace service { 38 | 39 | /** 40 | * @brief This class provides a wrapper for the PathParametersLinService service. 41 | * Once an object of this class is initialized using the appropriate robot namespace name, 42 | * it is possible to call its functions to set the desired max cartesian velocity to be applied during linear motions. 43 | */ 44 | class PathParametersLinService : public iiwaServices { 45 | public: 46 | PathParametersLinService() = default; 47 | virtual ~PathParametersLinService() override = default; 48 | 49 | virtual void init(const std::string& robot_namespace) override; 50 | 51 | /** 52 | * @brief Set the maximum cartesian velocity to be applied during SmartServoLin motions. 53 | * 54 | * @param [in] max_cartesian_velocity - Maximum velocity in its Cartesian components. 55 | * @return bool - success status. 56 | */ 57 | bool setMaxCartesianVelocity(const geometry_msgs::Twist max_cartesian_velocity); 58 | 59 | protected: 60 | virtual bool callService() override; 61 | }; 62 | 63 | } // namespace service 64 | } // namespace iiwa_ros 65 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/service/time_to_destination.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include 35 | 36 | namespace iiwa_ros { 37 | namespace service { 38 | 39 | /** 40 | * @brief This class provides a wrapper for the TimeToDestination service. 41 | * Once an object of this class is initialized using the appropriate robot namespace, 42 | * it is possible to call its functions to get the time left - in seconds - to reach the last given 43 | * destination. 44 | * If the robot already reached its last commanded destination, a negative number will be returned. That is the time - 45 | * in seconds - since the robot reached that destination. 46 | * The value -999 will be returned if an error occurs. 47 | */ 48 | class TimeToDestinationService : public iiwaServices { 49 | public: 50 | TimeToDestinationService() = default; 51 | virtual ~TimeToDestinationService() override = default; 52 | 53 | virtual void init(const std::string& robot_namespace) override; 54 | 55 | /** 56 | * @brief Returns the time left to reach the last commanded destination in seconds. 57 | * A negative value represents the time since the robot reached its last commanded destination. 58 | * The value -999 will be returned if an error occurs. 59 | * 60 | * @return double 61 | */ 62 | double getTimeToDestination(); 63 | 64 | protected: 65 | virtual bool callService() override; 66 | 67 | private: 68 | double time_to_destination_{0}; 69 | }; 70 | 71 | } // namespace service 72 | } // namespace iiwa_ros 73 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/state/cartesian_pose.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include "iiwa_ros/state/generic_state.hpp" 35 | 36 | namespace iiwa_ros { 37 | namespace state { 38 | 39 | /** 40 | * @brief Receives the current Cartesian position of the robot end-effector. 41 | */ 42 | class CartesianPose : public GenericState { 43 | public: 44 | CartesianPose() = default; 45 | 46 | /** 47 | * @brief Initialize the object with a given robot namespace. 48 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 49 | */ 50 | virtual void init(const std::string& robot_namespace) override; 51 | 52 | /** 53 | * @brief Initialize the object with the given robot namespace and callback function. 54 | * @param [in] robot_namespace - the namespace under which the state topics for the desired robot exist. 55 | * @param [in] callback - a callback function to call when a new state is received. 56 | */ 57 | void init(const std::string& robot_namespace, const std::function callback); 58 | 59 | /** 60 | * @brief Returns the current Cartesian pose of the robot end-effector. 61 | */ 62 | iiwa_msgs::CartesianPose getPose(); 63 | 64 | private: 65 | State state_{}; 66 | }; 67 | 68 | } // namespace state 69 | } // namespace iiwa_ros 70 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/state/cartesian_wrench.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include "iiwa_msgs/CartesianWrench.h" 34 | #include "iiwa_ros/state/generic_state.hpp" 35 | 36 | namespace iiwa_ros { 37 | namespace state { 38 | 39 | /** 40 | * @brief Receives the current Cartesian wrench applied onto the robot end-effector. 41 | */ 42 | class CartesianWrench : public GenericState { 43 | public: 44 | CartesianWrench() = default; 45 | 46 | /** 47 | * @brief Initialize the object with a given robot namespace. 48 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 49 | */ 50 | virtual void init(const std::string& robot_namespace) override; 51 | 52 | /** 53 | * @brief Initialize the object with the given robot namespace and callback function. 54 | * @param [in] robot_namespace - the namespace under which the state topics for the desired robot exist. 55 | * @param [in] callback - a callback function to call when a new state is received. 56 | */ 57 | void init(const std::string& robot_namespace, const std::function callback); 58 | 59 | /** 60 | * @brief Returns the current Cartesian wrench applied onto the robot end-effector. 61 | */ 62 | iiwa_msgs::CartesianWrench getWrench(); 63 | 64 | private: 65 | State state_{}; 66 | }; 67 | 68 | } // namespace state 69 | } // namespace iiwa_ros 70 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/state/destination_reached.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include 34 | #include "iiwa_ros/state/generic_state.hpp" 35 | 36 | namespace iiwa_ros { 37 | namespace state { 38 | 39 | class DestinationReached : public GenericState { 40 | public: 41 | DestinationReached() = default; 42 | 43 | /** 44 | * @brief Initialize the object with a given robot namespace. 45 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 46 | */ 47 | virtual void init(const std::string& robot_namespace) override; 48 | 49 | /** 50 | * @brief Initialize the object with the given robot namespace and callback function. 51 | * @param [in] robot_namespace - the namespace under which the state topics for the desired robot exist. 52 | * @param [in] callback - a callback function to call when a new state is received. 53 | */ 54 | void init(const std::string& robot_namespace, const std::function callback); 55 | 56 | /** 57 | * @brief Returns the time at which the robot reached its last commended destination. 58 | */ 59 | std_msgs::Time getTime(); 60 | 61 | private: 62 | State state_{}; 63 | }; 64 | 65 | } // namespace state 66 | } // namespace iiwa_ros 67 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/state/external_joint_torque.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include "iiwa_msgs/JointTorque.h" 34 | #include "iiwa_ros/state/generic_state.hpp" 35 | 36 | namespace iiwa_ros { 37 | namespace state { 38 | 39 | class ExternalJointTorque : public GenericState { 40 | public: 41 | ExternalJointTorque() = default; 42 | 43 | /** 44 | * @brief Initialize the object with a given robot namespace. 45 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 46 | */ 47 | virtual void init(const std::string& robot_namespace) override; 48 | 49 | /** 50 | * @brief Initialize the object with the given robot namespace and callback function. 51 | * @param [in] robot_namespace - the namespace under which the state topics for the desired robot exist. 52 | * @param [in] callback - a callback function to call when a new state is received. 53 | */ 54 | void init(const std::string& robot_namespace, const std::function callback); 55 | 56 | /** 57 | * @brief Returns the current robot external joint torque. 58 | */ 59 | iiwa_msgs::JointTorque getTorque(); 60 | 61 | private: 62 | State state_{}; 63 | }; 64 | 65 | } // namespace state 66 | } // namespace iiwa_ros 67 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/state/generic_state.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include "iiwa_ros/iiwa_ros.hpp" 34 | 35 | namespace iiwa_ros { 36 | namespace state { 37 | 38 | class GenericState : public Robot { 39 | public: 40 | bool isConnected() { 41 | ros::Duration diff = (ros::Time::now() - last_update_time); 42 | return (diff < ros::Duration(0.25)); 43 | } 44 | 45 | protected: 46 | GenericState() = default; 47 | 48 | }; 49 | 50 | } // namespace state 51 | } // namespace iiwa_ros 52 | 53 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/state/joint_position.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include "iiwa_msgs/JointPosition.h" 34 | #include "iiwa_ros/state/generic_state.hpp" 35 | 36 | namespace iiwa_ros { 37 | namespace state { 38 | 39 | class JointPosition : public GenericState { 40 | public: 41 | JointPosition() = default; 42 | 43 | /** 44 | * @brief Initialize the object with a given robot namespace. 45 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 46 | */ 47 | virtual void init(const std::string& robot_namespace) override; 48 | 49 | /** 50 | * @brief Initialize the object with the given robot namespace and callback function. 51 | * @param [in] robot_namespace - the namespace under which the state topics for the desired robot exist. 52 | * @param [in] callback - a callback function to call when a new state is received. 53 | */ 54 | void init(const std::string& robot_namespace, const std::function callback); 55 | 56 | /** 57 | * @brief Returns the current robot joint position. 58 | */ 59 | iiwa_msgs::JointPosition getPosition(); 60 | 61 | private: 62 | State state_{}; 63 | }; 64 | 65 | } // namespace state 66 | } // namespace iiwa_ros 67 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/state/joint_torque.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include "iiwa_msgs/JointTorque.h" 34 | #include "iiwa_ros/state/generic_state.hpp" 35 | 36 | namespace iiwa_ros { 37 | namespace state { 38 | 39 | class JointTorque : public GenericState { 40 | public: 41 | JointTorque() = default; 42 | 43 | /** 44 | * @brief Initialize the object with a given robot namespace. 45 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 46 | */ 47 | virtual void init(const std::string& robot_namespace) override; 48 | 49 | /** 50 | * @brief Initialize the object with the given robot namespace and callback function. 51 | * @param [in] robot_namespace - the namespace under which the state topics for the desired robot exist. 52 | * @param [in] callback - a callback function to call when a new state is received. 53 | */ 54 | void init(const std::string& robot_namespace, const std::function callback); 55 | 56 | /** 57 | * @brief Returns the current robot joint torque. 58 | */ 59 | iiwa_msgs::JointTorque getTorque(); 60 | 61 | private: 62 | State state_{}; 63 | }; 64 | 65 | } // namespace state 66 | } // namespace iiwa_ros 67 | -------------------------------------------------------------------------------- /iiwa_ros/include/iiwa_ros/state/joint_velocity.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Salvatore Virga - salvo.virga@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #pragma once 32 | 33 | #include "iiwa_msgs/JointVelocity.h" 34 | #include "iiwa_ros/state/generic_state.hpp" 35 | 36 | namespace iiwa_ros { 37 | namespace state { 38 | 39 | class JointVelocity : public GenericState { 40 | public: 41 | JointVelocity() = default; 42 | 43 | /** 44 | * @brief Initialize the object with a given robot namespace. 45 | * @param [in] robot_namespace - the namespace under which the command topics for the desired robot exist. 46 | */ 47 | virtual void init(const std::string& robot_namespace) override; 48 | 49 | /** 50 | * @brief Initialize the object with the given robot namespace and callback function. 51 | * @param [in] robot_namespace - the namespace under which the state topics for the desired robot exist. 52 | * @param [in] callback - a callback function to call when a new state is received. 53 | */ 54 | void init(const std::string& robot_namespace, const std::function callback); 55 | 56 | /** 57 | * @brief Returns the current robot joint velocity. 58 | */ 59 | iiwa_msgs::JointVelocity getVelocity(); 60 | 61 | private: 62 | State state_{}; 63 | }; 64 | 65 | } // namespace state 66 | } // namespace iiwa_ros 67 | -------------------------------------------------------------------------------- /iiwa_ros/launch/toolbar_example.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | ['spec','handeye','take,remove', 'spec', 'foo', 'spam', 'bar,baz'] 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /iiwa_ros/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | iiwa_ros 4 | 1.4.0 5 | The iiwa_ros package 6 | Salvo Virga 7 | Salvo Virga 8 | 9 | BSD 10 | 11 | catkin 12 | 13 | roscpp 14 | iiwa_msgs 15 | 16 | 17 | -------------------------------------------------------------------------------- /iiwa_ros/scripts/ntp_verifier.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | import rospy 4 | from sensor_msgs.msg import JointState 5 | from iiwa_msgs.msg import CartesianPose 6 | 7 | rospy.init_node('ntp_verifier') 8 | 9 | last_msg = None 10 | 11 | def ntplog(msg): 12 | global last_msg 13 | last_msg = msg 14 | 15 | def print_msg(msg): 16 | if msg is not None: 17 | diff = msg.poseStamped.header.stamp - rospy.Time.now() 18 | print('The current time difference is: {} secs'.format(diff.to_sec())) 19 | 20 | sub = rospy.Subscriber('/iiwa/state/CartesianPose', CartesianPose, ntplog, queue_size=1) 21 | 22 | while not rospy.is_shutdown(): 23 | print_msg(last_msg) 24 | -------------------------------------------------------------------------------- /iiwa_ros/scripts/toolbar_event_publisher: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | from itertools import groupby 4 | import rospy 5 | from std_msgs.msg import Empty, String 6 | 7 | if __name__ == '__main__': 8 | rospy.init_node('toolbar_event_publisher') 9 | 10 | spec_param = rospy.get_param('toolbarSpecifications') 11 | specs = [list(group) for k, group in groupby(spec_param, lambda x: x == 'spec') if not k] 12 | 13 | publishers = {} 14 | 15 | for spec in specs: 16 | bar = spec[0] 17 | buttons = spec[1:] 18 | for b in buttons: 19 | if ',' in b: 20 | buttons.remove(b) 21 | buttons.extend(b.split(',')) 22 | for button in buttons: 23 | for mode in 'pressed', 'released': 24 | button_event = '_'.join((bar, button, mode)) 25 | button_topic = '/'.join((bar, button, mode)) 26 | publishers[button_event] = rospy.Publisher('state/'+button_topic, Empty, queue_size=10) 27 | 28 | def handler(msg): 29 | publishers[msg.data].publish(Empty()) 30 | 31 | subscriber = rospy.Subscriber('state/buttonEvent', String, handler, queue_size=10) 32 | 33 | rospy.spin() -------------------------------------------------------------------------------- /iiwa_ros/src/command/cartesian_pose.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/command/cartesian_pose.hpp" 32 | #include 33 | 34 | namespace iiwa_ros { 35 | namespace command { 36 | 37 | void CartesianPose::init(const std::string& robot_namespace) { 38 | setup(robot_namespace); 39 | initROS("CartesianPoseCommand"); 40 | command_.init(ros_namespace_ + "command/CartesianPose"); 41 | } 42 | 43 | void CartesianPose::setPose(const geometry_msgs::PoseStamped& pose) { 44 | command_.set(pose); 45 | command_.publish(); 46 | } 47 | 48 | void CartesianPose::setPose(const geometry_msgs::PoseStamped& pose, const std::function callback) { 49 | setPose(pose); 50 | callback_ = callback; 51 | std::thread t(&CartesianPose::completedMotionWatcher, this); 52 | t.detach(); 53 | } 54 | 55 | } // namespace command 56 | } // namespace iiwa_ros 57 | -------------------------------------------------------------------------------- /iiwa_ros/src/command/cartesian_pose_linear.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/command/cartesian_pose_linear.hpp" 32 | #include 33 | 34 | namespace iiwa_ros { 35 | namespace command { 36 | 37 | void CartesianPoseLinear::init(const std::string& robot_namespace) { 38 | setup(robot_namespace); 39 | initROS("CartesianPoseLinearCommand"); 40 | command_.init(ros_namespace_ + "command/CartesianPoseLin"); 41 | } 42 | 43 | void CartesianPoseLinear::setPose(const geometry_msgs::PoseStamped& pose) { 44 | command_.set(pose); 45 | command_.publish(); 46 | } 47 | 48 | void CartesianPoseLinear::setPose(const geometry_msgs::PoseStamped& pose, const std::function callback) { 49 | setPose(pose); 50 | callback_ = callback; 51 | std::thread t(&CartesianPoseLinear::completedMotionWatcher, this); 52 | t.detach(); 53 | } 54 | 55 | } // namespace command 56 | } // namespace iiwa_ros 57 | -------------------------------------------------------------------------------- /iiwa_ros/src/command/generic_command.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/command/generic_command.hpp" 32 | 33 | namespace iiwa_ros { 34 | 35 | namespace command { 36 | 37 | void GenericCommand::completedMotionWatcher() { 38 | if (callback_ == nullptr) { return; } 39 | bool flag{false}; 40 | ros::Duration(0.1).sleep(); 41 | while (true) { 42 | auto missing_time = time_to_destination_.getTimeToDestination(); 43 | if (missing_time < -998) { 44 | ROS_ERROR_STREAM(ros::this_node::getName() << " - Error while calling the TimeToDestination."); 45 | continue; 46 | } 47 | if (missing_time > 0) { 48 | if (flag == false) { flag = true; } 49 | ros::Duration(missing_time / 2).sleep(); 50 | } else { 51 | if (flag == true) { 52 | callback_(); 53 | return; 54 | } 55 | } 56 | } 57 | } 58 | 59 | } // namespace command 60 | } // namespace iiwa_ros 61 | -------------------------------------------------------------------------------- /iiwa_ros/src/command/joint_position.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/command/joint_position.hpp" 32 | #include 33 | 34 | namespace iiwa_ros { 35 | namespace command { 36 | 37 | void JointPosition::init(const std::string& robot_namespace) { 38 | setup(robot_namespace); 39 | initROS("JointPositionCommand"); 40 | command_.init(ros_namespace_ + "command/JointPosition"); 41 | } 42 | 43 | void JointPosition::setPosition(const iiwa_msgs::JointPosition& position) { 44 | command_.set(position); 45 | command_.publish(); 46 | } 47 | 48 | void JointPosition::setPosition(const iiwa_msgs::JointPosition& position, const std::function callback) { 49 | setPosition(position); 50 | callback_ = callback; 51 | std::thread t(&JointPosition::completedMotionWatcher, this); 52 | t.detach(); 53 | } 54 | 55 | } // namespace command 56 | } // namespace iiwa_ros 57 | -------------------------------------------------------------------------------- /iiwa_ros/src/command/joint_position_velocity.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/command/joint_position_velocity.hpp" 32 | #include 33 | 34 | namespace iiwa_ros { 35 | namespace command { 36 | 37 | void JointPositionVelocity::init(const std::string& robot_namespace) { 38 | setup(robot_namespace); 39 | initROS("JointPositionVelocityCommand"); 40 | command_.init(ros_namespace_ + "command/JointPositionVelocity"); 41 | } 42 | 43 | void JointPositionVelocity::setPosition(const iiwa_msgs::JointPositionVelocity& position) { 44 | command_.set(position); 45 | command_.publish(); 46 | } 47 | 48 | void JointPositionVelocity::setPosition(const iiwa_msgs::JointPositionVelocity& position, 49 | const std::function callback) { 50 | setPosition(position); 51 | callback_ = callback; 52 | std::thread t(&JointPositionVelocity::completedMotionWatcher, this); 53 | t.detach(); 54 | } 55 | 56 | } // namespace command 57 | } // namespace iiwa_ros 58 | -------------------------------------------------------------------------------- /iiwa_ros/src/command/joint_velocity.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/command/joint_velocity.hpp" 32 | #include 33 | 34 | namespace iiwa_ros { 35 | namespace command { 36 | 37 | void JointVelocity::init(const std::string& robot_namespace) { 38 | setup(robot_namespace); 39 | initROS("JointVelocityCommand"); 40 | command_.init(ros_namespace_ + "command/JointVelocity"); 41 | } 42 | 43 | void JointVelocity::setVelocity(const iiwa_msgs::JointVelocity& velocity) { 44 | command_.set(velocity); 45 | command_.publish(); 46 | } 47 | 48 | void JointVelocity::setVelocity(const iiwa_msgs::JointVelocity& velocity, const std::function callback) { 49 | setVelocity(velocity); 50 | callback_ = callback; 51 | std::thread t(&JointVelocity::completedMotionWatcher, this); 52 | t.detach(); 53 | } 54 | 55 | } // namespace command 56 | } // namespace iiwa_ros 57 | -------------------------------------------------------------------------------- /iiwa_ros/src/iiwa_ros.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/iiwa_ros.hpp" 32 | #include 33 | 34 | using namespace std; 35 | 36 | namespace iiwa_ros { 37 | ros::Time last_update_time; 38 | 39 | void Robot::initROS(const std::string& ros_node_name) { 40 | std::map emptyArgs; 41 | if (!ros::isInitialized()) { ros::init(emptyArgs, ros_node_name, ros::init_options::AnonymousName); } 42 | } 43 | 44 | } // namespace iiwa_ros 45 | -------------------------------------------------------------------------------- /iiwa_ros/src/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | static bool quit{false}; 39 | 40 | void signalHandler(int /*unused*/) { quit = true; } 41 | 42 | int main() { 43 | iiwa_ros::state::JointPosition jp_state; 44 | iiwa_ros::state::JointTorque jt_state; 45 | 46 | jp_state.init("iiwa"); 47 | jt_state.init("iiwa"); 48 | 49 | // ROS spinner. 50 | ros::AsyncSpinner spinner(1); 51 | spinner.start(); 52 | 53 | // Signal handlers. 54 | signal(SIGTERM, signalHandler); 55 | signal(SIGINT, signalHandler); 56 | signal(SIGHUP, signalHandler); 57 | 58 | // Wait a bit, so that you can be sure the subscribers are connected. 59 | ros::Duration(0.5).sleep(); 60 | 61 | while (!quit) { 62 | auto joint_position_ = jp_state.getPosition(); 63 | 64 | auto joint_torque = jt_state.getTorque(); 65 | ROS_INFO_STREAM( 66 | std::to_string(joint_position_.position.a1) 67 | << " " << std::to_string(joint_position_.position.a2) << " " << std::to_string(joint_position_.position.a3) 68 | << " " << std::to_string(joint_position_.position.a4) << " " << std::to_string(joint_position_.position.a5) 69 | << " " << std::to_string(joint_position_.position.a6) << " " << std::to_string(joint_position_.position.a7) 70 | << std::endl;); 71 | ros::Duration(0.1).sleep(); 72 | } 73 | 74 | std::cerr << "Stopping spinner..." << std::endl; 75 | spinner.stop(); 76 | 77 | std::cerr << "Bye!" << std::endl; 78 | 79 | return 0; 80 | } 81 | -------------------------------------------------------------------------------- /iiwa_ros/src/service/path_parameters_lin.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | namespace iiwa_ros { 34 | namespace service { 35 | 36 | void PathParametersLinService::init(const std::string& robot_namespace) { 37 | setup(robot_namespace); 38 | ros::NodeHandle node_handle{}; 39 | service_name_ = ros_namespace_ + "configuration/setSmartServoLinSpeedLimits"; 40 | client_ = node_handle.serviceClient(service_name_); 41 | service_ready_ = true; 42 | } 43 | 44 | bool PathParametersLinService::callService() { 45 | if (service_ready_) { 46 | if (client_.call(config_)) { 47 | if (!config_.response.success && verbose_) { 48 | service_error_ = config_.response.error; 49 | ROS_ERROR_STREAM(service_name_ << " failed, Java error: " << service_error_); 50 | } else if (verbose_) { 51 | ROS_INFO_STREAM(ros::this_node::getName() << ":" << service_name_ << " successfully called."); 52 | } 53 | } else if (verbose_) { 54 | ROS_ERROR_STREAM(service_name_ << " could not be called"); 55 | } 56 | return config_.response.success; 57 | } 58 | ROS_ERROR_STREAM("The service client was not intialized yet. Call the init function of this object first."); 59 | } 60 | 61 | bool PathParametersLinService::setMaxCartesianVelocity(const geometry_msgs::Twist max_cartesian_velocity) { 62 | config_.request.max_cartesian_velocity = max_cartesian_velocity; 63 | } 64 | 65 | } // namespace service 66 | } // namespace iiwa_ros 67 | -------------------------------------------------------------------------------- /iiwa_ros/src/service/time_to_destination.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | namespace iiwa_ros { 34 | namespace service { 35 | 36 | void TimeToDestinationService::init(const std::string& robot_namespace) { 37 | setup(robot_namespace); 38 | ros::NodeHandle node_handle{}; 39 | service_name_ = ros_namespace_ + "state/timeToDestination"; 40 | client_ = node_handle.serviceClient(service_name_); 41 | service_ready_ = true; 42 | } 43 | 44 | double TimeToDestinationService::getTimeToDestination() { 45 | if (service_ready_) { 46 | if (callService()) { 47 | return time_to_destination_; 48 | } else { 49 | return -999; // It cannot return -1 since it might be a meaningfull result. 50 | } 51 | } 52 | ROS_ERROR_STREAM("The service client was not intialized yet. Call the init function of this object first."); 53 | } 54 | 55 | bool TimeToDestinationService::callService() { 56 | if (client_.call(config_)) { 57 | if (verbose_) { ROS_DEBUG_STREAM(ros::this_node::getName() << ": " << service_name_ << " successfully called."); } 58 | time_to_destination_ = config_.response.remaining_time; 59 | return true; 60 | } else if (verbose_) { 61 | ROS_ERROR_STREAM(service_name_ << " could not be called"); 62 | } 63 | return false; 64 | } 65 | 66 | } // namespace service 67 | } // namespace iiwa_ros 68 | -------------------------------------------------------------------------------- /iiwa_ros/src/state/cartesian_pose.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/state/cartesian_pose.hpp" 32 | 33 | namespace iiwa_ros { 34 | namespace state { 35 | 36 | void CartesianPose::init(const std::string& robot_namespace) { 37 | setup(robot_namespace); 38 | initROS("CartesianPoseState"); 39 | state_.init(ros_namespace_ + "state/CartesianPose"); 40 | } 41 | 42 | void CartesianPose::init(const std::string& robot_namespace, 43 | const std::function callback) { 44 | setup(robot_namespace); 45 | initROS("CartesianPoseState"); 46 | state_.init(ros_namespace_ + "state/CartesianPose", callback); 47 | } 48 | 49 | iiwa_msgs::CartesianPose CartesianPose::getPose() { return state_.get(); } 50 | 51 | } // namespace state 52 | } // namespace iiwa_ros 53 | -------------------------------------------------------------------------------- /iiwa_ros/src/state/cartesian_wrench.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/state/cartesian_wrench.hpp" 32 | 33 | namespace iiwa_ros { 34 | namespace state { 35 | 36 | void CartesianWrench::init(const std::string& robot_namespace) { 37 | setup(robot_namespace); 38 | initROS("CartesianWrenchState"); 39 | state_.init(ros_namespace_ + "state/CartesianWrench"); 40 | } 41 | 42 | void CartesianWrench::init(const std::string& robot_namespace, 43 | const std::function callback) { 44 | setup(robot_namespace); 45 | initROS("CartesianWrenchState"); 46 | state_.init(ros_namespace_ + "state/CartesianWrench", callback); 47 | } 48 | 49 | iiwa_msgs::CartesianWrench CartesianWrench::getWrench() { return state_.get(); } 50 | 51 | } // namespace state 52 | } // namespace iiwa_ros 53 | -------------------------------------------------------------------------------- /iiwa_ros/src/state/destination_reached.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/state/destination_reached.hpp" 32 | 33 | namespace iiwa_ros { 34 | namespace state { 35 | 36 | void DestinationReached::init(const std::string& robot_namespace) { 37 | setup(robot_namespace); 38 | initROS("DestinationReachedState"); 39 | state_.init(ros_namespace_ + "state/DestinationReached"); 40 | } 41 | 42 | void DestinationReached::init(const std::string& robot_namespace, 43 | const std::function callback) { 44 | setup(robot_namespace); 45 | initROS("DestinationReachedState"); 46 | state_.init(ros_namespace_ + "state/DestinationReached", callback); 47 | } 48 | 49 | std_msgs::Time DestinationReached::getTime() { return state_.get(); } 50 | 51 | } // namespace state 52 | } // namespace iiwa_ros 53 | -------------------------------------------------------------------------------- /iiwa_ros/src/state/external_joint_torque.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/state/external_joint_torque.hpp" 32 | 33 | namespace iiwa_ros { 34 | namespace state { 35 | 36 | void ExternalJointTorque::init(const std::string& robot_namespace) { 37 | setup(robot_namespace); 38 | initROS("ExternalJointTorqueState"); 39 | state_.init(ros_namespace_ + "state/ExternalJointTorque"); 40 | } 41 | 42 | void ExternalJointTorque::init(const std::string& robot_namespace, 43 | const std::function callback) { 44 | setup(robot_namespace); 45 | initROS("ExternalJointTorqueState"); 46 | state_.init(ros_namespace_ + "state/ExternalJointTorque", callback); 47 | } 48 | 49 | iiwa_msgs::JointTorque ExternalJointTorque::getTorque() { return state_.get(); } 50 | 51 | } // namespace state 52 | } // namespace iiwa_ros 53 | -------------------------------------------------------------------------------- /iiwa_ros/src/state/joint_position.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/state/joint_position.hpp" 32 | 33 | namespace iiwa_ros { 34 | namespace state { 35 | 36 | void JointPosition::init(const std::string& robot_namespace) { 37 | setup(robot_namespace); 38 | initROS("JointPositionState"); 39 | state_.init(ros_namespace_ + "state/JointPosition"); 40 | } 41 | 42 | void JointPosition::init(const std::string& robot_namespace, 43 | const std::function callback) { 44 | setup(robot_namespace); 45 | initROS("JointPositionState"); 46 | state_.init(ros_namespace_ + "state/JointPosition", callback); 47 | } 48 | 49 | iiwa_msgs::JointPosition JointPosition::getPosition() { return state_.get(); } 50 | 51 | } // namespace state 52 | } // namespace iiwa_ros 53 | -------------------------------------------------------------------------------- /iiwa_ros/src/state/joint_torque.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/state/joint_torque.hpp" 32 | 33 | namespace iiwa_ros { 34 | namespace state { 35 | 36 | void JointTorque::init(const std::string& robot_namespace) { 37 | setup(robot_namespace); 38 | initROS("JointTorqueState"); 39 | state_.init(ros_namespace_ + "state/JointTorque"); 40 | } 41 | 42 | void JointTorque::init(const std::string& robot_namespace, 43 | const std::function callback) { 44 | setup(robot_namespace); 45 | initROS("JointTorqueState"); 46 | state_.init(ros_namespace_ + "state/JointTorque", callback); 47 | } 48 | 49 | iiwa_msgs::JointTorque JointTorque::getTorque() { return state_.get(); } 50 | 51 | } // namespace state 52 | } // namespace iiwa_ros 53 | -------------------------------------------------------------------------------- /iiwa_ros/src/state/joint_velocity.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016-2019 Salvatore Virga - salvo.virga@tum.de, Marco Esposito - marco.esposito@tum.de 3 | * Technische Universität München 4 | * Chair for Computer Aided Medical Procedures and Augmented Reality 5 | * Fakultät für Informatik / I16, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://campar.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 10 | * following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 13 | * disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | * following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, 23 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, 25 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | * THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "iiwa_ros/state/joint_velocity.hpp" 32 | 33 | namespace iiwa_ros { 34 | namespace state { 35 | 36 | void JointVelocity::init(const std::string& robot_namespace) { 37 | setup(robot_namespace); 38 | initROS("JointTorqueState"); 39 | state_.init(ros_namespace_ + "state/JointVelocity"); 40 | } 41 | 42 | void JointVelocity::init(const std::string& robot_namespace, 43 | const std::function callback) { 44 | setup(robot_namespace); 45 | initROS("JointTorqueState"); 46 | state_.init(ros_namespace_ + "state/JointVelocity", callback); 47 | } 48 | 49 | iiwa_msgs::JointVelocity JointVelocity::getVelocity() { return state_.get(); } 50 | 51 | } // namespace state 52 | } // namespace iiwa_ros 53 | -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/actionlib_msgs-1.11.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/actionlib_msgs-1.11.8.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/apache_xmlrpc_client_0.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/apache_xmlrpc_client_0.3.7.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/apache_xmlrpc_common_0.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/apache_xmlrpc_common_0.3.7.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/apache_xmlrpc_server_0.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/apache_xmlrpc_server_0.3.7.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.codec-1.3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.codec-1.3.0.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.httpclient-3.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.httpclient-3.1.0.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.io-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.io-1.4.0.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.lang-2.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.lang-2.4.0.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.logging-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.logging-1.1.1.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.net-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/com.springsource.org.apache.commons.net-2.0.0.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/commons-pool-1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/commons-pool-1.6.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/dnsjava-2.1.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/dnsjava-2.1.8.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/geometry_msgs-1.11.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/geometry_msgs-1.11.8.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/guava-18.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/guava-18.0.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/iiwa_msgs-2.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/iiwa_msgs-2.3.1.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/jgrapht-core-0.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/jgrapht-core-0.9.0.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/message_generation-0.3.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/message_generation-0.3.3.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/netty-3.5.2.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/netty-3.5.2.Final.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/rosgraph_msgs-1.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/rosgraph_msgs-1.11.1.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/rosjava_0.3.7_custom.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/rosjava_0.3.7_custom.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/rosjava_actionlib-0.4.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/rosjava_actionlib-0.4.4.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/rosjava_tf_core-0.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/rosjava_tf_core-0.2.2.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/sensor_msgs-1.11.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/sensor_msgs-1.11.8.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/std_msgs-0.5.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/std_msgs-0.5.9.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/tf2_msgs-0.5.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/tf2_msgs-0.5.12.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/vecmath-1.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/vecmath-1.5.2.jar -------------------------------------------------------------------------------- /iiwa_ros_java/ROSJavaLib/ws-commons-util-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/ROSJavaLib/ws-commons-util-1.0.1.jar -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/ActionServerThread.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/ActionServerThread.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/ActiveTool.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Arne Peters - arne.peters@tum.de 3 | * Technische Universität München 4 | * Chair for Robotics, Artificial Intelligence and Embedded Systems 5 | * Fakultät für Informatik / I6, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://www6.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided 10 | * that the following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 13 | * following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and 16 | * the following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | * POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package de.tum.in.camp.kuka.ros; 29 | 30 | import org.ros.node.NodeMainExecutor; 31 | 32 | public interface ActiveTool { 33 | /** 34 | * This method is called after construction is done. 35 | */ 36 | public void initialize(Configuration configuration, NodeMainExecutor mainExecutor); 37 | 38 | /** 39 | * This method is called periodically. Implement reaction to incoming commands here. 40 | */ 41 | public void moveTool(); 42 | 43 | /** 44 | * This method is called periodically. Publish TF or other status data here. 45 | * 46 | * @throws InterruptedException 47 | */ 48 | public void publishCurrentState() throws InterruptedException; 49 | } 50 | -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/ActiveToolThread.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/ActiveToolThread.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/AddressGenerator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Arne Peters - arne.peters@tum.de 3 | * Technische Universität München 4 | * Chair for Robotics, Artificial Intelligence and Embedded Systems 5 | * Fakultät für Informatik / I6, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://www6.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided 10 | * that the following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 13 | * following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and 16 | * the following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | * POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package de.tum.in.camp.kuka.ros; 29 | 30 | public class AddressGenerator { 31 | int address = 30000; 32 | 33 | public int getNewAddress() { 34 | // Only port numbers from 30000 to 30010 are available. 35 | // See KUKA SI Manual "Network communication via UDP and TCP/IP". 36 | if (address > 30010) { 37 | throw new RuntimeException("Only port numbers from 30000 to 30010 are available"); 38 | } 39 | else { 40 | int newAddress = address; 41 | address++; 42 | return newAddress; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/CommandTypes.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Arne Peters - arne.peters@tum.de 3 | * Technische Universität München 4 | * Chair for Robotics, Artificial Intelligence and Embedded Systems 5 | * Fakultät für Informatik / I6, Boltzmannstraße 3, 85748 Garching bei München, Germany 6 | * http://www6.in.tum.de 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided 10 | * that the following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 13 | * following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and 16 | * the following disclaimer in the documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | * POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package de.tum.in.camp.kuka.ros; 29 | 30 | public class CommandTypes { 31 | public enum CommandType { 32 | SMART_SERVO_CARTESIAN_POSE, 33 | SMART_SERVO_CARTESIAN_POSE_LIN, 34 | SMART_SERVO_CARTESIAN_VELOCITY, 35 | SMART_SERVO_JOINT_POSITION, 36 | SMART_SERVO_JOINT_POSITION_VELOCITY, 37 | SMART_SERVO_JOINT_VELOCITY, 38 | POINT_TO_POINT_CARTESIAN_POSE, 39 | POINT_TO_POINT_CARTESIAN_POSE_LIN, 40 | POINT_TO_POINT_CARTESIAN_SPLINE, 41 | POINT_TO_POINT_JOINT_POSITION 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Configuration.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Configuration.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/ControlModeHandler.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/ControlModeHandler.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Conversions.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Conversions.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/GoalReachedEventListener.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/GoalReachedEventListener.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Logger.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Logger.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/MessageGenerator.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/MessageGenerator.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Motions.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Motions.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/MoveAsyncErrorHandler.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/MoveAsyncErrorHandler.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/PTPMotionFinishedEventListener.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/PTPMotionFinishedEventListener.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/PublisherThread.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/PublisherThread.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/SpeedLimits.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/SpeedLimits.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/UnsupportedControlModeException.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/UnsupportedControlModeException.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Utility.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/Utility.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/app/ROSBaseApplication.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/app/ROSBaseApplication.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/iiwaActionServer.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/iiwaActionServer.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/iiwaPublisher.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/iiwaPublisher.java -------------------------------------------------------------------------------- /iiwa_ros_java/src/de/tum/in/camp/kuka/ros/iiwaSubscriber.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFL-CAMP/iiwa_stack/44f9d13c1b444d5dc9fd3e43ba60b7d3b2ea2bbb/iiwa_ros_java/src/de/tum/in/camp/kuka/ros/iiwaSubscriber.java --------------------------------------------------------------------------------