├── kuka_drivers_core ├── test │ └── .gitkeep ├── CHANGELOG.rst ├── package.xml ├── include │ ├── kuka_drivers_core │ │ ├── hardware_event.hpp │ │ ├── controller_names.hpp │ │ ├── control_mode.hpp │ │ └── ros2_base_node.hpp │ └── communication_helpers │ │ ├── service_tools.hpp │ │ └── ros2_control_tools.hpp ├── src │ ├── ros2_base_node.cpp │ ├── parameter_handler.cpp │ └── control_node.cpp └── CMakeLists.txt ├── .gitignore ├── kuka_rsi_simulator ├── resource │ └── kuka_rsi_simulator ├── kuka_rsi_simulator │ └── __init__.py ├── setup.cfg ├── CHANGELOG.rst ├── package.xml ├── setup.py └── launch │ └── kuka_rsi_simulator.launch.py ├── .github ├── CODEOWNERS ├── workflows │ ├── deploy_wiki.yml │ ├── pre-commit.yml │ ├── industrial_ci_jazzy.yml │ └── industrial_ci_humble.yml ├── mergify.yml └── ISSUE_TEMPLATE │ └── bug_report.yml ├── kuka_rsi_driver ├── config │ ├── driver_config.yaml │ ├── gpio_controller_config.yaml │ ├── joint_trajectory_controller_config.yaml │ ├── ros2_controller_config_rsi_only.yaml │ ├── ros2_controller_config_extended.yaml │ └── gpio_config.xacro ├── README.md ├── rsi_hardware_interface.xml ├── eki_rsi_hardware_interface.xml ├── mxa_rsi_hardware_interface.xml ├── test │ ├── config │ │ ├── test1_joint_trajectory_controller_config.yaml │ │ ├── test2_joint_trajectory_controller_config.yaml │ │ ├── test1_ros2_controller_config.yaml │ │ └── test2_ros2_controller_config.yaml │ ├── test_driver_startup_eki_rsi.py │ ├── test_driver_startup_mxa_rsi.py │ └── test_driver_startup_rsi_only.py ├── CHANGELOG.rst ├── include │ └── kuka_rsi_driver │ │ ├── robot_manager_node_rsi_only.hpp │ │ ├── visibility_control.h │ │ ├── robot_manager_node_extended.hpp │ │ └── hardware_interface_rsi_only.hpp ├── package.xml ├── launch │ └── startup_with_rviz.launch.py └── src │ ├── robot_manager_node_rsi_only.cpp │ └── hardware_interface_rsi_only.cpp ├── kuka_driver_interfaces ├── msg │ ├── FriConfiguration.msg │ ├── KssStatus.msg │ └── FRIState.msg ├── CHANGELOG.rst ├── CMakeLists.txt └── package.xml ├── kuka_iiqka_eac_driver ├── config │ ├── qos_config.yaml │ ├── effort_controller_config.yaml │ ├── joint_impedance_controller_config.yaml │ ├── joint_trajectory_controller_config.yaml │ ├── driver_config.yaml │ └── ros2_controller_config.yaml ├── test │ ├── config │ │ ├── test1_joint_impedance_controller_config.yaml │ │ ├── test2_joint_impedance_controller_config.yaml │ │ ├── test1_joint_trajectory_controller_config.yaml │ │ ├── test2_joint_trajectory_controller_config.yaml │ │ ├── test1_ros2_controller_config.yaml │ │ ├── test2_ros2_controller_config.yaml │ │ ├── test1_effort_controller_config.yaml │ │ └── test2_effort_controller_config.yaml │ └── test_driver_startup.py ├── hardware_interface.xml ├── CHANGELOG.rst ├── include │ ├── CPPLINT.cfg │ └── kuka_iiqka_eac_driver │ │ ├── visibility_control.h │ │ └── event_observer.hpp ├── package.xml ├── launch │ └── startup_with_rviz.launch.py └── CMakeLists.txt ├── kuka_sunrise_fri_driver ├── config │ ├── effort_controller_config.yaml │ ├── joint_impedance_controller_config.yaml │ ├── driver_config.yaml │ ├── external_torque_broadcaster_config.yaml │ ├── joint_trajectory_controller_config.yaml │ ├── ros2_controller_config.yaml │ └── gpio_config.xacro ├── hardware_interface.xml ├── robot_application │ └── src │ │ ├── ros2 │ │ ├── tools │ │ │ └── Conversions.java │ │ └── serialization │ │ │ ├── MessageEncoding.java │ │ │ ├── JointImpedanceControlModeExternalizable.java │ │ │ ├── FRIConfigurationParams.java │ │ │ └── ControlModeParams.java │ │ └── application │ │ └── ROS2_Control.java ├── test │ ├── config │ │ ├── test1_joint_trajectory_controller_config.yaml │ │ ├── test2_joint_trajectory_controller_config.yaml │ │ ├── test1_ros2_controller_config.yaml │ │ └── test2_ros2_controller_config.yaml │ └── test_driver_startup.py ├── CHANGELOG.rst ├── include │ ├── fri_client_sdk │ │ └── HWIFClientApplication.hpp │ └── kuka_sunrise_fri_driver │ │ ├── visibility_control.h │ │ ├── tcp_connection.hpp │ │ └── serialization.hpp ├── src │ └── fri_client_sdk │ │ └── FRIMessages.pb.c ├── package.xml └── launch │ └── startup_with_rviz.launch.py ├── kuka_drivers ├── CMakeLists.txt ├── CHANGELOG.rst └── package.xml ├── controllers ├── kuka_controllers │ ├── CMakeLists.txt │ ├── CHANGELOG.rst │ └── package.xml ├── kuka_event_broadcaster │ ├── controller_plugins.xml │ ├── CHANGELOG.rst │ ├── package.xml │ ├── CMakeLists.txt │ ├── include │ │ └── kuka_event_broadcaster │ │ │ ├── visibility_control.h │ │ │ └── kuka_event_broadcaster.hpp │ └── src │ │ └── kuka_event_broadcaster.cpp ├── fri_state_broadcaster │ ├── controller_plugins.xml │ ├── CHANGELOG.rst │ ├── package.xml │ ├── CMakeLists.txt │ └── include │ │ └── fri_state_broadcaster │ │ ├── visibility_control.h │ │ └── fri_state_broadcaster.hpp ├── kuka_control_mode_handler │ ├── controller_plugins.xml │ ├── CHANGELOG.rst │ ├── package.xml │ ├── CMakeLists.txt │ └── include │ │ └── kuka_control_mode_handler │ │ ├── visibility_control.h │ │ └── kuka_control_mode_handler.hpp ├── joint_group_impedance_controller │ ├── src │ │ ├── joint_group_impedance_controller_parameters.yaml │ │ └── joint_group_impedance_controller.cpp │ ├── controller_plugins.xml │ ├── CHANGELOG.rst │ ├── package.xml │ ├── CMakeLists.txt │ └── include │ │ └── joint_group_impedance_controller │ │ ├── joint_group_impedance_controller.hpp │ │ └── visibility_control.h ├── fri_configuration_controller │ ├── controller_plugins.xml │ ├── CHANGELOG.rst │ ├── package.xml │ ├── CMakeLists.txt │ └── include │ │ └── fri_configuration_controller │ │ ├── visibility_control.h │ │ └── fri_configuration_controller.hpp └── kuka_kss_message_handler │ ├── kuka_kss_message_handler.xml │ ├── package.xml │ ├── include │ └── kuka_kss_message_handler │ │ └── visibility_control.h │ └── CMakeLists.txt ├── upstream.repos ├── .clang-format ├── examples └── iiqka_moveit_example │ ├── CHANGELOG.rst │ ├── config │ ├── dummy_publisher.yaml │ └── moveit_controllers.yaml │ ├── package.xml │ ├── launch │ └── launch_trajectory_publisher.launch.py │ ├── CMakeLists.txt │ └── src │ ├── moveit_collision_avoidance_example.cpp │ └── moveit_constrained_planning_example.cpp ├── sonar-project.properties └── CONTRIBUTING.md /kuka_drivers_core/test/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | .vscode 3 | -------------------------------------------------------------------------------- /kuka_rsi_simulator/resource/kuka_rsi_simulator: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kuka_rsi_simulator/kuka_rsi_simulator/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | ## code changes will send PR to following users 2 | * @Svastits @kovacsge11 @pasztork 3 | -------------------------------------------------------------------------------- /kuka_rsi_driver/config/driver_config.yaml: -------------------------------------------------------------------------------- 1 | robot_manager: 2 | ros__parameters: 3 | position_controller_name: "joint_trajectory_controller" 4 | -------------------------------------------------------------------------------- /kuka_driver_interfaces/msg/FriConfiguration.msg: -------------------------------------------------------------------------------- 1 | # Message with the modifiable values of FRI configuration 2 | int32 receive_multiplier 3 | int32 send_period_ms 4 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/config/qos_config.yaml: -------------------------------------------------------------------------------- 1 | rt_packet_loss_profile: 2 | consequent_lost_packets: 2 3 | lost_packets_in_timeframe: 1 4 | timeframe_ms: 5000 5 | -------------------------------------------------------------------------------- /kuka_rsi_driver/README.md: -------------------------------------------------------------------------------- 1 | ROS2 ported HW interface based on RSI communication. 2 | 3 | This package and HW interface is heavily influenced and originated by https://github.com/ros-industrial/kuka_experimental. 4 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/config/effort_controller_config.yaml: -------------------------------------------------------------------------------- 1 | effort_controller: 2 | ros__parameters: 3 | joints: 4 | - joint_1 5 | - joint_2 6 | - joint_3 7 | - joint_4 8 | - joint_5 9 | - joint_6 10 | -------------------------------------------------------------------------------- /kuka_rsi_simulator/setup.cfg: -------------------------------------------------------------------------------- 1 | [develop] 2 | script_dir=$base/lib/kuka_rsi_simulator 3 | [install] 4 | install_scripts=$base/lib/kuka_rsi_simulator 5 | [tool:pytest] 6 | minversion = 6.0 7 | addopts = --strict-markers 8 | norecursedirs = .git build dist 9 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/config/joint_impedance_controller_config.yaml: -------------------------------------------------------------------------------- 1 | joint_group_impedance_controller: 2 | ros__parameters: 3 | joints: 4 | - joint_1 5 | - joint_2 6 | - joint_3 7 | - joint_4 8 | - joint_5 9 | - joint_6 10 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/config/effort_controller_config.yaml: -------------------------------------------------------------------------------- 1 | effort_controller: 2 | ros__parameters: 3 | joints: 4 | - joint_1 5 | - joint_2 6 | - joint_3 7 | - joint_4 8 | - joint_5 9 | - joint_6 10 | - joint_7 11 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/config/joint_impedance_controller_config.yaml: -------------------------------------------------------------------------------- 1 | joint_group_impedance_controller: 2 | ros__parameters: 3 | joints: 4 | - joint_1 5 | - joint_2 6 | - joint_3 7 | - joint_4 8 | - joint_5 9 | - joint_6 10 | - joint_7 11 | -------------------------------------------------------------------------------- /kuka_drivers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(kuka_drivers LANGUAGES CXX) 3 | 4 | if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") 5 | add_compile_options(-Wall -Wextra) 6 | endif() 7 | 8 | find_package(ament_cmake REQUIRED) 9 | 10 | ament_package() 11 | -------------------------------------------------------------------------------- /controllers/kuka_controllers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(kuka_controllers LANGUAGES CXX) 3 | 4 | if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") 5 | add_compile_options(-Wall -Wextra) 6 | endif() 7 | 8 | find_package(ament_cmake REQUIRED) 9 | 10 | ament_package() 11 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/test/config/test1_joint_impedance_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test1/joint_group_impedance_controller: 2 | ros__parameters: 3 | joints: 4 | - test1_joint_1 5 | - test1_joint_2 6 | - test1_joint_3 7 | - test1_joint_4 8 | - test1_joint_5 9 | - test1_joint_6 10 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/test/config/test2_joint_impedance_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test2/joint_group_impedance_controller: 2 | ros__parameters: 3 | joints: 4 | - test2_joint_1 5 | - test2_joint_2 6 | - test2_joint_3 7 | - test2_joint_4 8 | - test2_joint_5 9 | - test2_joint_6 10 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/hardware_interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | ROS2 control Kuka driver for RoX 6 | 7 | 8 | -------------------------------------------------------------------------------- /kuka_rsi_driver/rsi_hardware_interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | ros2_control hardware interface for RSI-controlled robots 6 | 7 | 8 | -------------------------------------------------------------------------------- /upstream.repos: -------------------------------------------------------------------------------- 1 | # Upstream dependencies 2 | repositories: 3 | kuka_robot_descriptions: 4 | type: git 5 | url: https://github.com/kroshu/kuka_robot_descriptions.git 6 | version: master 7 | kuka-external-control-sdk: 8 | type: git 9 | url: https://github.com/kroshu/kuka-external-control-sdk.git 10 | version: master 11 | -------------------------------------------------------------------------------- /kuka_rsi_driver/eki_rsi_hardware_interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | ros2_control hardware interface for EKI and RSI-controlled robots 6 | 7 | 8 | -------------------------------------------------------------------------------- /kuka_rsi_driver/mxa_rsi_hardware_interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | ros2_control hardware interface for mxAutomation and RSI-controlled robots 6 | 7 | 8 | -------------------------------------------------------------------------------- /controllers/kuka_event_broadcaster/controller_plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This broadcaster publishes the state changes of ECI 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /kuka_rsi_driver/config/gpio_controller_config.yaml: -------------------------------------------------------------------------------- 1 | gpio_controller: 2 | ros__parameters: 3 | type: gpio_controllers/GpioCommandController 4 | gpios: 5 | - gpio 6 | command_interfaces: 7 | gpio: 8 | - interfaces: 9 | - "01" 10 | state_interfaces: 11 | gpio: 12 | - interfaces: 13 | - "01" 14 | - "02" 15 | -------------------------------------------------------------------------------- /controllers/fri_state_broadcaster/controller_plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This broadcaster publishes the state changes of ECI 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /controllers/kuka_control_mode_handler/controller_plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This controller sets the control mode of KUKA robots in runtime 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/hardware_interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ROS2 control hardware interface for KUKA LBR robots using the Fast Robot Interface (FRI). 7 | 8 | 9 | -------------------------------------------------------------------------------- /controllers/joint_group_impedance_controller/src/joint_group_impedance_controller_parameters.yaml: -------------------------------------------------------------------------------- 1 | joint_group_impedance_controller: 2 | joints: { 3 | type: string_array, 4 | default_value: [], 5 | description: "Name of the joints to control", 6 | } 7 | interface_names: { 8 | type: string_array, 9 | default_value: [], 10 | description: "Names of the interfaces to command", 11 | } 12 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | 5 | ColumnLimit: 100 6 | AccessModifierOffset: -2 7 | AlignAfterOpenBracket: AlwaysBreak 8 | BreakBeforeBraces: Allman 9 | ConstructorInitializerIndentWidth: 0 10 | ContinuationIndentWidth: 2 11 | DerivePointerAlignment: false 12 | PointerAlignment: Middle 13 | ReflowComments: true 14 | IncludeBlocks: Preserve 15 | InsertBraces: true 16 | ... 17 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/config/driver_config.yaml: -------------------------------------------------------------------------------- 1 | robot_manager: 2 | ros__parameters: 3 | control_mode: 1 4 | position_controller_name: "joint_trajectory_controller" 5 | torque_controller_name: "effort_controller" 6 | receive_multiplier: 1 7 | send_period_ms: 10 8 | joint_damping: [0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7] 9 | joint_stiffness: [100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0] 10 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/config/external_torque_broadcaster_config.yaml: -------------------------------------------------------------------------------- 1 | external_torque_broadcaster: 2 | ros__parameters: 3 | interfaces: 4 | - external_torque 5 | joints: 6 | - joint_1 7 | - joint_2 8 | - joint_3 9 | - joint_4 10 | - joint_5 11 | - joint_6 12 | - joint_7 13 | map_interface_to_joint_state: 14 | effort: external_torque 15 | use_local_topics: true 16 | -------------------------------------------------------------------------------- /controllers/fri_configuration_controller/controller_plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This controller sets the receive multiplier of the hardware interface 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /controllers/joint_group_impedance_controller/controller_plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This controller sets the joint impedance parameters in real time 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /kuka_drivers/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_drivers 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add meta-package for KUKA drivers 16 | * Contributors: Aron Svastits 17 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/robot_application/src/ros2/tools/Conversions.java: -------------------------------------------------------------------------------- 1 | package ros2.tools; 2 | 3 | public class Conversions { 4 | public static class Arrays{ 5 | public static float[] DoubleToFloat(double[] doubleArray){ 6 | float[] floatArray = new float[doubleArray.length]; 7 | for(int i = 0; i < doubleArray.length; i++){ 8 | floatArray[i] = (float)doubleArray[i]; 9 | } 10 | return floatArray; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /kuka_rsi_driver/config/joint_trajectory_controller_config.yaml: -------------------------------------------------------------------------------- 1 | joint_trajectory_controller: 2 | ros__parameters: 3 | joints: 4 | - joint_1 5 | - joint_2 6 | - joint_3 7 | - joint_4 8 | - joint_5 9 | - joint_6 10 | 11 | command_interfaces: 12 | - position 13 | state_interfaces: 14 | - position 15 | state_publish_rate: 50.0 16 | action_monitor_rate: 20.0 17 | allow_nonzero_velocity_at_trajectory_end: true 18 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/config/joint_trajectory_controller_config.yaml: -------------------------------------------------------------------------------- 1 | joint_trajectory_controller: 2 | ros__parameters: 3 | joints: 4 | - joint_1 5 | - joint_2 6 | - joint_3 7 | - joint_4 8 | - joint_5 9 | - joint_6 10 | 11 | command_interfaces: 12 | - position 13 | state_interfaces: 14 | - position 15 | state_publish_rate: 50.0 16 | action_monitor_rate: 20.0 17 | allow_nonzero_velocity_at_trajectory_end: true 18 | -------------------------------------------------------------------------------- /controllers/kuka_kss_message_handler/kuka_kss_message_handler.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | This controller can be used for sending and receiving non-real time message to and from 7 | KUKA robots running KSS. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/config/joint_trajectory_controller_config.yaml: -------------------------------------------------------------------------------- 1 | joint_trajectory_controller: 2 | ros__parameters: 3 | joints: 4 | - joint_1 5 | - joint_2 6 | - joint_3 7 | - joint_4 8 | - joint_5 9 | - joint_6 10 | - joint_7 11 | 12 | command_interfaces: 13 | - position 14 | state_interfaces: 15 | - position 16 | state_publish_rate: 50.0 17 | action_monitor_rate: 20.0 18 | allow_nonzero_velocity_at_trajectory_end: true 19 | -------------------------------------------------------------------------------- /controllers/kuka_controllers/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_controllers 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add meta-package for controllers needed for KUKA drivers 16 | * Contributors: Aron Svastits 17 | -------------------------------------------------------------------------------- /controllers/fri_state_broadcaster/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package fri_state_broadcaster 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add controller for broadcasting FRI states 16 | * Contributors: Aron Svastits 17 | -------------------------------------------------------------------------------- /kuka_rsi_simulator/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_rsi_simulator 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add package with simulator for KUKA RSI driven robots 16 | * Contributors: Aron Svastits, Lars Tingelstad 17 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/config/driver_config.yaml: -------------------------------------------------------------------------------- 1 | robot_manager: 2 | ros__parameters: 3 | control_mode: 1 4 | position_controller_name: "joint_trajectory_controller" 5 | impedance_controller_name: "joint_group_impedance_controller" 6 | torque_controller_name: "effort_controller" 7 | # Control mode enums: 8 | # 1 - joint position control 9 | # 2 - joint impedance control 10 | # 3 - joint velocity control (not supported yet) 11 | # 4 - joint torque control 12 | # ... others are not yet supported 13 | -------------------------------------------------------------------------------- /kuka_driver_interfaces/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_driver_interfaces 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add package with message definitions necessary for KUKA drivers 16 | * Contributors: Aron Svastits 17 | -------------------------------------------------------------------------------- /kuka_rsi_driver/test/config/test1_joint_trajectory_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test1/joint_trajectory_controller: 2 | ros__parameters: 3 | joints: 4 | - test1_joint_1 5 | - test1_joint_2 6 | - test1_joint_3 7 | - test1_joint_4 8 | - test1_joint_5 9 | - test1_joint_6 10 | 11 | command_interfaces: 12 | - position 13 | state_interfaces: 14 | - position 15 | state_publish_rate: 50.0 16 | action_monitor_rate: 20.0 17 | allow_nonzero_velocity_at_trajectory_end: true 18 | -------------------------------------------------------------------------------- /kuka_rsi_driver/test/config/test2_joint_trajectory_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test2/joint_trajectory_controller: 2 | ros__parameters: 3 | joints: 4 | - test2_joint_1 5 | - test2_joint_2 6 | - test2_joint_3 7 | - test2_joint_4 8 | - test2_joint_5 9 | - test2_joint_6 10 | 11 | command_interfaces: 12 | - position 13 | state_interfaces: 14 | - position 15 | state_publish_rate: 50.0 16 | action_monitor_rate: 20.0 17 | allow_nonzero_velocity_at_trajectory_end: true 18 | -------------------------------------------------------------------------------- /controllers/kuka_event_broadcaster/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_event_broadcaster 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add controller for broadcasting events from KUKA robots 16 | * Contributors: Aron Svastits 17 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/test/config/test1_joint_trajectory_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test1/joint_trajectory_controller: 2 | ros__parameters: 3 | joints: 4 | - test1_joint_1 5 | - test1_joint_2 6 | - test1_joint_3 7 | - test1_joint_4 8 | - test1_joint_5 9 | - test1_joint_6 10 | 11 | command_interfaces: 12 | - position 13 | state_interfaces: 14 | - position 15 | state_publish_rate: 50.0 16 | action_monitor_rate: 20.0 17 | allow_nonzero_velocity_at_trajectory_end: true 18 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/test/config/test2_joint_trajectory_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test2/joint_trajectory_controller: 2 | ros__parameters: 3 | joints: 4 | - test2_joint_1 5 | - test2_joint_2 6 | - test2_joint_3 7 | - test2_joint_4 8 | - test2_joint_5 9 | - test2_joint_6 10 | 11 | command_interfaces: 12 | - position 13 | state_interfaces: 14 | - position 15 | state_publish_rate: 50.0 16 | action_monitor_rate: 20.0 17 | allow_nonzero_velocity_at_trajectory_end: true 18 | -------------------------------------------------------------------------------- /kuka_rsi_driver/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_rsi_driver 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add package with driver for KUKA KSS robots 16 | * Contributors: Aron Svastits, Gergely Kovacs, Marton Antal, Lars Tingelstad 17 | -------------------------------------------------------------------------------- /examples/iiqka_moveit_example/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package iiqka_moveit_example 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add package with moveit examples for the KUKA iiQKA driver 16 | * Contributors: Aron Svastits, Gergely Kovacs 17 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/test/config/test1_joint_trajectory_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test1/joint_trajectory_controller: 2 | ros__parameters: 3 | joints: 4 | - test1_joint_1 5 | - test1_joint_2 6 | - test1_joint_3 7 | - test1_joint_4 8 | - test1_joint_5 9 | - test1_joint_6 10 | 11 | command_interfaces: 12 | - position 13 | state_interfaces: 14 | - position 15 | state_publish_rate: 50.0 16 | action_monitor_rate: 20.0 17 | allow_nonzero_velocity_at_trajectory_end: true 18 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/test/config/test2_joint_trajectory_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test2/joint_trajectory_controller: 2 | ros__parameters: 3 | joints: 4 | - test2_joint_1 5 | - test2_joint_2 6 | - test2_joint_3 7 | - test2_joint_4 8 | - test2_joint_5 9 | - test2_joint_6 10 | 11 | command_interfaces: 12 | - position 13 | state_interfaces: 14 | - position 15 | state_publish_rate: 50.0 16 | action_monitor_rate: 20.0 17 | allow_nonzero_velocity_at_trajectory_end: true 18 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_sunrise_fri_driver 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add package with driver for KUKA Sunrise robots 16 | * Contributors: Aron Svastits, Zoltan Resi, Gergely Kovacs 17 | -------------------------------------------------------------------------------- /controllers/fri_configuration_controller/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package fri_configuration_controller 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add controller for managing FRI configuration 16 | * Contributors: Aron Svastits 17 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_iiqka_eac_driver 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add package with driver for KUKA iiQKA robots 16 | * Contributors: Aron Svastits, Gergely Kovacs, Mark Szitanics, Sandor Komaromi 17 | -------------------------------------------------------------------------------- /kuka_drivers_core/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_drivers_core 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add package with core features necessary for all KUKA drivers 16 | * Contributors: Aron Svastits, Gergely Kovacs, Mark Szitanics, Sandor Komaromi 17 | -------------------------------------------------------------------------------- /controllers/kuka_control_mode_handler/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kuka_control_mode_handler 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add controller for handling the control mode of KUKA robots 16 | * Contributors: Aron Svastits, Sandor Komaromi 17 | -------------------------------------------------------------------------------- /controllers/joint_group_impedance_controller/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package joint_group_impedance_controller 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.2 (2024-07-10) 6 | ------------------ 7 | * Fix GCC warning causing unstable build 8 | 9 | 0.9.1 (2024-07-08) 10 | ------------------ 11 | * Add missing test dependency 12 | 13 | 0.9.0 (2024-07-08) 14 | ------------------ 15 | * Add controller for updating stiffness and damping command interfaces 16 | * Contributors: Aron Svastits 17 | -------------------------------------------------------------------------------- /kuka_rsi_simulator/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kuka_rsi_simulator 5 | 0.9.2 6 | Simple package for simulating the KUKA RSI interface 7 | Aron Svastits 8 | Apache-2.0 9 | 10 | ros2launch 11 | 12 | 13 | ament_python 14 | 15 | 16 | -------------------------------------------------------------------------------- /kuka_driver_interfaces/msg/KssStatus.msg: -------------------------------------------------------------------------------- 1 | # Common constant 2 | uint8 UNSPECIFIED = 0 3 | 4 | # Control mode constants 5 | uint8 JOINT_POSITION_CONTROL = 1 6 | uint8 CARTESIAN_POSITION_CONTROL = 5 7 | 8 | # Cycle time constants 9 | uint8 RSI_4MS = 1 10 | uint8 RSI_12MS = 2 11 | 12 | # Operation mode constants 13 | uint8 T1 = 1 14 | uint8 T2 = 2 15 | uint8 AUT = 3 16 | uint8 EXT = 4 17 | 18 | # Message fields 19 | uint8 control_mode 20 | uint8 cycle_time 21 | bool drives_powered 22 | bool emergency_stop 23 | bool guard_stop 24 | bool in_motion 25 | bool motion_possible 26 | uint8 operation_mode 27 | bool robot_stopped 28 | -------------------------------------------------------------------------------- /kuka_rsi_driver/test/config/test1_ros2_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test1/controller_manager: 2 | ros__parameters: 3 | update_rate: 250 # Hz 4 | 5 | joint_trajectory_controller: 6 | type: joint_trajectory_controller/JointTrajectoryController 7 | joint_state_broadcaster: 8 | type: joint_state_broadcaster/JointStateBroadcaster 9 | joint_group_impedance_controller: 10 | type: kuka_controllers/JointGroupImpedanceController 11 | effort_controller: 12 | type: effort_controllers/JointGroupPositionController 13 | control_mode_handler: 14 | type: kuka_controllers/ControlModeHandler 15 | -------------------------------------------------------------------------------- /kuka_rsi_driver/test/config/test2_ros2_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test2/controller_manager: 2 | ros__parameters: 3 | update_rate: 250 # Hz 4 | 5 | joint_trajectory_controller: 6 | type: joint_trajectory_controller/JointTrajectoryController 7 | joint_state_broadcaster: 8 | type: joint_state_broadcaster/JointStateBroadcaster 9 | joint_group_impedance_controller: 10 | type: kuka_controllers/JointGroupImpedanceController 11 | effort_controller: 12 | type: effort_controllers/JointGroupPositionController 13 | control_mode_handler: 14 | type: kuka_controllers/ControlModeHandler 15 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/test/config/test1_ros2_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test1/controller_manager: 2 | ros__parameters: 3 | update_rate: 250 # Hz 4 | 5 | joint_trajectory_controller: 6 | type: joint_trajectory_controller/JointTrajectoryController 7 | joint_state_broadcaster: 8 | type: joint_state_broadcaster/JointStateBroadcaster 9 | joint_group_impedance_controller: 10 | type: kuka_controllers/JointGroupImpedanceController 11 | effort_controller: 12 | type: effort_controllers/JointGroupPositionController 13 | control_mode_handler: 14 | type: kuka_controllers/ControlModeHandler 15 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/test/config/test2_ros2_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test2/controller_manager: 2 | ros__parameters: 3 | update_rate: 250 # Hz 4 | 5 | joint_trajectory_controller: 6 | type: joint_trajectory_controller/JointTrajectoryController 7 | joint_state_broadcaster: 8 | type: joint_state_broadcaster/JointStateBroadcaster 9 | joint_group_impedance_controller: 10 | type: kuka_controllers/JointGroupImpedanceController 11 | effort_controller: 12 | type: effort_controllers/JointGroupPositionController 13 | control_mode_handler: 14 | type: kuka_controllers/ControlModeHandler 15 | -------------------------------------------------------------------------------- /kuka_rsi_driver/config/ros2_controller_config_rsi_only.yaml: -------------------------------------------------------------------------------- 1 | controller_manager: 2 | ros__parameters: 3 | update_rate: 250 # Hz 4 | 5 | defaults: 6 | allow_controller_activation_with_inactive_hardware: true 7 | deactivate_controllers_on_hardware_self_deactivate: false 8 | 9 | joint_trajectory_controller: 10 | type: joint_trajectory_controller/JointTrajectoryController 11 | joint_state_broadcaster: 12 | type: joint_state_broadcaster/JointStateBroadcaster 13 | gpio_controller: 14 | type: gpio_controllers/GpioCommandController 15 | event_broadcaster: 16 | type: kuka_controllers/EventBroadcaster 17 | -------------------------------------------------------------------------------- /.github/workflows/deploy_wiki.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Wiki 2 | 3 | on: 4 | push: 5 | paths: 6 | # Trigger only when wiki directory or pipeline changes 7 | - 'doc/wiki/**' 8 | - '.github/workflows/deploy_wiki.yml' 9 | branches: 10 | # And only on master branch 11 | - master 12 | 13 | jobs: 14 | deploy-wiki: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v2 18 | 19 | - name: Push Wiki Changes 20 | uses: SwiftDocOrg/github-wiki-publish-action@v1 21 | with: 22 | path: "doc/wiki" 23 | env: 24 | GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} 25 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/include/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Aron Svastits 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | exclude_files=mock 16 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/test/config/test1_ros2_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test1/controller_manager: 2 | ros__parameters: 3 | update_rate: 250 # Hz 4 | 5 | joint_trajectory_controller: 6 | type: joint_trajectory_controller/JointTrajectoryController 7 | joint_state_broadcaster: 8 | type: joint_state_broadcaster/JointStateBroadcaster 9 | joint_group_impedance_controller: 10 | type: kuka_controllers/JointGroupImpedanceController 11 | effort_controller: 12 | type: effort_controllers/JointGroupPositionController 13 | control_mode_handler: 14 | type: kuka_controllers/ControlModeHandler 15 | event_broadcaster: 16 | type: kuka_controllers/EventBroadcaster 17 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/test/config/test2_ros2_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test2/controller_manager: 2 | ros__parameters: 3 | update_rate: 250 # Hz 4 | 5 | joint_trajectory_controller: 6 | type: joint_trajectory_controller/JointTrajectoryController 7 | joint_state_broadcaster: 8 | type: joint_state_broadcaster/JointStateBroadcaster 9 | joint_group_impedance_controller: 10 | type: kuka_controllers/JointGroupImpedanceController 11 | effort_controller: 12 | type: effort_controllers/JointGroupPositionController 13 | control_mode_handler: 14 | type: kuka_controllers/ControlModeHandler 15 | event_broadcaster: 16 | type: kuka_controllers/EventBroadcaster 17 | -------------------------------------------------------------------------------- /examples/iiqka_moveit_example/config/dummy_publisher.yaml: -------------------------------------------------------------------------------- 1 | /publisher_joint_trajectory_controller: 2 | ros__parameters: 3 | 4 | controller_name: "joint_trajectory_controller" 5 | wait_sec_between_publish: 6 6 | 7 | goal_names: ["pos1", "pos2", "pos3", "pos4"] 8 | pos1: 9 | positions: [0.0, -1.57, 0.0, 0.0, 0.0, 0.0] 10 | pos2: 11 | positions: [0.0, -1.37, 0.0, 0.0, 0.0, 0.0] 12 | pos3: 13 | positions: [0.2, -1.57, 0.2, 0.2, 0.2, 0.2] 14 | pos4: 15 | positions: [-0.2, -1.57, -0.2, -0.2, -0.2, -0.2] 16 | 17 | joints: 18 | - joint_1 19 | - joint_2 20 | - joint_3 21 | - joint_4 22 | - joint_5 23 | - joint_6 24 | 25 | check_starting_point: false 26 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yml: -------------------------------------------------------------------------------- 1 | # This is a format job. Pre-commit has a first-party GitHub action, so we use 2 | # that: https://github.com/pre-commit/action 3 | 4 | name: Pre-commit format 5 | run-name: Pre-commit format - ${{ github.event_name }} 6 | 7 | on: 8 | workflow_dispatch: 9 | pull_request: 10 | 11 | jobs: 12 | pre-commit: 13 | name: Format 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/setup-python@v4.7.1 18 | with: 19 | python-version: '3.10' 20 | - name: Install system hooks 21 | run: sudo apt install -qq cppcheck 22 | - uses: pre-commit/action@v3.0.0 23 | with: 24 | extra_args: --all-files --hook-stage manual 25 | -------------------------------------------------------------------------------- /examples/iiqka_moveit_example/config/moveit_controllers.yaml: -------------------------------------------------------------------------------- 1 | # MoveIt uses this configuration for controller management 2 | trajectory_execution: 3 | allowed_execution_duration_scaling: 1.2 4 | allowed_goal_duration_margin: 0.5 5 | allowed_start_tolerance: 0.01 6 | 7 | moveit_controller_manager: moveit_simple_controller_manager/MoveItSimpleControllerManager 8 | 9 | moveit_simple_controller_manager: 10 | controller_names: 11 | - joint_trajectory_controller 12 | 13 | joint_trajectory_controller: 14 | action_ns: follow_joint_trajectory 15 | type: FollowJointTrajectory 16 | default: true 17 | joints: 18 | - joint_1 19 | - joint_2 20 | - joint_3 21 | - joint_4 22 | - joint_5 23 | - joint_6 24 | -------------------------------------------------------------------------------- /kuka_driver_interfaces/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(kuka_driver_interfaces) 3 | 4 | # Default to C99 5 | if(NOT CMAKE_C_STANDARD) 6 | set(CMAKE_C_STANDARD 99) 7 | endif() 8 | 9 | # Default to C++14 10 | if(NOT CMAKE_CXX_STANDARD) 11 | set(CMAKE_CXX_STANDARD 14) 12 | endif() 13 | 14 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 15 | add_compile_options(-Wall -Wextra -Wpedantic) 16 | endif() 17 | 18 | # find dependencies 19 | find_package(ament_cmake REQUIRED) 20 | find_package(rosidl_default_generators REQUIRED) 21 | 22 | rosidl_generate_interfaces(${PROJECT_NAME} 23 | "msg/FriConfiguration.msg" 24 | "msg/FRIState.msg" 25 | "msg/KssStatus.msg" 26 | ) 27 | 28 | if(BUILD_TESTING) 29 | 30 | endif() 31 | 32 | ament_package() 33 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/test/config/test1_effort_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test1/effort_controller: 2 | ros__parameters: 3 | joints: 4 | - test1_joint_1 5 | - test1_joint_2 6 | - test1_joint_3 7 | - test1_joint_4 8 | - test1_joint_5 9 | - test1_joint_6 10 | gains: 11 | test1_joint_1: 12 | p: 5.0 13 | i: 0.0 14 | d: 0.1 15 | test1_joint_2: 16 | p: 5.0 17 | i: 0.0 18 | d: 0.1 19 | test1_joint_3: 20 | p: 5.0 21 | i: 0.0 22 | d: 0.1 23 | test1_joint_4: 24 | p: 5.0 25 | i: 0.0 26 | d: 0.1 27 | test1_joint_5: 28 | p: 5.0 29 | i: 0.0 30 | d: 0.1 31 | test1_joint_6: 32 | p: 5.0 33 | i: 0.0 34 | d: 0.1 35 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/test/config/test2_effort_controller_config.yaml: -------------------------------------------------------------------------------- 1 | test2/effort_controller: 2 | ros__parameters: 3 | joints: 4 | - test2_joint_1 5 | - test2_joint_2 6 | - test2_joint_3 7 | - test2_joint_4 8 | - test2_joint_5 9 | - test2_joint_6 10 | gains: 11 | test2_joint_1: 12 | p: 5.0 13 | i: 0.0 14 | d: 0.1 15 | test2_joint_2: 16 | p: 5.0 17 | i: 0.0 18 | d: 0.1 19 | test2_joint_3: 20 | p: 5.0 21 | i: 0.0 22 | d: 0.1 23 | test2_joint_4: 24 | p: 5.0 25 | i: 0.0 26 | d: 0.1 27 | test2_joint_5: 28 | p: 5.0 29 | i: 0.0 30 | d: 0.1 31 | test2_joint_6: 32 | p: 5.0 33 | i: 0.0 34 | d: 0.1 35 | -------------------------------------------------------------------------------- /kuka_rsi_driver/config/ros2_controller_config_extended.yaml: -------------------------------------------------------------------------------- 1 | controller_manager: 2 | ros__parameters: 3 | update_rate: 250 # Hz 4 | 5 | defaults: 6 | allow_controller_activation_with_inactive_hardware: true 7 | deactivate_controllers_on_hardware_self_deactivate: false 8 | 9 | joint_trajectory_controller: 10 | type: joint_trajectory_controller/JointTrajectoryController 11 | joint_state_broadcaster: 12 | type: joint_state_broadcaster/JointStateBroadcaster 13 | control_mode_handler: 14 | type: kuka_controllers/ControlModeHandler 15 | event_broadcaster: 16 | type: kuka_controllers/EventBroadcaster 17 | kss_message_handler: 18 | type: kuka_controllers/KssMessageHandler 19 | gpio_controller: 20 | type: gpio_controllers/GpioCommandController 21 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/config/ros2_controller_config.yaml: -------------------------------------------------------------------------------- 1 | controller_manager: 2 | ros__parameters: 3 | update_rate: 250 # Hz 4 | 5 | defaults: 6 | allow_controller_activation_with_inactive_hardware: true 7 | deactivate_controllers_on_hardware_self_deactivate: false 8 | 9 | joint_trajectory_controller: 10 | type: joint_trajectory_controller/JointTrajectoryController 11 | joint_state_broadcaster: 12 | type: joint_state_broadcaster/JointStateBroadcaster 13 | joint_group_impedance_controller: 14 | type: kuka_controllers/JointGroupImpedanceController 15 | effort_controller: 16 | type: effort_controllers/JointGroupEffortController 17 | control_mode_handler: 18 | type: kuka_controllers/ControlModeHandler 19 | event_broadcaster: 20 | type: kuka_controllers/EventBroadcaster 21 | -------------------------------------------------------------------------------- /kuka_rsi_driver/config/gpio_config.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 0.0 9 | 10 | 11 | 12 | 13 | 0.0 14 | 15 | 16 | 17 | 0.0 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/include/fri_client_sdk/HWIFClientApplication.hpp: -------------------------------------------------------------------------------- 1 | #ifndef FRI__HWIFCLIENTAPPLICATION_HPP_ 2 | #define FRI__HWIFCLIENTAPPLICATION_HPP_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | 13 | namespace KUKA 14 | { 15 | namespace FRI 16 | { 17 | 18 | class HWIFClientApplication : public ClientApplication 19 | { 20 | public: 21 | HWIFClientApplication(IConnection & connection, IClient & client); 22 | 23 | bool client_app_read(); 24 | void client_app_update(); 25 | bool client_app_write(); 26 | 27 | private: 28 | int size_; 29 | }; 30 | 31 | } 32 | } // namespace KUKA::FRI 33 | 34 | #endif // FRI__HWIFCLIENTAPPLICATION_HPP_ 35 | -------------------------------------------------------------------------------- /.github/mergify.yml: -------------------------------------------------------------------------------- 1 | pull_request_rules: 2 | - name: Backport to humble at reviewers discretion 3 | conditions: 4 | - base=master 5 | - "label=backport-humble" 6 | actions: 7 | backport: 8 | branches: 9 | - humble 10 | 11 | - name: Ask to resolve conflict for backports 12 | conditions: 13 | - conflict 14 | - author=mergify[bot] 15 | actions: 16 | comment: 17 | message: This pull request is in conflict. Could you fix it @pasztork @Svastits @kovacsge11? 18 | 19 | - name: development targets master branch 20 | conditions: 21 | - base!=master 22 | - author!=mergify[bot] 23 | actions: 24 | comment: 25 | message: | 26 | @{{author}}, all pull requests must be targeted towards the `master` development branch. 27 | Once merged into `master`, it is possible to backport to `{{base}}`, but it must be in `master` 28 | to have these changes reflected into new distributions. 29 | -------------------------------------------------------------------------------- /controllers/kuka_kss_message_handler/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kuka_kss_message_handler 5 | 0.0.0 6 | Non-real time message handler for KSS KUKA robots 7 | Kristof Pasztor 8 | Apache-2.0 9 | 10 | ament_cmake_ros 11 | 12 | controller_interface 13 | pluginlib 14 | rclcpp 15 | rclcpp_lifecycle 16 | std_msgs 17 | kuka_drivers_core 18 | kuka_driver_interfaces 19 | 20 | controller_manager 21 | ros2_control_test_assets 22 | 23 | 24 | ament_cmake 25 | 26 | 27 | -------------------------------------------------------------------------------- /controllers/kuka_event_broadcaster/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kuka_event_broadcaster 5 | 0.9.2 6 | Broadcaster of hardware events of KUKA robots 7 | 8 | Aron Svastits 9 | Gergely Kovacs 10 | Sandor Komaromi 11 | Kristof Matyas Pasztor 12 | Tamas Pepo 13 | 14 | Apache-2.0 15 | 16 | ament_cmake 17 | 18 | controller_interface 19 | pluginlib 20 | kuka_drivers_core 21 | 22 | 23 | ament_cmake 24 | 25 | 26 | -------------------------------------------------------------------------------- /controllers/fri_state_broadcaster/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | fri_state_broadcaster 5 | 0.9.2 6 | Broadcaster for FRI state 7 | 8 | Aron Svastits 9 | Gergely Kovacs 10 | Sandor Komaromi 11 | Kristof Matyas Pasztor 12 | Tamas Pepo 13 | 14 | Apache-2.0 15 | 16 | ament_cmake 17 | 18 | controller_interface 19 | pluginlib 20 | kuka_driver_interfaces 21 | kuka_drivers_core 22 | 23 | 24 | ament_cmake 25 | 26 | 27 | -------------------------------------------------------------------------------- /controllers/kuka_control_mode_handler/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kuka_control_mode_handler 5 | 0.9.2 6 | Controller for setting the control mode of KUKA robots in runtime 7 | 8 | Aron Svastits 9 | Gergely Kovacs 10 | Sandor Komaromi 11 | Kristof Matyas Pasztor 12 | Tamas Pepo 13 | 14 | Apache-2.0 15 | 16 | ament_cmake 17 | 18 | controller_interface 19 | pluginlib 20 | kuka_drivers_core 21 | 22 | 23 | ament_cmake 24 | 25 | 26 | -------------------------------------------------------------------------------- /controllers/fri_configuration_controller/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | fri_configuration_controller 5 | 0.9.2 6 | Controller for configuration of FRI 7 | 8 | Aron Svastits 9 | Gergely Kovacs 10 | Sandor Komaromi 11 | Kristof Matyas Pasztor 12 | Tamas Pepo 13 | 14 | Apache-2.0 15 | 16 | ament_cmake 17 | 18 | controller_interface 19 | pluginlib 20 | kuka_driver_interfaces 21 | kuka_drivers_core 22 | 23 | 24 | ament_cmake 25 | 26 | 27 | -------------------------------------------------------------------------------- /kuka_driver_interfaces/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kuka_driver_interfaces 5 | 0.9.2 6 | Message definitions necessary for using KUKA drivers 7 | Aron Svastits 8 | Gergely Kovacs 9 | Sandor Komaromi 10 | Kristof Matyas Pasztor 11 | Tamas Pepo 12 | Apache-2.0 13 | 14 | ament_cmake 15 | rosidl_default_generators 16 | 17 | rosidl_default_runtime 18 | 19 | rosidl_interface_packages 20 | 21 | 22 | ament_cmake 23 | 24 | 25 | -------------------------------------------------------------------------------- /controllers/kuka_controllers/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | kuka_controllers 4 | 0.9.2 5 | ROS2 controllers for KUKA robots 6 | Aron Svastits 7 | Gergely Kovacs 8 | Sandor Komaromi 9 | Kristof Matyas Pasztor 10 | Tamas Pepo 11 | Apache-2.0 12 | 13 | ament_cmake 14 | 15 | kuka_control_mode_handler 16 | kuka_event_broadcaster 17 | kuka_kss_message_handler 18 | fri_configuration_controller 19 | fri_state_broadcaster 20 | joint_group_impedance_controller 21 | 22 | 23 | ament_cmake 24 | 25 | 26 | -------------------------------------------------------------------------------- /kuka_drivers_core/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kuka_drivers_core 5 | 0.9.2 6 | Package containing ROS2 core functions for KUKA robots 7 | Aron Svastits 8 | Gergely Kovacs 9 | Sandor Komaromi 10 | Kristof Matyas Pasztor 11 | Tamas Pepo 12 | Apache-2.0 13 | 14 | ament_cmake 15 | rosidl_default_generators 16 | 17 | rclcpp 18 | rclcpp_lifecycle 19 | lifecycle_msgs 20 | controller_manager 21 | 22 | 23 | ament_cmake 24 | 25 | 26 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/config/ros2_controller_config.yaml: -------------------------------------------------------------------------------- 1 | controller_manager: 2 | ros__parameters: 3 | update_rate: 100 # Hz 4 | 5 | defaults: 6 | allow_controller_activation_with_inactive_hardware: true 7 | deactivate_controllers_on_hardware_self_deactivate: false 8 | 9 | joint_trajectory_controller: 10 | type: joint_trajectory_controller/JointTrajectoryController 11 | effort_controller: 12 | type: effort_controllers/JointGroupEffortController 13 | joint_state_broadcaster: 14 | type: joint_state_broadcaster/JointStateBroadcaster 15 | fri_state_broadcaster: 16 | type: kuka_controllers/FRIStateBroadcaster 17 | event_broadcaster: 18 | type: kuka_controllers/EventBroadcaster 19 | external_torque_broadcaster: 20 | type: joint_state_broadcaster/JointStateBroadcaster 21 | 22 | # Configuration controllers 23 | joint_group_impedance_controller: 24 | type: kuka_controllers/JointGroupImpedanceController 25 | fri_configuration_controller: 26 | type: kuka_controllers/FRIConfigurationController 27 | control_mode_handler: 28 | type: kuka_controllers/ControlModeHandler 29 | -------------------------------------------------------------------------------- /controllers/joint_group_impedance_controller/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | joint_group_impedance_controller 5 | 0.9.2 6 | Controller for modifying impedance (stiffness and damping) interfaces of a joint group 7 | 8 | Aron Svastits 9 | Gergely Kovacs 10 | Sandor Komaromi 11 | Kristof Matyas Pasztor 12 | Tamas Pepo 13 | 14 | Apache-2.0 15 | 16 | ament_cmake 17 | 18 | forward_command_controller 19 | pluginlib 20 | kuka_drivers_core 21 | generate_parameter_library 22 | 23 | 24 | ament_cmake 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/iiqka_moveit_example/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | iiqka_moveit_example 5 | 0.9.2 6 | ROS example package using the iiQKA driver and moveit 7 | Aron Svastits 8 | Gergely Kovacs 9 | Sandor Komaromi 10 | Kristof Matyas Pasztor 11 | Tamas Pepo 12 | Apache-2.0 13 | 14 | ament_cmake 15 | 16 | moveit_ros_planning_interface 17 | moveit_visual_tools 18 | 19 | kuka_iiqka_eac_driver 20 | moveit 21 | ros2_controllers_test_nodes 22 | 23 | 24 | ament_cmake 25 | 26 | 27 | -------------------------------------------------------------------------------- /kuka_drivers_core/include/kuka_drivers_core/hardware_event.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_DRIVERS_CORE__HARDWARE_EVENT_HPP_ 16 | #define KUKA_DRIVERS_CORE__HARDWARE_EVENT_HPP_ 17 | 18 | #include 19 | 20 | namespace kuka_drivers_core 21 | { 22 | /** 23 | * @brief Enum for controller-side events 24 | */ 25 | enum class HardwareEvent : std::uint8_t 26 | { 27 | HARDWARE_EVENT_UNSPECIFIED = 0, 28 | COMMAND_ACCEPTED = 2, 29 | CONTROL_STARTED = 3, 30 | CONTROL_STOPPED = 4, 31 | CONTROL_MODE_SWITCH = 5, 32 | ERROR = 6 33 | }; 34 | 35 | } // namespace kuka_drivers_core 36 | 37 | #endif // KUKA_DRIVERS_CORE__HARDWARE_EVENT_HPP_ 38 | -------------------------------------------------------------------------------- /kuka_drivers/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | kuka_drivers 4 | 0.9.2 5 | ROS2 drivers for KUKA robots 6 | Aron Svastits 7 | Gergely Kovacs 8 | Sandor Komaromi 9 | Kristof Matyas Pasztor 10 | Tamas Pepo 11 | Apache-2.0 12 | 13 | https://github.com/kroshu/kuka_drivers/issues 14 | https://github.com/kroshu/kuka_drivers 15 | 16 | ament_cmake 17 | 18 | iiqka_moveit_example 19 | kuka_driver_interfaces 20 | kuka_drivers_core 21 | kuka_iiqka_eac_driver 22 | kuka_rsi_driver 23 | kuka_rsi_simulator 24 | kuka_sunrise_fri_driver 25 | 26 | kuka_controllers 27 | 28 | 29 | ament_cmake 30 | 31 | 32 | -------------------------------------------------------------------------------- /sonar-project.properties: -------------------------------------------------------------------------------- 1 | sonar.organization=kroshu 2 | sonar.projectName=kuka_drivers 3 | sonar.projectKey=kroshu_kuka_drivers 4 | 5 | sonar.host.url=https://sonarcloud.io 6 | 7 | sonar.modules=examples,kuka_sunrise_fri_driver, kuka_rsi_driver, kuka_iiqka_eac_driver, kuka_drivers_core, controllers 8 | 9 | examples.sonar.projectName=examples 10 | examples.sonar.sources=./iiqka_moveit_example/src, ./iiqka_moveit_example/launch 11 | kuka_sunrise_fri_driver.sonar.projectName=kuka_sunrise_fri_driver 12 | kuka_sunrise_fri_driver.sonar.sources=./src,./include,./launch 13 | kuka_sunrise_fri_driver.sonar.exclusions=**/fri_client_sdk/** 14 | kuka_rsi_driver.sonar.projectName=kuka_rsi_driver 15 | kuka_rsi_driver.sonar.sources=./src,./include 16 | kuka_iiqka_eac_driver.sonar.projectName=kuka_iiqka_eac_driver 17 | kuka_iiqka_eac_driver.sonar.sources=./src,./include/kuka_iiqka_eac_driver 18 | kuka_iiqka_eac_driver.sonar.exclusions=**/mock/** 19 | kuka_drivers_core.sonar.projectName=kuka_drivers_core 20 | kuka_drivers_core.sonar.sources=./src,./include 21 | controllers.sonar.projectName=controllers 22 | controllers.sonar.sources=./kuka_control_mode_handler, ./kuka_event_broadcaster, ./fri_configuration_controller, ./fri_state_broadcaster, ./joint_group_impedance_controller, ./kuka_kss_message_handler 23 | 24 | # Encoding of the source code. Default is default system encoding 25 | sonar.sourceEncoding=UTF-8 26 | sonar.python.version=3 27 | -------------------------------------------------------------------------------- /kuka_driver_interfaces/msg/FRIState.msg: -------------------------------------------------------------------------------- 1 | # Message describing the state of the robot and FRI 2 | 3 | # FRI session state enum 4 | # IDLE = 0, MONITORING_WAIT = 1, MONITORING_READY = 2,COMMANDING_WAIT = 3, COMMANDING_ACTIVE = 4 5 | int32 session_state 6 | 7 | # FRI connection quality 8 | # POOR = 0, FAIR = 1, GOOD = 2, EXCELLENT = 3 9 | int32 connection_quality 10 | 11 | # Safety state 12 | # NORMAL_OPERATION = 0, SAFETY_STOP_LEVEL_0 = 1, SAFETY_STOP_LEVEL_1 = 2, SAFETY_STOP_LEVEL_2 = 3 13 | int32 safety_state 14 | 15 | # Client command mode 16 | # NO_COMMAND_MODE = 0, POSITION = 1, WRENCH = 2, TORQUE = 3 17 | int32 command_mode 18 | 19 | # Control mode of the robot 20 | # POSITION_CONTROL_MODE = 0, CART_IMP_CONTROL_MODE = 1, JOINT_IMP_CONTROL_MODE = 2, NO_CONTROL = 3 21 | int32 control_mode 22 | 23 | # Operation mode 24 | # TEST_MODE_1 = 0, TEST_MODE_2 = 1, AUTOMATIC_MODE = 2 25 | int32 operation_mode 26 | 27 | # Drive state 28 | # OFF = 0, TRANSITIONING = 1, ACTIVE = 2 29 | int32 drive_state 30 | 31 | # Overlay overlay_type 32 | # NO_OVERLAY = 0, JOINT = 1, CARTESIAN = 2 33 | int32 overlay_type 34 | 35 | # Tracking performance of the robot 36 | # Indicates how well the commanded robot is able to follow the commands of the FRI client. 37 | # The best possible value is 1.0, when the robot executes the given commands instantaneously. 38 | # The tracking performance is always 0 when the session state is not COMMANDING_ACTIVE. 39 | float64 tracking_performance 40 | -------------------------------------------------------------------------------- /kuka_rsi_driver/include/kuka_rsi_driver/robot_manager_node_rsi_only.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_RSI_DRIVER__ROBOT_MANAGER_NODE_RSI_ONLY_HPP_ 16 | #define KUKA_RSI_DRIVER__ROBOT_MANAGER_NODE_RSI_ONLY_HPP_ 17 | 18 | #include "robot_manager_base.hpp" 19 | 20 | using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn; 21 | 22 | namespace kuka_rsi_driver 23 | { 24 | class RobotManagerNodeRsi : public RobotManagerBase 25 | { 26 | public: 27 | RobotManagerNodeRsi() = default; 28 | ~RobotManagerNodeRsi() = default; 29 | 30 | CallbackReturn on_configure(const rclcpp_lifecycle::State &) override; 31 | 32 | CallbackReturn on_cleanup(const rclcpp_lifecycle::State &) override; 33 | }; 34 | } // namespace kuka_rsi_driver 35 | 36 | #endif // KUKA_RSI_DRIVER__ROBOT_MANAGER_NODE_RSI_ONLY_HPP_ 37 | -------------------------------------------------------------------------------- /kuka_drivers_core/src/ros2_base_node.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Gergely Kovács 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include "kuka_drivers_core/ros2_base_node.hpp" 20 | 21 | namespace kuka_drivers_core 22 | { 23 | 24 | ROS2BaseNode::ROS2BaseNode(const std::string & node_name, const rclcpp::NodeOptions & options) 25 | : rclcpp::Node(node_name, options) 26 | { 27 | param_callback_ = 28 | this->add_on_set_parameters_callback([this](const std::vector & parameters) 29 | { return param_handler_.onParamChange(parameters); }); 30 | } 31 | 32 | const ParameterHandler & ROS2BaseNode::getParameterHandler() const { return param_handler_; } 33 | 34 | rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr ROS2BaseNode::ParamCallback() 35 | const 36 | { 37 | return param_callback_; 38 | } 39 | } // namespace kuka_drivers_core 40 | -------------------------------------------------------------------------------- /examples/iiqka_moveit_example/launch/launch_trajectory_publisher.launch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Márk Szitanics 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from launch import LaunchDescription 16 | from launch.substitutions import PathJoinSubstitution 17 | from launch_ros.actions import Node 18 | from launch_ros.substitutions import FindPackageShare 19 | 20 | 21 | def generate_launch_description(): 22 | position_goals = PathJoinSubstitution( 23 | [ 24 | FindPackageShare("iiqka_moveit_example"), 25 | "config", 26 | "dummy_publisher.yaml", 27 | ] 28 | ) 29 | return LaunchDescription( 30 | [ 31 | Node( 32 | package="ros2_controllers_test_nodes", 33 | executable="publisher_joint_trajectory_controller", 34 | name="publisher_joint_trajectory_controller", 35 | parameters=[position_goals], 36 | output="both", 37 | ) 38 | ] 39 | ) 40 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/robot_application/src/ros2/serialization/MessageEncoding.java: -------------------------------------------------------------------------------- 1 | package ros2.serialization; 2 | 3 | import java.io.ByteArrayInputStream; 4 | import java.io.ByteArrayOutputStream; 5 | import java.io.Externalizable; 6 | import java.io.IOException; 7 | import java.io.ObjectOutputStream; 8 | import java.io.ObjectInputStream; 9 | 10 | public class MessageEncoding { 11 | public static byte[] Encode(Externalizable objectIn, int serialLength){ 12 | ByteArrayOutputStream serialDataStream = new ByteArrayOutputStream(); 13 | byte[] serialDataOut = new byte[serialLength + 4]; 14 | try{ 15 | ObjectOutputStream objectStream = new ObjectOutputStream(serialDataStream); 16 | objectIn.writeExternal(objectStream); 17 | objectStream.flush(); 18 | objectStream.close(); 19 | serialDataOut = serialDataStream.toByteArray(); 20 | }catch(IOException e){ 21 | e.printStackTrace(); 22 | } 23 | return serialDataOut; 24 | } 25 | 26 | public static void Decode(byte[] serialDataIn, Externalizable objectOut) throws RuntimeException{ 27 | try{ 28 | ByteArrayInputStream serialDataStream = new ByteArrayInputStream(serialDataIn); 29 | ObjectInputStream objectStream = new ObjectInputStream(serialDataStream); 30 | objectOut.readExternal(objectStream); 31 | objectStream.close(); 32 | } catch(IOException e){ 33 | e.printStackTrace(); 34 | throw new RuntimeException("IO Exception occurred"); 35 | } catch (ClassNotFoundException e) { 36 | throw new RuntimeException("Message could not be decoded"); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/src/fri_client_sdk/FRIMessages.pb.c: -------------------------------------------------------------------------------- 1 | /* Automatically generated nanopb constant definitions */ 2 | /* Generated by nanopb-0.4.8-dev */ 3 | 4 | #include "FRIMessages.pb.h" 5 | #if PB_PROTO_HEADER_VERSION != 40 6 | #error Regenerate this file with the current version of nanopb generator. 7 | #endif 8 | 9 | PB_BIND(JointValues, JointValues, AUTO) 10 | 11 | 12 | PB_BIND(TimeStamp, TimeStamp, AUTO) 13 | 14 | 15 | PB_BIND(CartesianVector, CartesianVector, AUTO) 16 | 17 | 18 | PB_BIND(Checksum, Checksum, AUTO) 19 | 20 | 21 | PB_BIND(Transformation, Transformation, AUTO) 22 | 23 | 24 | PB_BIND(FriIOValue, FriIOValue, AUTO) 25 | 26 | 27 | PB_BIND(MessageHeader, MessageHeader, AUTO) 28 | 29 | 30 | PB_BIND(ConnectionInfo, ConnectionInfo, AUTO) 31 | 32 | 33 | PB_BIND(RobotInfo, RobotInfo, AUTO) 34 | 35 | 36 | PB_BIND(MessageMonitorData, MessageMonitorData, 2) 37 | 38 | 39 | PB_BIND(MessageIpoData, MessageIpoData, AUTO) 40 | 41 | 42 | PB_BIND(MessageCommandData, MessageCommandData, 2) 43 | 44 | 45 | PB_BIND(MessageEndOf, MessageEndOf, AUTO) 46 | 47 | 48 | PB_BIND(FRIMonitoringMessage, FRIMonitoringMessage, 2) 49 | 50 | 51 | PB_BIND(FRICommandMessage, FRICommandMessage, 2) 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | #ifndef PB_CONVERT_DOUBLE_FLOAT 66 | /* On some platforms (such as AVR), double is really float. 67 | * To be able to encode/decode double on these platforms, you need. 68 | * to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line. 69 | */ 70 | PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES) 71 | #endif 72 | -------------------------------------------------------------------------------- /kuka_rsi_simulator/setup.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Márton Antal 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License.from launch import LaunchDescription 14 | 15 | from setuptools import setup 16 | import os 17 | from glob import glob 18 | 19 | package_name = "kuka_rsi_simulator" 20 | 21 | setup( 22 | name=package_name, 23 | version="0.9.2", 24 | packages=[package_name], 25 | data_files=[ 26 | ("share/ament_index/resource_index/packages", ["resource/" + package_name]), 27 | ("share/" + package_name, ["package.xml"]), 28 | ( 29 | os.path.join("share", package_name, "launch"), 30 | glob(os.path.join("launch", "*.launch.py")), 31 | ), 32 | ], 33 | install_requires=["setuptools"], 34 | zip_safe=True, 35 | maintainer="Marton Antal", 36 | maintainer_email="antal.marci@gmail.com", 37 | description="Simple package for simulating the KUKA RSI interface.", 38 | license="Apache-2.0", 39 | entry_points={ 40 | "console_scripts": ["rsi_simulator = kuka_rsi_simulator.rsi_simulator:main"], 41 | }, 42 | tests_require=["pytest"], 43 | test_suite="test", 44 | ) 45 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kuka_iiqka_eac_driver 5 | 0.9.2 6 | A ROS2 hardware interface for use with KUKA iiQKA OS 7 | Aron Svastits 8 | Gergely Kovacs 9 | Sandor Komaromi 10 | Kristof Matyas Pasztor 11 | Tamas Pepo 12 | Apache-2.0 13 | 14 | ament_cmake 15 | 16 | kuka_drivers_core 17 | hardware_interface 18 | pluginlib 19 | kuka_external_control_sdk 20 | std_msgs 21 | controller_manager_msgs 22 | 23 | kuka_lbr_iisy_support 24 | ros2_control 25 | joint_trajectory_controller 26 | effort_controllers 27 | joint_state_broadcaster 28 | kuka_control_mode_handler 29 | kuka_event_broadcaster 30 | joint_group_impedance_controller 31 | 32 | ros2lifecycle 33 | launch_testing_ament_cmake 34 | 35 | 36 | ament_cmake 37 | 38 | 39 | -------------------------------------------------------------------------------- /controllers/kuka_event_broadcaster/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(kuka_event_broadcaster) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra) 6 | endif() 7 | 8 | find_package(ament_cmake REQUIRED) 9 | find_package(controller_interface REQUIRED) 10 | find_package(pluginlib REQUIRED) 11 | find_package(kuka_drivers_core REQUIRED) 12 | 13 | include_directories(include) 14 | 15 | add_library(${PROJECT_NAME} SHARED 16 | src/kuka_event_broadcaster.cpp) 17 | 18 | target_include_directories(${PROJECT_NAME} PRIVATE 19 | include 20 | ) 21 | 22 | ament_target_dependencies(${PROJECT_NAME} controller_interface kuka_drivers_core 23 | ) 24 | 25 | # Causes the visibility macros to use dllexport rather than dllimport, 26 | # which is appropriate when building the dll but not consuming it. 27 | target_compile_definitions(${PROJECT_NAME} PRIVATE "KUKA_EVENT_BROADCASTER_BUILDING_LIBRARY") 28 | # prevent pluginlib from using boost 29 | target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") 30 | 31 | pluginlib_export_plugin_description_file(controller_interface controller_plugins.xml) 32 | 33 | install(TARGETS ${PROJECT_NAME} 34 | ARCHIVE DESTINATION lib 35 | LIBRARY DESTINATION lib 36 | RUNTIME DESTINATION bin 37 | ) 38 | 39 | install(DIRECTORY include/ 40 | DESTINATION include 41 | ) 42 | 43 | install(FILES controller_plugins.xml 44 | DESTINATION share/${PROJECT_NAME} 45 | ) 46 | 47 | if(BUILD_TESTING) 48 | 49 | endif() 50 | 51 | ament_export_include_directories(include) 52 | ament_export_libraries(${PROJECT_NAME}) 53 | 54 | ament_export_include_directories( 55 | include 56 | ) 57 | 58 | ament_export_libraries( 59 | ${PROJECT_NAME} 60 | ) 61 | 62 | ament_package() 63 | -------------------------------------------------------------------------------- /kuka_rsi_simulator/launch/kuka_rsi_simulator.launch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Márton Antal 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License.from launch import LaunchDescription 14 | 15 | 16 | from launch.actions import DeclareLaunchArgument 17 | from launch.substitutions import LaunchConfiguration, TextSubstitution 18 | from launch import LaunchDescription 19 | 20 | from launch_ros.actions import Node 21 | 22 | 23 | def generate_launch_description(): 24 | rsi_ip_address = DeclareLaunchArgument( 25 | "rsi_ip_address", default_value=TextSubstitution(text="127.0.0.1") 26 | ) 27 | rsi_port = DeclareLaunchArgument("rsi_port", default_value=TextSubstitution(text="59152")) 28 | 29 | return LaunchDescription( 30 | [ 31 | rsi_ip_address, 32 | rsi_port, 33 | Node( 34 | package="kuka_rsi_simulator", 35 | executable="rsi_simulator", 36 | name="kuka_rsi_simulator", 37 | parameters=[ 38 | { 39 | "rsi_ip_address": LaunchConfiguration("rsi_ip_address"), 40 | "rsi_port": LaunchConfiguration("rsi_port"), 41 | } 42 | ], 43 | ), 44 | ] 45 | ) 46 | -------------------------------------------------------------------------------- /controllers/kuka_control_mode_handler/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(kuka_control_mode_handler) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra) 6 | endif() 7 | 8 | find_package(ament_cmake REQUIRED) 9 | find_package(controller_interface REQUIRED) 10 | find_package(pluginlib REQUIRED) 11 | find_package(kuka_drivers_core REQUIRED) 12 | 13 | include_directories(include) 14 | 15 | add_library(${PROJECT_NAME} SHARED 16 | src/kuka_control_mode_handler.cpp) 17 | 18 | target_include_directories(${PROJECT_NAME} PRIVATE 19 | include 20 | ) 21 | 22 | ament_target_dependencies(${PROJECT_NAME} controller_interface std_msgs kuka_drivers_core 23 | ) 24 | 25 | # Causes the visibility macros to use dllexport rather than dllimport, 26 | # which is appropriate when building the dll but not consuming it. 27 | target_compile_definitions(${PROJECT_NAME} PRIVATE "KUKA_CONTROL_MODE_HANDLER_BUILDING_LIBRARY") 28 | # prevent pluginlib from using boost 29 | target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") 30 | 31 | pluginlib_export_plugin_description_file(controller_interface controller_plugins.xml) 32 | 33 | install(TARGETS ${PROJECT_NAME} 34 | ARCHIVE DESTINATION lib 35 | LIBRARY DESTINATION lib 36 | RUNTIME DESTINATION bin 37 | ) 38 | 39 | install(DIRECTORY include/ 40 | DESTINATION include 41 | ) 42 | 43 | install(FILES controller_plugins.xml 44 | DESTINATION share/${PROJECT_NAME} 45 | ) 46 | 47 | if(BUILD_TESTING) 48 | 49 | endif() 50 | 51 | ament_export_include_directories(include) 52 | ament_export_libraries(${PROJECT_NAME}) 53 | 54 | ament_export_include_directories( 55 | include 56 | ) 57 | 58 | ament_export_libraries( 59 | ${PROJECT_NAME} 60 | ) 61 | 62 | ament_package() 63 | -------------------------------------------------------------------------------- /kuka_drivers_core/include/kuka_drivers_core/controller_names.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_DRIVERS_CORE__CONTROLLER_NAMES_HPP_ 16 | #define KUKA_DRIVERS_CORE__CONTROLLER_NAMES_HPP_ 17 | 18 | namespace kuka_drivers_core 19 | { 20 | /* Fixed controller names */ 21 | static constexpr char JOINT_STATE_BROADCASTER[] = "joint_state_broadcaster"; 22 | static constexpr char EXTERNAL_TORQUE_BROADCASTER[] = "external_torque_broadcaster"; 23 | static constexpr char GPIO_CONTROLLER[] = "gpio_controller"; 24 | static constexpr char CONTROL_MODE_HANDLER[] = "control_mode_handler"; 25 | static constexpr char EVENT_BROADCASTER[] = "event_broadcaster"; 26 | static constexpr char FRI_CONFIGURATION_CONTROLLER[] = "fri_configuration_controller"; 27 | static constexpr char FRI_STATE_BROADCASTER[] = "fri_state_broadcaster"; 28 | static constexpr char KSS_MESSAGE_HANDLER[] = "kss_message_handler"; 29 | 30 | // Controller names with default values 31 | static constexpr char JOINT_TRAJECTORY_CONTROLLER[] = "joint_trajectory_controller"; 32 | static constexpr char JOINT_GROUP_IMPEDANCE_CONTROLLER[] = "joint_group_impedance_controller"; 33 | } // namespace kuka_drivers_core 34 | 35 | #endif // KUKA_DRIVERS_CORE__CONTROLLER_NAMES_HPP_ 36 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kuka_sunrise_fri_driver 5 | 0.9.2 6 | ROS2 KUKA sunrise interface 7 | Aron Svastits 8 | Gergely Kovacs 9 | Sandor Komaromi 10 | Kristof Matyas Pasztor 11 | Tamas Pepo 12 | Apache-2.0 13 | 14 | ament_cmake 15 | 16 | std_msgs 17 | std_srvs 18 | kuka_driver_interfaces 19 | kuka_drivers_core 20 | hardware_interface 21 | controller_manager_msgs 22 | 23 | libnanopb-dev 24 | 25 | ros2_control 26 | joint_trajectory_controller 27 | joint_state_broadcaster 28 | fri_configuration_controller 29 | fri_state_broadcaster 30 | kuka_control_mode_handler 31 | kuka_event_broadcaster 32 | joint_group_impedance_controller 33 | kuka_lbr_iiwa_support 34 | 35 | ros2lifecycle 36 | launch_testing_ament_cmake 37 | 38 | 39 | ament_cmake 40 | 41 | 42 | -------------------------------------------------------------------------------- /examples/iiqka_moveit_example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(iiqka_moveit_example) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wpedantic) 6 | endif() 7 | 8 | # find dependencies 9 | find_package(ament_cmake REQUIRED) 10 | find_package(moveit_ros_planning_interface REQUIRED) 11 | find_package(moveit_visual_tools REQUIRED) 12 | 13 | include_directories(include) 14 | 15 | add_executable(moveit_basic_planners_example src/moveit_basic_planners_example.cpp) 16 | ament_target_dependencies(moveit_basic_planners_example 17 | moveit_ros_planning_interface 18 | moveit_visual_tools 19 | ) 20 | 21 | add_executable(moveit_collision_avoidance_example src/moveit_collision_avoidance_example.cpp) 22 | ament_target_dependencies(moveit_collision_avoidance_example 23 | moveit_ros_planning_interface 24 | moveit_visual_tools 25 | ) 26 | 27 | add_executable(moveit_constrained_planning_example src/moveit_constrained_planning_example.cpp) 28 | ament_target_dependencies(moveit_constrained_planning_example 29 | moveit_ros_planning_interface 30 | moveit_visual_tools 31 | ) 32 | 33 | add_executable(moveit_depalletizing_example src/moveit_depalletizing_example.cpp) 34 | ament_target_dependencies(moveit_depalletizing_example 35 | moveit_ros_planning_interface 36 | moveit_visual_tools 37 | ) 38 | 39 | install(TARGETS 40 | moveit_basic_planners_example 41 | moveit_collision_avoidance_example 42 | moveit_constrained_planning_example 43 | moveit_depalletizing_example 44 | EXPORT export_${PROJECT_NAME} 45 | DESTINATION lib/${PROJECT_NAME} 46 | ) 47 | install(DIRECTORY launch 48 | DESTINATION share/${PROJECT_NAME} 49 | ) 50 | install(DIRECTORY config 51 | DESTINATION share/${PROJECT_NAME} 52 | ) 53 | 54 | if(BUILD_TESTING) 55 | 56 | endif() 57 | 58 | ament_package() 59 | -------------------------------------------------------------------------------- /kuka_drivers_core/include/kuka_drivers_core/control_mode.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Komáromi Sándor 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_DRIVERS_CORE__CONTROL_MODE_HPP_ 16 | #define KUKA_DRIVERS_CORE__CONTROL_MODE_HPP_ 17 | 18 | #include 19 | 20 | namespace kuka_drivers_core 21 | { 22 | /** 23 | * @brief Enum to identify every control mode 24 | */ 25 | enum class ControlMode : std::uint8_t 26 | { 27 | CONTROL_MODE_UNSPECIFIED = 0, 28 | JOINT_POSITION_CONTROL = 1, 29 | JOINT_IMPEDANCE_CONTROL = 2, 30 | JOINT_VELOCITY_CONTROL = 3, 31 | JOINT_TORQUE_CONTROL = 4, 32 | CARTESIAN_POSITION_CONTROL = 5, 33 | CARTESIAN_IMPEDANCE_CONTROL = 6, 34 | CARTESIAN_VELOCITY_CONTROL = 7, 35 | WRENCH_CONTROL = 8, 36 | }; 37 | 38 | /** 39 | * @brief Enum for identify every type of controllers 40 | */ 41 | enum class ControllerType : std::uint8_t 42 | { 43 | JOINT_POSITION_CONTROLLER_TYPE = 0, 44 | CARTESIAN_POSITION_CONTROLLER_TYPE = 1, 45 | JOINT_IMPEDANCE_CONTROLLER_TYPE = 2, 46 | CARTESIAN_IMPEDANCE_CONTROLLER_TYPE = 3, 47 | TORQUE_CONTROLLER_TYPE = 4, 48 | WRENCH_CONTROLLER_TYPE = 5, 49 | JOINT_VELOCITY_CONTROLLER_TYPE = 6, 50 | TWIST_CONTROLLER_TYPE = 7 51 | }; 52 | } // namespace kuka_drivers_core 53 | 54 | #endif // KUKA_DRIVERS_CORE__CONTROL_MODE_HPP_ 55 | -------------------------------------------------------------------------------- /controllers/fri_state_broadcaster/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(fri_state_broadcaster) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra) 6 | endif() 7 | 8 | find_package(ament_cmake REQUIRED) 9 | find_package(controller_interface REQUIRED) 10 | find_package(pluginlib REQUIRED) 11 | find_package(kuka_driver_interfaces REQUIRED) 12 | find_package(kuka_drivers_core REQUIRED) 13 | 14 | include_directories(include) 15 | 16 | add_library(${PROJECT_NAME} SHARED 17 | src/fri_state_broadcaster.cpp) 18 | 19 | target_include_directories(${PROJECT_NAME} PRIVATE 20 | include 21 | ) 22 | 23 | ament_target_dependencies(${PROJECT_NAME} controller_interface kuka_driver_interfaces kuka_drivers_core 24 | ) 25 | 26 | # Causes the visibility macros to use dllexport rather than dllimport, 27 | # which is appropriate when building the dll but not consuming it. 28 | target_compile_definitions(${PROJECT_NAME} PRIVATE "FRI_STATE_BROADCASTER_BUILDING_LIBRARY") 29 | # prevent pluginlib from using boost 30 | target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") 31 | 32 | pluginlib_export_plugin_description_file(controller_interface controller_plugins.xml) 33 | 34 | install(TARGETS ${PROJECT_NAME} 35 | ARCHIVE DESTINATION lib 36 | LIBRARY DESTINATION lib 37 | RUNTIME DESTINATION bin 38 | ) 39 | 40 | install(DIRECTORY include/ 41 | DESTINATION include 42 | ) 43 | 44 | install(FILES controller_plugins.xml 45 | DESTINATION share/${PROJECT_NAME} 46 | ) 47 | 48 | if(BUILD_TESTING) 49 | 50 | endif() 51 | 52 | ament_export_include_directories(include) 53 | ament_export_libraries(${PROJECT_NAME}) 54 | 55 | ament_export_include_directories( 56 | include 57 | ) 58 | 59 | ament_export_libraries( 60 | ${PROJECT_NAME} 61 | ) 62 | 63 | ament_package() 64 | -------------------------------------------------------------------------------- /kuka_rsi_driver/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kuka_rsi_driver 5 | 0.9.2 6 | A ROS2 hardware interface for use with KUKA RSI 7 | Aron Svastits 8 | Gergely Kovacs 9 | Sandor Komaromi 10 | Kristof Matyas Pasztor 11 | Tamas Pepo 12 | Apache-2.0 13 | 14 | ament_cmake 15 | ament_cmake_python 16 | 17 | controller_manager_msgs 18 | hardware_interface 19 | kuka_external_control_sdk 20 | kuka_drivers_core 21 | pluginlib 22 | std_msgs 23 | 24 | tinyxml_vendor 25 | 26 | joint_trajectory_controller 27 | joint_state_broadcaster 28 | gpio_controllers 29 | kuka_control_mode_handler 30 | kuka_kss_message_handler 31 | kuka_event_broadcaster 32 | kuka_robot_descriptions 33 | ros2_control 34 | 35 | kuka_rsi_simulator 36 | ros2lifecycle 37 | launch_testing_ament_cmake 38 | 39 | 40 | ament_cmake 41 | 42 | 43 | -------------------------------------------------------------------------------- /controllers/fri_configuration_controller/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(fri_configuration_controller) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra) 6 | endif() 7 | 8 | find_package(ament_cmake REQUIRED) 9 | find_package(controller_interface REQUIRED) 10 | find_package(pluginlib REQUIRED) 11 | find_package(kuka_driver_interfaces REQUIRED) 12 | find_package(kuka_drivers_core REQUIRED) 13 | 14 | include_directories(include) 15 | 16 | add_library(${PROJECT_NAME} SHARED 17 | src/fri_configuration_controller.cpp) 18 | 19 | target_include_directories(${PROJECT_NAME} PRIVATE 20 | include 21 | ) 22 | 23 | ament_target_dependencies(${PROJECT_NAME} controller_interface kuka_driver_interfaces kuka_drivers_core 24 | ) 25 | 26 | # Causes the visibility macros to use dllexport rather than dllimport, 27 | # which is appropriate when building the dll but not consuming it. 28 | target_compile_definitions(${PROJECT_NAME} PRIVATE "FRI_CONFIGURATION_CONTROLLER_BUILDING_LIBRARY") 29 | # prevent pluginlib from using boost 30 | target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") 31 | 32 | pluginlib_export_plugin_description_file(controller_interface controller_plugins.xml) 33 | 34 | install(TARGETS ${PROJECT_NAME} 35 | ARCHIVE DESTINATION lib 36 | LIBRARY DESTINATION lib 37 | RUNTIME DESTINATION bin 38 | ) 39 | 40 | install(DIRECTORY include/ 41 | DESTINATION include 42 | ) 43 | 44 | install(FILES controller_plugins.xml 45 | DESTINATION share/${PROJECT_NAME} 46 | ) 47 | 48 | if(BUILD_TESTING) 49 | 50 | endif() 51 | 52 | ament_export_include_directories(include) 53 | ament_export_libraries(${PROJECT_NAME}) 54 | 55 | ament_export_include_directories( 56 | include 57 | ) 58 | 59 | ament_export_libraries( 60 | ${PROJECT_NAME} 61 | ) 62 | 63 | ament_package() 64 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/robot_application/src/ros2/serialization/JointImpedanceControlModeExternalizable.java: -------------------------------------------------------------------------------- 1 | package ros2.serialization; 2 | 3 | import java.io.Externalizable; 4 | import java.io.IOException; 5 | import java.io.ObjectInput; 6 | import java.io.ObjectOutput; 7 | 8 | import ros2.tools.Conversions; 9 | 10 | import com.kuka.roboticsAPI.motionModel.controlModeModel.IMotionControlMode; 11 | import com.kuka.roboticsAPI.motionModel.controlModeModel.JointImpedanceControlMode; 12 | 13 | public class JointImpedanceControlModeExternalizable extends JointImpedanceControlMode implements Externalizable{ 14 | 15 | public final static int length = 112; 16 | 17 | public JointImpedanceControlModeExternalizable(){ 18 | super(1000, 1000, 1000, 1000, 1000, 1000, 1000); 19 | } 20 | 21 | public JointImpedanceControlModeExternalizable(JointImpedanceControlMode other){ 22 | super(other); 23 | } 24 | 25 | public IMotionControlMode toControlMode(){ 26 | JointImpedanceControlMode controlMode = new JointImpedanceControlMode((JointImpedanceControlMode)this); 27 | return (IMotionControlMode)controlMode; 28 | } 29 | 30 | @Override 31 | public void writeExternal(ObjectOutput out) throws IOException { 32 | for(double jointStiffness : getStiffness()){ 33 | out.writeDouble(jointStiffness); 34 | } 35 | for(double jointDamping : getDamping()){ 36 | out.writeDouble(jointDamping); 37 | } 38 | } 39 | 40 | @Override 41 | public void readExternal(ObjectInput in) throws IOException, 42 | ClassNotFoundException { 43 | double[] jointStiffness = new double[getStiffness().length]; 44 | for(int i = 0; i < getStiffness().length; i++){ 45 | jointStiffness[i] = in.readDouble(); 46 | } 47 | setStiffness(jointStiffness); 48 | 49 | double[] jointDamping = new double[getDamping().length]; 50 | for(int i = 0; i < getDamping().length; i++){ 51 | jointDamping[i] = in.readDouble(); 52 | } 53 | setDamping(jointDamping); 54 | 55 | } 56 | 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /kuka_rsi_driver/include/kuka_rsi_driver/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_RSI_DRIVER__VISIBILITY_CONTROL_H_ 16 | #define KUKA_RSI_DRIVER__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define KUKA_RSI_DRIVER_EXPORT __attribute__((dllexport)) 24 | #define KUKA_RSI_DRIVER_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define KUKA_RSI_DRIVER_EXPORT __declspec(dllexport) 27 | #define KUKA_RSI_DRIVER_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef KUKA_RSI_DRIVER_BUILDING_LIBRARY 30 | #define KUKA_RSI_DRIVER_PUBLIC KUKA_RSI_DRIVER_EXPORT 31 | #else 32 | #define KUKA_RSI_DRIVER_PUBLIC KUKA_RSI_DRIVER_IMPORT 33 | #endif 34 | #define KUKA_RSI_DRIVER_PUBLIC_TYPE KUKA_RSI_DRIVER_PUBLIC 35 | #define KUKA_RSI_DRIVER_LOCAL 36 | #else 37 | #define KUKA_RSI_DRIVER_EXPORT __attribute__((visibility("default"))) 38 | #define KUKA_RSI_DRIVER_IMPORT 39 | #if __GNUC__ >= 4 40 | #define KUKA_RSI_DRIVER_PUBLIC __attribute__((visibility("default"))) 41 | #define KUKA_RSI_DRIVER_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define KUKA_RSI_DRIVER_PUBLIC 44 | #define KUKA_RSI_DRIVER_LOCAL 45 | #endif 46 | #define KUKA_RSI_DRIVER_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // KUKA_RSI_DRIVER__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /controllers/joint_group_impedance_controller/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(joint_group_impedance_controller) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra) 6 | endif() 7 | 8 | find_package(ament_cmake REQUIRED) 9 | find_package(pluginlib REQUIRED) 10 | find_package(forward_command_controller) 11 | find_package(kuka_drivers_core) 12 | find_package(generate_parameter_library) 13 | 14 | include_directories(include) 15 | 16 | generate_parameter_library( 17 | joint_group_impedance_controller_parameters 18 | src/joint_group_impedance_controller_parameters.yaml 19 | ) 20 | 21 | add_library(${PROJECT_NAME} SHARED 22 | src/joint_group_impedance_controller.cpp) 23 | 24 | target_include_directories(${PROJECT_NAME} PRIVATE 25 | include 26 | ) 27 | 28 | ament_target_dependencies(${PROJECT_NAME} forward_command_controller kuka_drivers_core 29 | ) 30 | target_link_libraries(${PROJECT_NAME} joint_group_impedance_controller_parameters) 31 | 32 | # Causes the visibility macros to use dllexport rather than dllimport, 33 | # which is appropriate when building the dll but not consuming it. 34 | target_compile_definitions(${PROJECT_NAME} PRIVATE "JOINT_GROUP_IMPEDANCE_CONTROLLER_BUILDING_LIBRARY") 35 | # prevent pluginlib from using boost 36 | target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") 37 | 38 | pluginlib_export_plugin_description_file(controller_interface controller_plugins.xml) 39 | 40 | install(TARGETS ${PROJECT_NAME} 41 | ARCHIVE DESTINATION lib 42 | LIBRARY DESTINATION lib 43 | RUNTIME DESTINATION bin 44 | ) 45 | 46 | install(DIRECTORY include/ 47 | DESTINATION include 48 | ) 49 | 50 | install(FILES controller_plugins.xml 51 | DESTINATION share/${PROJECT_NAME} 52 | ) 53 | 54 | if(BUILD_TESTING) 55 | 56 | endif() 57 | 58 | ament_export_include_directories(include) 59 | ament_export_libraries(${PROJECT_NAME}) 60 | 61 | ament_export_include_directories( 62 | include 63 | ) 64 | 65 | ament_export_libraries( 66 | ${PROJECT_NAME} 67 | ) 68 | 69 | ament_package() 70 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Issue tracking 2 | 3 | If you have questions, suggestions or found a bug, feel free to open an [issue](https://github.com/kroshu/kuka_drivers/issues). 4 | When filing an issue, please check open issues to make sure somebody else hasn't already reported it. Please try to include as much information as you can, including: 5 | 6 | - A reproducible test case or series of steps 7 | - The version/commit hash of our code being used 8 | - Any modifications you've made relevant to the bug 9 | - Anything unusual about your environment or deployment 10 | 11 | Please do not add labels to the issue, that should be handled by the maintainers. 12 | 13 | ## Contributing 14 | 15 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: 16 | 17 | - Your PR addresses only one issue 18 | - Your PR has a descriptive title and a short summary 19 | - All pipelines are green, including 20 | - Industrial CI 21 | - Sonarcloud 22 | - Spell checks 23 | - Linters 24 | 25 | To send us a pull request, please: 26 | 27 | - Discuss the proposed changes with the maintainers, preferably in an issue 28 | - Fork the repository 29 | - Modify the source focusing on the specific change you are contributing 30 | - Ensure that local tests pass (`colcon test` and `pre-commit` run) 31 | - Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation 32 | 33 | ## Licensing 34 | 35 | Any contribution that you make to this repository will 36 | be under the Apache 2 License, as dictated by that 37 | [license](http://www.apache.org/licenses/LICENSE-2.0.html): 38 | 39 | ~~~license 40 | 5. Submission of Contributions. Unless You explicitly state otherwise, 41 | any Contribution intentionally submitted for inclusion in the Work 42 | by You to the Licensor shall be under the terms and conditions of 43 | this License, without any additional terms or conditions. 44 | Notwithstanding the above, nothing herein shall supersede or modify 45 | the terms of any separate license agreement you may have executed 46 | with Licensor regarding such Contributions. 47 | ~~~ 48 | -------------------------------------------------------------------------------- /kuka_rsi_driver/launch/startup_with_rviz.launch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Aron Svastits 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import os 16 | 17 | from ament_index_python.packages import get_package_share_directory 18 | 19 | from launch import LaunchDescription 20 | from launch_ros.actions import Node 21 | from launch.actions.include_launch_description import IncludeLaunchDescription 22 | from launch.launch_description_sources.python_launch_description_source import ( 23 | PythonLaunchDescriptionSource, 24 | ) 25 | from launch.actions import DeclareLaunchArgument 26 | from launch.substitutions import LaunchConfiguration 27 | 28 | 29 | def generate_launch_description(): 30 | rviz_config = LaunchConfiguration("rviz_config") 31 | rviz_config_launch_arg = DeclareLaunchArgument( 32 | "rviz_config", 33 | default_value=os.path.join( 34 | get_package_share_directory("kuka_resources"), "config", "view_6_axis_urdf.rviz" 35 | ), 36 | ) 37 | 38 | startup_launch = IncludeLaunchDescription( 39 | PythonLaunchDescriptionSource( 40 | [get_package_share_directory("kuka_rsi_driver"), "/launch/startup.launch.py"] 41 | ) 42 | ) 43 | 44 | return LaunchDescription( 45 | [ 46 | rviz_config_launch_arg, 47 | startup_launch, 48 | Node( 49 | package="rviz2", 50 | executable="rviz2", 51 | name="rviz2", 52 | output="log", 53 | arguments=["-d", rviz_config, "--ros-args", "--log-level", "error"], 54 | ), 55 | ] 56 | ) 57 | -------------------------------------------------------------------------------- /kuka_rsi_driver/include/kuka_rsi_driver/robot_manager_node_extended.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2025 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_RSI_DRIVER__ROBOT_MANAGER_NODE_EXTENDED_HPP_ 16 | #define KUKA_RSI_DRIVER__ROBOT_MANAGER_NODE_EXTENDED_HPP_ 17 | 18 | #include "std_msgs/msg/u_int32.hpp" 19 | #include "std_msgs/msg/u_int8.hpp" 20 | 21 | #include "robot_manager_base.hpp" 22 | 23 | using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn; 24 | 25 | namespace kuka_rsi_driver 26 | { 27 | class RobotManagerNodeEkiRsi : public RobotManagerBase 28 | { 29 | public: 30 | RobotManagerNodeEkiRsi(); 31 | ~RobotManagerNodeEkiRsi() = default; 32 | 33 | CallbackReturn on_configure(const rclcpp_lifecycle::State &) override; 34 | 35 | CallbackReturn on_cleanup(const rclcpp_lifecycle::State &) override; 36 | 37 | private: 38 | void EventSubscriptionCallback(const std_msgs::msg::UInt8::SharedPtr message) override; 39 | 40 | bool OnControlModeChangeRequest(const int control_mode) override; 41 | 42 | std::condition_variable control_mode_cv_; 43 | std::mutex control_mode_cv_m_; 44 | bool control_mode_change_finished_ = false; 45 | rclcpp::Publisher::SharedPtr control_mode_pub_; 46 | 47 | const std::vector configuration_controllers_ = { 48 | kuka_drivers_core::CONTROL_MODE_HANDLER, 49 | kuka_drivers_core::KSS_MESSAGE_HANDLER, 50 | kuka_drivers_core::EVENT_BROADCASTER, 51 | }; 52 | }; 53 | } // namespace kuka_rsi_driver 54 | 55 | #endif // KUKA_RSI_DRIVER__ROBOT_MANAGER_NODE_EXTENDED_HPP_ 56 | -------------------------------------------------------------------------------- /controllers/joint_group_impedance_controller/include/joint_group_impedance_controller/joint_group_impedance_controller.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef JOINT_GROUP_IMPEDANCE_CONTROLLER__JOINT_GROUP_IMPEDANCE_CONTROLLER_HPP_ 16 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER__JOINT_GROUP_IMPEDANCE_CONTROLLER_HPP_ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include "forward_command_controller/multi_interface_forward_command_controller.hpp" 23 | 24 | #include "joint_group_impedance_controller/joint_group_impedance_controller_parameters.hpp" 25 | #include "joint_group_impedance_controller/visibility_control.h" 26 | 27 | namespace kuka_controllers 28 | { 29 | class JointGroupImpedanceController : public forward_command_controller::ForwardControllersBase 30 | { 31 | public: 32 | JOINT_GROUP_IMPEDANCE_CONTROLLER_PUBLIC JointGroupImpedanceController(); 33 | JOINT_GROUP_IMPEDANCE_CONTROLLER_PUBLIC controller_interface::CallbackReturn on_init() override; 34 | 35 | private: 36 | JOINT_GROUP_IMPEDANCE_CONTROLLER_LOCAL void declare_parameters() override; 37 | JOINT_GROUP_IMPEDANCE_CONTROLLER_LOCAL controller_interface::CallbackReturn read_parameters() 38 | override; 39 | 40 | using Params = joint_group_impedance_controller::Params; 41 | using ParamListener = joint_group_impedance_controller::ParamListener; 42 | 43 | std::shared_ptr param_listener_; 44 | Params params_; 45 | }; 46 | } // namespace kuka_controllers 47 | #endif // JOINT_GROUP_IMPEDANCE_CONTROLLER__JOINT_GROUP_IMPEDANCE_CONTROLLER_HPP_ 48 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/launch/startup_with_rviz.launch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Aron Svastits 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import os 16 | 17 | from ament_index_python.packages import get_package_share_directory 18 | 19 | from launch import LaunchDescription 20 | from launch_ros.actions import Node 21 | from launch.actions.include_launch_description import IncludeLaunchDescription 22 | from launch.launch_description_sources.python_launch_description_source import ( 23 | PythonLaunchDescriptionSource, 24 | ) 25 | from launch.actions import DeclareLaunchArgument 26 | from launch.substitutions import LaunchConfiguration 27 | 28 | 29 | def generate_launch_description(): 30 | rviz_config = LaunchConfiguration("rviz_config") 31 | rviz_config_launch_arg = DeclareLaunchArgument( 32 | "rviz_config", 33 | default_value=os.path.join( 34 | get_package_share_directory("kuka_resources"), "config", "view_6_axis_urdf.rviz" 35 | ), 36 | ) 37 | 38 | startup_launch = IncludeLaunchDescription( 39 | PythonLaunchDescriptionSource( 40 | [get_package_share_directory("kuka_iiqka_eac_driver"), "/launch/startup.launch.py"] 41 | ) 42 | ) 43 | 44 | return LaunchDescription( 45 | [ 46 | rviz_config_launch_arg, 47 | startup_launch, 48 | Node( 49 | package="rviz2", 50 | executable="rviz2", 51 | name="rviz2", 52 | output="log", 53 | arguments=["-d", rviz_config, "--ros-args", "--log-level", "error"], 54 | ), 55 | ] 56 | ) 57 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/launch/startup_with_rviz.launch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Aron Svastits 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import os 16 | 17 | from ament_index_python.packages import get_package_share_directory 18 | 19 | from launch import LaunchDescription 20 | from launch_ros.actions import Node 21 | from launch.actions.include_launch_description import IncludeLaunchDescription 22 | from launch.launch_description_sources.python_launch_description_source import ( 23 | PythonLaunchDescriptionSource, 24 | ) 25 | 26 | from launch.actions import DeclareLaunchArgument 27 | from launch.substitutions import LaunchConfiguration 28 | 29 | 30 | def generate_launch_description(): 31 | rviz_config = LaunchConfiguration("rviz_config") 32 | rviz_config_launch_arg = DeclareLaunchArgument( 33 | "rviz_config", 34 | default_value=os.path.join( 35 | get_package_share_directory("kuka_resources"), "config", "view_6_axis_urdf.rviz" 36 | ), 37 | ) 38 | 39 | startup_launch = IncludeLaunchDescription( 40 | PythonLaunchDescriptionSource( 41 | [get_package_share_directory("kuka_sunrise_fri_driver"), "/launch/startup.launch.py"] 42 | ) 43 | ) 44 | 45 | return LaunchDescription( 46 | [ 47 | rviz_config_launch_arg, 48 | startup_launch, 49 | Node( 50 | package="rviz2", 51 | executable="rviz2", 52 | name="rviz2", 53 | output="log", 54 | arguments=["-d", rviz_config, "--ros-args", "--log-level", "error"], 55 | ), 56 | ] 57 | ) 58 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/include/kuka_iiqka_eac_driver/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_IIQKA_EAC_DRIVER__VISIBILITY_CONTROL_H_ 16 | #define KUKA_IIQKA_EAC_DRIVER__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define KUKA_IIQKA_EAC_DRIVER_EXPORT __attribute__((dllexport)) 24 | #define KUKA_IIQKA_EAC_DRIVER_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define KUKA_IIQKA_EAC_DRIVER_EXPORT __declspec(dllexport) 27 | #define KUKA_IIQKA_EAC_DRIVER_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef KUKA_IIQKA_EAC_DRIVER_BUILDING_LIBRARY 30 | #define KUKA_IIQKA_EAC_DRIVER_PUBLIC KUKA_IIQKA_EAC_DRIVER_EXPORT 31 | #else 32 | #define KUKA_IIQKA_EAC_DRIVER_PUBLIC KUKA_IIQKA_EAC_DRIVER_IMPORT 33 | #endif 34 | #define KUKA_IIQKA_EAC_DRIVER_PUBLIC_TYPE KUKA_IIQKA_EAC_DRIVER_PUBLIC 35 | #define KUKA_IIQKA_EAC_DRIVER_LOCAL 36 | #else 37 | #define KUKA_IIQKA_EAC_DRIVER_EXPORT __attribute__((visibility("default"))) 38 | #define KUKA_IIQKA_EAC_DRIVER_IMPORT 39 | #if __GNUC__ >= 4 40 | #define KUKA_IIQKA_EAC_DRIVER_PUBLIC __attribute__((visibility("default"))) 41 | #define KUKA_IIQKA_EAC_DRIVER_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define KUKA_IIQKA_EAC_DRIVER_PUBLIC 44 | #define KUKA_IIQKA_EAC_DRIVER_LOCAL 45 | #endif 46 | #define KUKA_IIQKA_EAC_DRIVER_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // KUKA_IIQKA_EAC_DRIVER__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /controllers/fri_state_broadcaster/include/fri_state_broadcaster/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef FRI_STATE_BROADCASTER__VISIBILITY_CONTROL_H_ 16 | #define FRI_STATE_BROADCASTER__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define FRI_STATE_BROADCASTER_EXPORT __attribute__((dllexport)) 24 | #define FRI_STATE_BROADCASTER_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define FRI_STATE_BROADCASTER_EXPORT __declspec(dllexport) 27 | #define FRI_STATE_BROADCASTER_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef FRI_STATE_BROADCASTER_BUILDING_LIBRARY 30 | #define FRI_STATE_BROADCASTER_PUBLIC FRI_STATE_BROADCASTER_EXPORT 31 | #else 32 | #define FRI_STATE_BROADCASTER_PUBLIC FRI_STATE_BROADCASTER_IMPORT 33 | #endif 34 | #define FRI_STATE_BROADCASTER_PUBLIC_TYPE FRI_STATE_BROADCASTER_PUBLIC 35 | #define FRI_STATE_BROADCASTER_LOCAL 36 | #else 37 | #define FRI_STATE_BROADCASTER_EXPORT __attribute__((visibility("default"))) 38 | #define FRI_STATE_BROADCASTER_IMPORT 39 | #if __GNUC__ >= 4 40 | #define FRI_STATE_BROADCASTER_PUBLIC __attribute__((visibility("default"))) 41 | #define FRI_STATE_BROADCASTER_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define FRI_STATE_BROADCASTER_PUBLIC 44 | #define FRI_STATE_BROADCASTER_LOCAL 45 | #endif 46 | #define FRI_STATE_BROADCASTER_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // FRI_STATE_BROADCASTER__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /controllers/kuka_event_broadcaster/include/kuka_event_broadcaster/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2024 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_EVENT_BROADCASTER__VISIBILITY_CONTROL_H_ 16 | #define KUKA_EVENT_BROADCASTER__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define KUKA_EVENT_BROADCASTER_EXPORT __attribute__((dllexport)) 24 | #define KUKA_EVENT_BROADCASTER_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define KUKA_EVENT_BROADCASTER_EXPORT __declspec(dllexport) 27 | #define KUKA_EVENT_BROADCASTER_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef KUKA_EVENT_BROADCASTER_BUILDING_LIBRARY 30 | #define KUKA_EVENT_BROADCASTER_PUBLIC KUKA_EVENT_BROADCASTER_EXPORT 31 | #else 32 | #define KUKA_EVENT_BROADCASTER_PUBLIC KUKA_EVENT_BROADCASTER_IMPORT 33 | #endif 34 | #define KUKA_EVENT_BROADCASTER_PUBLIC_TYPE KUKA_EVENT_BROADCASTER_PUBLIC 35 | #define KUKA_EVENT_BROADCASTER_LOCAL 36 | #else 37 | #define KUKA_EVENT_BROADCASTER_EXPORT __attribute__((visibility("default"))) 38 | #define KUKA_EVENT_BROADCASTER_IMPORT 39 | #if __GNUC__ >= 4 40 | #define KUKA_EVENT_BROADCASTER_PUBLIC __attribute__((visibility("default"))) 41 | #define KUKA_EVENT_BROADCASTER_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define KUKA_EVENT_BROADCASTER_PUBLIC 44 | #define KUKA_EVENT_BROADCASTER_LOCAL 45 | #endif 46 | #define KUKA_EVENT_BROADCASTER_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // KUKA_EVENT_BROADCASTER__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/include/kuka_sunrise_fri_driver/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_SUNRISE_FRI_DRIVER__VISIBILITY_CONTROL_H_ 16 | #define KUKA_SUNRISE_FRI_DRIVER__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define KUKA_SUNRISE_FRI_DRIVER_EXPORT __attribute__((dllexport)) 24 | #define KUKA_SUNRISE_FRI_DRIVER_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define KUKA_SUNRISE_FRI_DRIVER_EXPORT __declspec(dllexport) 27 | #define KUKA_SUNRISE_FRI_DRIVER_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef KUKA_SUNRISE_FRI_DRIVER_BUILDING_LIBRARY 30 | #define KUKA_SUNRISE_FRI_DRIVER_PUBLIC KUKA_SUNRISE_FRI_DRIVER_EXPORT 31 | #else 32 | #define KUKA_SUNRISE_FRI_DRIVER_PUBLIC KUKA_SUNRISE_FRI_DRIVER_IMPORT 33 | #endif 34 | #define KUKA_SUNRISE_FRI_DRIVER_PUBLIC_TYPE KUKA_SUNRISE_FRI_DRIVER_PUBLIC 35 | #define KUKA_SUNRISE_FRI_DRIVER_LOCAL 36 | #else 37 | #define KUKA_SUNRISE_FRI_DRIVER_EXPORT __attribute__((visibility("default"))) 38 | #define KUKA_SUNRISE_FRI_DRIVER_IMPORT 39 | #if __GNUC__ >= 4 40 | #define KUKA_SUNRISE_FRI_DRIVER_PUBLIC __attribute__((visibility("default"))) 41 | #define KUKA_SUNRISE_FRI_DRIVER_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define KUKA_SUNRISE_FRI_DRIVER_PUBLIC 44 | #define KUKA_SUNRISE_FRI_DRIVER_LOCAL 45 | #endif 46 | #define KUKA_SUNRISE_FRI_DRIVER_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // KUKA_SUNRISE_FRI_DRIVER__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /controllers/kuka_kss_message_handler/include/kuka_kss_message_handler/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2025 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_KSS_MESSAGE_HANDLER__VISIBILITY_CONTROL_H_ 16 | #define KUKA_KSS_MESSAGE_HANDLER__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define KUKA_KSS_MESSAGE_HANDLER_EXPORT __attribute__((dllexport)) 24 | #define KUKA_KSS_MESSAGE_HANDLER_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define KUKA_KSS_MESSAGE_HANDLER_EXPORT __declspec(dllexport) 27 | #define KUKA_KSS_MESSAGE_HANDLER_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef KUKA_KSS_MESSAGE_HANDLER_BUILDING_LIBRARY 30 | #define KUKA_KSS_MESSAGE_HANDLER_PUBLIC KUKA_KSS_MESSAGE_HANDLER_EXPORT 31 | #else 32 | #define KUKA_KSS_MESSAGE_HANDLER_PUBLIC KUKA_KSS_MESSAGE_HANDLER_IMPORT 33 | #endif 34 | #define KUKA_KSS_MESSAGE_HANDLER_PUBLIC_TYPE KUKA_KSS_MESSAGE_HANDLER_PUBLIC 35 | #define KUKA_KSS_MESSAGE_HANDLER_LOCAL 36 | #else 37 | #define KUKA_KSS_MESSAGE_HANDLER_EXPORT __attribute__((visibility("default"))) 38 | #define KUKA_KSS_MESSAGE_HANDLER_IMPORT 39 | #if __GNUC__ >= 4 40 | #define KUKA_KSS_MESSAGE_HANDLER_PUBLIC __attribute__((visibility("default"))) 41 | #define KUKA_KSS_MESSAGE_HANDLER_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define KUKA_KSS_MESSAGE_HANDLER_PUBLIC 44 | #define KUKA_KSS_MESSAGE_HANDLER_LOCAL 45 | #endif 46 | #define KUKA_KSS_MESSAGE_HANDLER_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // KUKA_KSS_MESSAGE_HANDLER__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /controllers/kuka_kss_message_handler/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(kuka_kss_message_handler) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra -Wpedantic) 6 | endif() 7 | 8 | # find dependencies 9 | find_package(ament_cmake REQUIRED) 10 | find_package(ament_cmake_ros REQUIRED) 11 | find_package(controller_interface REQUIRED) 12 | find_package(pluginlib REQUIRED) 13 | find_package(rclcpp REQUIRED) 14 | find_package(rclcpp_lifecycle REQUIRED) 15 | find_package(std_msgs REQUIRED) 16 | find_package(kuka_drivers_core REQUIRED) 17 | find_package(kuka_driver_interfaces REQUIRED) 18 | 19 | add_library(kuka_kss_message_handler SHARED src/kuka_kss_message_handler.cpp) 20 | add_library(kuka_kss_message_handler::kuka_kss_message_handler ALIAS kuka_kss_message_handler) 21 | target_compile_features(kuka_kss_message_handler PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 22 | target_include_directories(kuka_kss_message_handler PUBLIC 23 | $ 24 | $) 25 | ament_target_dependencies( 26 | kuka_kss_message_handler 27 | controller_interface 28 | pluginlib 29 | rclcpp 30 | rclcpp_lifecycle 31 | std_msgs 32 | kuka_drivers_core 33 | kuka_driver_interfaces 34 | ) 35 | 36 | # Causes the visibility macros to use dllexport rather than dllimport, 37 | # which is appropriate when building the dll but not consuming it. 38 | target_compile_definitions(kuka_kss_message_handler PRIVATE "KUKA_KSS_MESSAGE_HANDLER_BUILDING_LIBRARY") 39 | 40 | install( 41 | DIRECTORY include/ 42 | DESTINATION include/${PROJECT_NAME} 43 | ) 44 | install( 45 | TARGETS kuka_kss_message_handler 46 | EXPORT export_${PROJECT_NAME} 47 | ARCHIVE DESTINATION lib 48 | LIBRARY DESTINATION lib 49 | RUNTIME DESTINATION bin 50 | ) 51 | 52 | if(BUILD_TESTING) 53 | 54 | endif() 55 | 56 | ament_export_include_directories( 57 | "include/${PROJECT_NAME}" 58 | ) 59 | ament_export_libraries( 60 | kuka_kss_message_handler 61 | ) 62 | ament_export_targets( 63 | export_${PROJECT_NAME} 64 | ) 65 | pluginlib_export_plugin_description_file(controller_interface kuka_kss_message_handler.xml) 66 | ament_package() 67 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(kuka_iiqka_eac_driver) 3 | 4 | # Default to C99 5 | if(NOT CMAKE_C_STANDARD) 6 | set(CMAKE_C_STANDARD 99) 7 | endif() 8 | 9 | if(NOT CMAKE_CXX_STANDARD) 10 | set(CMAKE_CXX_STANDARD 17) 11 | endif() 12 | 13 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 14 | add_compile_options(-Wall -Wextra -Wpedantic) 15 | endif() 16 | 17 | list(APPEND CMAKE_PREFIX_PATH "~/.local/lib/cmake") 18 | 19 | find_package(ament_cmake REQUIRED) 20 | find_package(kuka_drivers_core REQUIRED) 21 | find_package(hardware_interface REQUIRED) 22 | find_package(pluginlib REQUIRED) 23 | find_package(std_msgs REQUIRED) 24 | find_package(controller_manager_msgs REQUIRED) 25 | find_package(kuka-external-control-sdk CONFIG REQUIRED) 26 | include_directories(include) 27 | 28 | 29 | add_library(${PROJECT_NAME} SHARED 30 | src/hardware_interface.cpp 31 | ) 32 | 33 | # Causes the visibility macros to use dllexport rather than dllimport, 34 | # which is appropriate when building the dll but not consuming it. 35 | target_compile_definitions(${PROJECT_NAME} PRIVATE "KUKA_IIQKA_EAC_DRIVER_BUILDING_LIBRARY") 36 | 37 | ament_target_dependencies(${PROJECT_NAME} hardware_interface kuka_drivers_core kuka-external-control-sdk) 38 | target_link_libraries(${PROJECT_NAME} Kuka::kuka-external-control-sdk) 39 | 40 | 41 | add_executable(robot_manager_node 42 | src/robot_manager_node.cpp) 43 | ament_target_dependencies(robot_manager_node std_msgs kuka_drivers_core controller_manager_msgs) 44 | target_link_libraries(robot_manager_node kuka_drivers_core::communication_helpers Kuka::kuka-external-control-sdk) 45 | 46 | pluginlib_export_plugin_description_file(hardware_interface hardware_interface.xml) 47 | 48 | install(TARGETS ${PROJECT_NAME} robot_manager_node 49 | DESTINATION lib/${PROJECT_NAME}) 50 | 51 | install(DIRECTORY config launch test 52 | DESTINATION share/${PROJECT_NAME}) 53 | 54 | if(BUILD_TESTING) 55 | find_package(launch_testing_ament_cmake) 56 | add_launch_test(test/test_driver_startup.py) 57 | add_launch_test(test/test_driver_activation.py) 58 | add_launch_test(test/test_multi_robot_startup.py) 59 | endif() 60 | 61 | ament_export_libraries( 62 | ${PROJECT_NAME} 63 | ) 64 | ament_package() 65 | -------------------------------------------------------------------------------- /kuka_rsi_driver/include/kuka_rsi_driver/hardware_interface_rsi_only.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_RSI_DRIVER__HARDWARE_INTERFACE_RSI_ONLY_HPP_ 16 | #define KUKA_RSI_DRIVER__HARDWARE_INTERFACE_RSI_ONLY_HPP_ 17 | 18 | #include 19 | #include 20 | 21 | #include "hardware_interface_rsi_base.hpp" 22 | #include "rclcpp/macros.hpp" 23 | #include "rclcpp/rclcpp.hpp" 24 | #include "rclcpp_lifecycle/state.hpp" 25 | 26 | #include "kuka/external-control-sdk/kss/robot.h" 27 | #include "kuka_drivers_core/control_mode.hpp" 28 | #include "kuka_rsi_driver/visibility_control.h" 29 | 30 | using hardware_interface::return_type; 31 | using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn; 32 | 33 | namespace kuka_rsi_driver 34 | { 35 | 36 | class KukaRSIHardwareInterface : public kuka_rsi_driver::KukaRSIHardwareInterfaceBase 37 | { 38 | public: 39 | RCLCPP_SHARED_PTR_DEFINITIONS(KukaRSIHardwareInterface) 40 | 41 | KUKA_RSI_DRIVER_PUBLIC KukaRSIHardwareInterface() 42 | : KukaRSIHardwareInterfaceBase("KukaMxaRsiHardwareInterface") 43 | { 44 | } 45 | 46 | KUKA_RSI_DRIVER_PUBLIC CallbackReturn on_configure(const rclcpp_lifecycle::State &) override; 47 | 48 | KUKA_RSI_DRIVER_PUBLIC CallbackReturn on_activate(const rclcpp_lifecycle::State &) override; 49 | 50 | KUKA_RSI_DRIVER_PUBLIC CallbackReturn on_deactivate(const rclcpp_lifecycle::State &) override; 51 | 52 | private: 53 | KUKA_RSI_DRIVER_LOCAL void CreateRobotInstance( 54 | const kuka::external::control::kss::Configuration &) override; 55 | }; 56 | } // namespace kuka_rsi_driver 57 | 58 | #endif // KUKA_RSI_DRIVER__HARDWARE_INTERFACE_RSI_ONLY_HPP_ 59 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/include/kuka_sunrise_fri_driver/tcp_connection.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Zoltán Rési 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_SUNRISE_FRI_DRIVER__TCP_CONNECTION_HPP_ 16 | #define KUKA_SUNRISE_FRI_DRIVER__TCP_CONNECTION_HPP_ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace kuka_sunrise_fri_driver 31 | { 32 | 33 | class TCPConnection 34 | { 35 | public: 36 | TCPConnection( 37 | const char * server_addr, const int server_port, 38 | std::function &)> data_received_callback, 39 | std::function connection_lost_callback); 40 | 41 | bool sendByte(std::uint8_t data); 42 | bool sendBytes(const std::vector & data); 43 | void closeConnection(); 44 | 45 | ~TCPConnection(); 46 | TCPConnection(const TCPConnection &) = delete; 47 | TCPConnection & operator=(const TCPConnection &) = delete; 48 | TCPConnection & operator=(TCPConnection && from); 49 | 50 | private: 51 | static void * listen_helper(void * tcpConnection); 52 | void listen(); 53 | std::function &)> dataReceivedCallback_; 54 | std::function connectionLostCallback_; 55 | 56 | int socket_desc_; 57 | struct sockaddr_in server_; 58 | pthread_t read_thread_; 59 | std::atomic_bool cancelled_; 60 | }; 61 | 62 | } // namespace kuka_sunrise_fri_driver 63 | 64 | #endif // KUKA_SUNRISE_FRI_DRIVER__TCP_CONNECTION_HPP_ 65 | -------------------------------------------------------------------------------- /.github/workflows/industrial_ci_jazzy.yml: -------------------------------------------------------------------------------- 1 | name: ROS-Industrial CI jazzy 2 | run-name: ROS-Industrial CI - ${{ github.event_name }} 3 | 4 | # This determines when this workflow is run 5 | # on: [push, pull_request] # on all pushes and PRs 6 | 7 | # or more fine-grained 8 | on: 9 | push: 10 | branches: 11 | - master 12 | - feature/** 13 | - fix/** 14 | paths-ignore: 15 | - doc/** 16 | - '**.md' 17 | - LICENSE 18 | - .github/workflows/deploy_wiki.yml 19 | # When there is a pull request against master 20 | pull_request: 21 | branches: 22 | - master 23 | 24 | schedule: 25 | # Run every Monday at 1PM UTC 26 | - cron: 0 13 * * 1 27 | 28 | jobs: 29 | industrial_ci: 30 | name: ROS-Industrial CI jazzy 31 | env: 32 | ROS_REPO: ros 33 | BUILDER: colcon 34 | ANALYZER: sonarqube 35 | TEST_COVERAGE: true 36 | UPSTREAM_WORKSPACE: 'github:kroshu/kuka_robot_descriptions#master github:kroshu/kuka-external-control-sdk#master' 37 | ROS_DISTRO: jazzy 38 | CCACHE_DIR: /github/home/.ccache # Directory for ccache (and how we enable ccache in industrial_ci) 39 | EVENT_NAME: ${{ github.event_name }} 40 | BRANCH: ${{ github.event.ref }} 41 | PR_BRANCH: ${{ github.event.pull_request.head.ref }} 42 | PR_BASE: ${{ github.event.pull_request.base.ref }} 43 | PR_NUMBER: ${{ github.event.number }} 44 | ANALYZER_TOKEN: ${{ secrets.ANALYZER_TOKEN }} 45 | DEBUG_BASH: true 46 | runs-on: ubuntu-24.04 47 | steps: 48 | - name: Reset ANALYZER for scheduled and push runs 49 | run: | 50 | if [[ "${{ github.event_name }}" == "schedule" ]] || { [[ "${{ github.event_name }}" == "push" ]] && [[ "${{ github.ref }}" != "refs/heads/master" ]]; }; then 51 | echo "ANALYZER=" >> $GITHUB_ENV 52 | fi 53 | - uses: actions/checkout@v2 54 | with: 55 | fetch-depth: 0 56 | # This step will fetch/store the directory used by ccache before/after the ci run 57 | - uses: actions/cache@v4 58 | with: 59 | path: ${{ env.CCACHE_DIR }} 60 | key: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} 61 | 62 | # Run industrial_ci 63 | - uses: 'kroshu/industrial_ci@master' 64 | -------------------------------------------------------------------------------- /kuka_rsi_driver/src/robot_manager_node_rsi_only.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "communication_helpers/ros2_control_tools.hpp" 16 | #include "communication_helpers/service_tools.hpp" 17 | 18 | #include "kuka_drivers_core/controller_names.hpp" 19 | #include "kuka_drivers_core/hardware_event.hpp" 20 | #include "kuka_rsi_driver/robot_manager_node_rsi_only.hpp" 21 | 22 | using namespace controller_manager_msgs::srv; // NOLINT 23 | using namespace lifecycle_msgs::msg; // NOLINT 24 | 25 | namespace kuka_rsi_driver 26 | { 27 | rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn 28 | RobotManagerNodeRsi::on_configure(const rclcpp_lifecycle::State &) 29 | { 30 | std::vector controllers_to_activate{kuka_drivers_core::EVENT_BROADCASTER}; 31 | 32 | return RobotManagerBase::configure_driver(controllers_to_activate); 33 | } 34 | 35 | rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn 36 | RobotManagerNodeRsi::on_cleanup(const rclcpp_lifecycle::State &) 37 | { 38 | // Deactivate event broadcaster 39 | std::vector controllers_to_deactivate{kuka_drivers_core::EVENT_BROADCASTER}; 40 | 41 | return RobotManagerBase::cleanup_driver(controllers_to_deactivate); 42 | } 43 | 44 | } // namespace kuka_rsi_driver 45 | 46 | int main(int argc, char * argv[]) 47 | { 48 | setvbuf(stdout, nullptr, _IONBF, BUFSIZ); 49 | 50 | rclcpp::init(argc, argv); 51 | rclcpp::executors::MultiThreadedExecutor executor; 52 | auto node = std::make_shared(); 53 | executor.add_node(node->get_node_base_interface()); 54 | executor.spin(); 55 | rclcpp::shutdown(); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /controllers/kuka_control_mode_handler/include/kuka_control_mode_handler/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_CONTROL_MODE_HANDLER__VISIBILITY_CONTROL_H_ 16 | #define KUKA_CONTROL_MODE_HANDLER__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define KUKA_CONTROL_MODE_HANDLER_EXPORT __attribute__((dllexport)) 24 | #define KUKA_CONTROL_MODE_HANDLER_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define KUKA_CONTROL_MODE_HANDLER_EXPORT __declspec(dllexport) 27 | #define KUKA_CONTROL_MODE_HANDLER_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef KUKA_CONTROL_MODE_HANDLER_BUILDING_LIBRARY 30 | #define KUKA_CONTROL_MODE_HANDLER_PUBLIC KUKA_CONTROL_MODE_HANDLER_EXPORT 31 | #else 32 | #define KUKA_CONTROL_MODE_HANDLER_PUBLIC KUKA_CONTROL_MODE_HANDLER_IMPORT 33 | #endif 34 | #define KUKA_CONTROL_MODE_HANDLER_PUBLIC_TYPE KUKA_CONTROL_MODE_HANDLER_PUBLIC 35 | #define KUKA_CONTROL_MODE_HANDLER_LOCAL 36 | #else 37 | #define KUKA_CONTROL_MODE_HANDLER_EXPORT __attribute__((visibility("default"))) 38 | #define KUKA_CONTROL_MODE_HANDLER_IMPORT 39 | #if __GNUC__ >= 4 40 | #define KUKA_CONTROL_MODE_HANDLER_PUBLIC __attribute__((visibility("default"))) 41 | #define KUKA_CONTROL_MODE_HANDLER_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define KUKA_CONTROL_MODE_HANDLER_PUBLIC 44 | #define KUKA_CONTROL_MODE_HANDLER_LOCAL 45 | #endif 46 | #define KUKA_CONTROL_MODE_HANDLER_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // KUKA_CONTROL_MODE_HANDLER__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /kuka_drivers_core/include/kuka_drivers_core/ros2_base_node.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Gergely Kovács 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_DRIVERS_CORE__ROS2_BASE_NODE_HPP_ 16 | #define KUKA_DRIVERS_CORE__ROS2_BASE_NODE_HPP_ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "lifecycle_msgs/msg/state.hpp" 25 | #include "rclcpp/node.hpp" 26 | 27 | #include "kuka_drivers_core/parameter_handler.hpp" 28 | 29 | namespace kuka_drivers_core 30 | { 31 | class ROS2BaseNode : public rclcpp::Node 32 | { 33 | public: 34 | explicit ROS2BaseNode( 35 | const std::string & node_name, const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); 36 | 37 | const ParameterHandler & getParameterHandler() const; 38 | template 39 | void registerParameter( 40 | const std::string & name, const T & value, std::function on_change_callback) 41 | { 42 | param_handler_.registerParameter( 43 | name, value, on_change_callback, this->get_node_parameters_interface()); 44 | } 45 | 46 | template 47 | void registerStaticParameter( 48 | const std::string & name, const T & value, std::function on_change_callback) 49 | { 50 | param_handler_.registerParameter( 51 | name, value, on_change_callback, this->get_node_parameters_interface(), true); 52 | } 53 | 54 | protected: 55 | rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr ParamCallback() const; 56 | 57 | private: 58 | ParameterHandler param_handler_; 59 | rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr param_callback_; 60 | }; 61 | } // namespace kuka_drivers_core 62 | 63 | #endif // KUKA_DRIVERS_CORE__ROS2_BASE_NODE_HPP_ 64 | -------------------------------------------------------------------------------- /controllers/fri_configuration_controller/include/fri_configuration_controller/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef FRI_CONFIGURATION_CONTROLLER__VISIBILITY_CONTROL_H_ 16 | #define FRI_CONFIGURATION_CONTROLLER__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define FRI_CONFIGURATION_CONTROLLER_EXPORT __attribute__((dllexport)) 24 | #define FRI_CONFIGURATION_CONTROLLER_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define FRI_CONFIGURATION_CONTROLLER_EXPORT __declspec(dllexport) 27 | #define FRI_CONFIGURATION_CONTROLLER_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef FRI_CONFIGURATION_CONTROLLER_BUILDING_LIBRARY 30 | #define FRI_CONFIGURATION_CONTROLLER_PUBLIC FRI_CONFIGURATION_CONTROLLER_EXPORT 31 | #else 32 | #define FRI_CONFIGURATION_CONTROLLER_PUBLIC FRI_CONFIGURATION_CONTROLLER_IMPORT 33 | #endif 34 | #define FRI_CONFIGURATION_CONTROLLER_PUBLIC_TYPE FRI_CONFIGURATION_CONTROLLER_PUBLIC 35 | #define FRI_CONFIGURATION_CONTROLLER_LOCAL 36 | #else 37 | #define FRI_CONFIGURATION_CONTROLLER_EXPORT __attribute__((visibility("default"))) 38 | #define FRI_CONFIGURATION_CONTROLLER_IMPORT 39 | #if __GNUC__ >= 4 40 | #define FRI_CONFIGURATION_CONTROLLER_PUBLIC __attribute__((visibility("default"))) 41 | #define FRI_CONFIGURATION_CONTROLLER_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define FRI_CONFIGURATION_CONTROLLER_PUBLIC 44 | #define FRI_CONFIGURATION_CONTROLLER_LOCAL 45 | #endif 46 | #define FRI_CONFIGURATION_CONTROLLER_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // FRI_CONFIGURATION_CONTROLLER__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/config/gpio_config.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 0 7 | 8 | 9 | 0 10 | 11 | 12 | 0 13 | 14 | 15 | 0 16 | 17 | 18 | 0 19 | 20 | 21 | 0 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/test/test_driver_startup.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 KUKA Hungaria Kft. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import unittest 16 | 17 | import launch 18 | import launch.actions 19 | import launch_testing.actions 20 | import launch_testing.markers 21 | import pytest 22 | 23 | from launch.launch_description_sources.python_launch_description_source import ( 24 | PythonLaunchDescriptionSource, 25 | ) 26 | from launch.actions.include_launch_description import IncludeLaunchDescription 27 | from ament_index_python.packages import get_package_share_directory 28 | 29 | 30 | # Launch driver startup 31 | @pytest.mark.launch_test 32 | @launch_testing.markers.keep_alive 33 | def generate_test_description(): 34 | return launch.LaunchDescription( 35 | [ 36 | IncludeLaunchDescription( 37 | PythonLaunchDescriptionSource( 38 | [ 39 | get_package_share_directory("kuka_iiqka_eac_driver"), 40 | "/launch/", 41 | "startup.launch.py", 42 | ] 43 | ), 44 | launch_arguments={ 45 | "cm_log_level": "INFO", 46 | }.items(), 47 | ), 48 | launch_testing.actions.ReadyToTest(), 49 | ] 50 | ) 51 | 52 | 53 | class TestDriverStartup(unittest.TestCase): 54 | def test_read_stdout(self, proc_output): 55 | # Check for successful initialization 56 | proc_output.assertWaitFor("Robot initialized", timeout=5) 57 | proc_output.assertWaitFor( 58 | "Successful initialization of hardware 'lbr_iisy3_r760'", timeout=5 59 | ) 60 | # Check whether disabling automatic activation was successful 61 | proc_output.assertWaitFor( 62 | "Setting component 'lbr_iisy3_r760' to 'unconfigured' state.", timeout=5 63 | ) 64 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/robot_application/src/application/ROS2_Control.java: -------------------------------------------------------------------------------- 1 | package application; 2 | 3 | import javax.inject.Inject; 4 | 5 | import ros2.modules.FRIManager; 6 | import ros2.modules.ROS2Connection; 7 | import ros2.modules.TCPConnection; 8 | 9 | import com.kuka.roboticsAPI.applicationModel.RoboticsAPIApplication; 10 | import com.kuka.roboticsAPI.deviceModel.LBR; 11 | 12 | /** 13 | * Implementation of a robot application. 14 | *

15 | * The application provides a {@link RoboticsAPITask#initialize()} and a 16 | * {@link RoboticsAPITask#run()} method, which will be called successively in 17 | * the application lifecycle. The application will terminate automatically after 18 | * the {@link RoboticsAPITask#run()} method has finished or after stopping the 19 | * task. The {@link RoboticsAPITask#dispose()} method will be called, even if an 20 | * exception is thrown during initialization or run. 21 | *

22 | * It is imperative to call super.dispose() when overriding the 23 | * {@link RoboticsAPITask#dispose()} method. 24 | * 25 | * @see UseRoboticsAPIContext 26 | * @see #initialize() 27 | * @see #run() 28 | * @see #dispose() 29 | */ 30 | public class ROS2_Control extends RoboticsAPIApplication { 31 | @Inject 32 | private LBR _lbr; 33 | 34 | private TCPConnection _TCPConnection; 35 | private ROS2Connection _ROS2Connection; 36 | private FRIManager _FRIManager; 37 | 38 | @Override 39 | public void initialize() { 40 | // initialize your application here 41 | _TCPConnection = new TCPConnection(30000); 42 | _ROS2Connection = new ROS2Connection(); 43 | _FRIManager = new FRIManager(_lbr, getApplicationControl()); 44 | 45 | _FRIManager.registerROS2ConnectionModule(_ROS2Connection); 46 | _TCPConnection.registerROS2ConnectionModule(_ROS2Connection); 47 | _ROS2Connection.registerTCPConnectionModule(_TCPConnection); 48 | _ROS2Connection.registerFRIManagerModule(_FRIManager); 49 | } 50 | 51 | @Override 52 | public void run() { 53 | // your application execution starts here 54 | _ROS2Connection.acceptCommands(); 55 | _TCPConnection.openConnection(); 56 | _TCPConnection.waitUntilDisconnected(); 57 | _ROS2Connection.rejectCommands(); 58 | _FRIManager.close(); 59 | } 60 | 61 | @Override 62 | public void dispose() { 63 | getLogger().info("disposes"); 64 | _TCPConnection.closeConnection(); 65 | _FRIManager.close(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /controllers/joint_group_impedance_controller/include/joint_group_impedance_controller/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef JOINT_GROUP_IMPEDANCE_CONTROLLER__VISIBILITY_CONTROL_H_ 16 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_EXPORT __attribute__((dllexport)) 24 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_EXPORT __declspec(dllexport) 27 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef JOINT_GROUP_IMPEDANCE_CONTROLLER_BUILDING_LIBRARY 30 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_PUBLIC JOINT_GROUP_IMPEDANCE_CONTROLLER_EXPORT 31 | #else 32 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_PUBLIC JOINT_GROUP_IMPEDANCE_CONTROLLER_IMPORT 33 | #endif 34 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_PUBLIC_TYPE JOINT_GROUP_IMPEDANCE_CONTROLLER_PUBLIC 35 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_LOCAL 36 | #else 37 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_EXPORT __attribute__((visibility("default"))) 38 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_IMPORT 39 | #if __GNUC__ >= 4 40 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_PUBLIC __attribute__((visibility("default"))) 41 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_PUBLIC 44 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_LOCAL 45 | #endif 46 | #define JOINT_GROUP_IMPEDANCE_CONTROLLER_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // JOINT_GROUP_IMPEDANCE_CONTROLLER__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/robot_application/src/ros2/serialization/FRIConfigurationParams.java: -------------------------------------------------------------------------------- 1 | package ros2.serialization; 2 | 3 | import java.io.Externalizable; 4 | import java.io.IOException; 5 | import java.io.ObjectInput; 6 | import java.io.ObjectOutput; 7 | import com.kuka.connectivity.fastRobotInterface.FRIConfiguration; 8 | import com.kuka.roboticsAPI.deviceModel.Device; 9 | 10 | public class FRIConfigurationParams implements Externalizable { 11 | 12 | public static final int length = 16; // 4 integers 13 | 14 | 15 | private String _remoteIP; 16 | private int _remotePort; 17 | private int _sendPeriodMilliSec; 18 | private int _receiveMultiplier; 19 | 20 | @Override 21 | public void writeExternal(ObjectOutput out) throws IOException { 22 | out.writeBytes(_remoteIP); 23 | out.writeInt(_remotePort); 24 | out.writeInt(_sendPeriodMilliSec); 25 | out.writeInt(_receiveMultiplier); 26 | } 27 | 28 | @Override 29 | public void readExternal(ObjectInput in) throws IOException, 30 | ClassNotFoundException { 31 | _remotePort = in.readInt(); 32 | _sendPeriodMilliSec = in.readInt(); 33 | _receiveMultiplier = in.readInt(); 34 | _remoteIP = "192.168.38.6"; 35 | 36 | int ip = in.readInt(); 37 | _remoteIP = String.format("%d.%d.%d.%d", (ip & 0xff),(ip >> 8 & 0xff), (ip >> 16 & 0xff), (ip >> 24 & 0xff)); 38 | 39 | System.out.println("FRI configuration: client IP: " + _remoteIP + ":" + _remotePort + ", send_period [ms]: " + _sendPeriodMilliSec + ", receive multiplier: " + _receiveMultiplier); 40 | } 41 | 42 | public FRIConfigurationParams() { 43 | _remoteIP = "0.0.0.0"; 44 | _remotePort = 30200; 45 | _sendPeriodMilliSec = 10; 46 | _receiveMultiplier = 1; 47 | } 48 | 49 | public FRIConfigurationParams(FRIConfiguration friConfiguration){ 50 | _remoteIP = friConfiguration.getHostName(); 51 | _remotePort = friConfiguration.getPortOnRemote(); 52 | _sendPeriodMilliSec = friConfiguration.getSendPeriodMilliSec(); 53 | _receiveMultiplier = friConfiguration.getReceiveMultiplier(); 54 | } 55 | 56 | public FRIConfiguration toFRIConfiguration(Device device){ 57 | FRIConfiguration friConfiguration = FRIConfiguration.createRemoteConfiguration(device, _remoteIP); 58 | friConfiguration.setPortOnRemote(_remotePort); 59 | friConfiguration.setSendPeriodMilliSec(_sendPeriodMilliSec); 60 | friConfiguration.setReceiveMultiplier(_receiveMultiplier); 61 | return friConfiguration; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /examples/iiqka_moveit_example/src/moveit_collision_avoidance_example.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 Áron Svastits 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | 18 | #include "iiqka_moveit_example/moveit_example.hpp" 19 | 20 | int main(int argc, char * argv[]) 21 | { 22 | // Setup 23 | // Initialize ROS and create the Node 24 | rclcpp::init(argc, argv); 25 | auto const example_node = std::make_shared(); 26 | rclcpp::executors::SingleThreadedExecutor executor; 27 | executor.add_node(example_node); 28 | std::thread([&executor]() { executor.spin(); }).detach(); 29 | 30 | example_node->initialize(); 31 | 32 | // Add robot platform 33 | example_node->addRobotPlatform(); 34 | 35 | // Go to correct position for the example 36 | auto init_trajectory = example_node->planToPosition( 37 | std::vector{0.3587, 0.3055, -1.3867, 0.0, -0.4896, -0.3587}); 38 | if (init_trajectory != nullptr) 39 | { 40 | example_node->moveGroupInterface()->execute(*init_trajectory); 41 | } 42 | 43 | // Add collision object 44 | example_node->addCollisionBox( 45 | geometry_msgs::build().x(0.125).y(0.15).z(0.5), 46 | geometry_msgs::build().x(0.1).y(1.0).z(0.1)); 47 | example_node->addBreakPoint(); 48 | 49 | auto standing_pose = 50 | Eigen::Isometry3d(Eigen::Translation3d(0.1, 0, 0.8) * Eigen::Quaterniond::Identity()); 51 | 52 | // Plan with collision avoidance 53 | auto planned_trajectory = 54 | example_node->planToPoint(standing_pose, "ompl", "RRTConnectkConfigDefault"); 55 | if (planned_trajectory != nullptr) 56 | { 57 | example_node->drawTrajectory(*planned_trajectory); 58 | example_node->addBreakPoint(); 59 | example_node->moveGroupInterface()->execute(*planned_trajectory); 60 | } 61 | 62 | // Shutdown ROS 63 | rclcpp::shutdown(); 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /.github/workflows/industrial_ci_humble.yml: -------------------------------------------------------------------------------- 1 | name: ROS-Industrial CI humble 2 | run-name: ROS-Industrial CI - ${{ github.event_name }} 3 | 4 | # This determines when this workflow is run 5 | # on: [push, pull_request] # on all pushes and PRs 6 | 7 | # or more fine-grained 8 | on: 9 | push: 10 | branches: 11 | - humble 12 | paths-ignore: 13 | - doc/** 14 | - '**.md' 15 | - LICENSE 16 | - .github/workflows/deploy_wiki.yml 17 | pull_request: 18 | branches: 19 | - humble 20 | 21 | schedule: 22 | # Run every Monday at 1PM UTC 23 | - cron: 0 13 * * 1 24 | 25 | jobs: 26 | industrial_ci: 27 | name: ROS-Industrial CI humble 28 | env: 29 | ROS_REPO: ros 30 | BUILDER: colcon 31 | ANALYZER: sonarqube 32 | TEST_COVERAGE: true 33 | UPSTREAM_WORKSPACE: 'github:kroshu/kuka_robot_descriptions#humble github:kroshu/kuka-external-control-sdk#master' 34 | ROS_DISTRO: humble 35 | CCACHE_DIR: /github/home/.ccache # Directory for ccache (and how we enable ccache in industrial_ci) 36 | EVENT_NAME: ${{ github.event_name }} 37 | BRANCH: ${{ github.event.ref }} 38 | PR_BRANCH: ${{ github.event.pull_request.head.ref }} 39 | PR_BASE: ${{ github.event.pull_request.base.ref }} 40 | PR_NUMBER: ${{ github.event.number }} 41 | ANALYZER_TOKEN: ${{ secrets.ANALYZER_TOKEN }} 42 | DEBUG_BASH: true 43 | runs-on: ubuntu-latest 44 | steps: 45 | - name: Reset ANALYZER for scheduled and push runs 46 | run: | 47 | if [[ "${{ github.event_name }}" == "schedule" ]] || { [[ "${{ github.event_name }}" == "push" ]] && [[ "${{ github.ref }}" != "refs/heads/humble" ]]; }; then 48 | echo "ANALYZER=" >> $GITHUB_ENV 49 | fi 50 | - name: Checkout code 51 | if: github.event.schedule != '' 52 | uses: actions/checkout@v2 53 | with: 54 | fetch-depth: 0 55 | ref: humble 56 | - name: Checkout humble branch for scheduled runs 57 | if: github.event.schedule == '' 58 | uses: actions/checkout@v2 59 | with: 60 | fetch-depth: 0 61 | 62 | # This step will fetch/store the directory used by ccache before/after the ci run 63 | - uses: actions/cache@v4 64 | with: 65 | path: ${{ env.CCACHE_DIR }} 66 | key: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} 67 | 68 | # Run industrial_ci 69 | - uses: 'kroshu/industrial_ci@master' 70 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/test/test_driver_startup.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 KUKA Hungaria Kft. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import unittest 16 | 17 | import launch 18 | import launch.actions 19 | import launch_testing.actions 20 | import launch_testing.markers 21 | import pytest 22 | 23 | from launch.launch_description_sources.python_launch_description_source import ( 24 | PythonLaunchDescriptionSource, 25 | ) 26 | from launch.actions.include_launch_description import IncludeLaunchDescription 27 | from ament_index_python.packages import get_package_share_directory 28 | 29 | 30 | # Launch all of the robot visualisation launch files one by one 31 | @pytest.mark.launch_test 32 | @launch_testing.markers.keep_alive 33 | def generate_test_description(): 34 | return launch.LaunchDescription( 35 | [ 36 | IncludeLaunchDescription( 37 | PythonLaunchDescriptionSource( 38 | [ 39 | get_package_share_directory("kuka_sunrise_fri_driver"), 40 | "/launch/", 41 | "startup.launch.py", 42 | ] 43 | ), 44 | launch_arguments={ 45 | "cm_log_level": "INFO", 46 | }.items(), 47 | ), 48 | launch_testing.actions.ReadyToTest(), 49 | ] 50 | ) 51 | 52 | 53 | class TestDriverStartup(unittest.TestCase): 54 | def test_read_stdout(self, proc_output): 55 | # Check for successful initialization 56 | proc_output.assertWaitFor("Robot initialized", timeout=5) 57 | proc_output.assertWaitFor( 58 | "Successful initialization of hardware 'lbr_iiwa14_r820'", timeout=5 59 | ) 60 | # Check whether disabling automatic activation was successful 61 | proc_output.assertWaitFor( 62 | "Setting component 'lbr_iiwa14_r820' to 'unconfigured' state.", timeout=5 63 | ) 64 | -------------------------------------------------------------------------------- /kuka_rsi_driver/test/test_driver_startup_eki_rsi.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 KUKA Hungaria Kft. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import unittest 16 | 17 | import launch 18 | import launch_testing.actions 19 | import launch_testing.markers 20 | import pytest 21 | from ament_index_python.packages import get_package_share_directory 22 | from launch.actions.include_launch_description import IncludeLaunchDescription 23 | from launch.launch_description_sources.python_launch_description_source import ( 24 | PythonLaunchDescriptionSource, 25 | ) 26 | 27 | 28 | # Launch all of the robot visualisation launch files one by one 29 | @pytest.mark.launch_test 30 | @launch_testing.markers.keep_alive 31 | def generate_test_description(): 32 | return launch.LaunchDescription( 33 | [ 34 | IncludeLaunchDescription( 35 | PythonLaunchDescriptionSource( 36 | [ 37 | get_package_share_directory("kuka_rsi_driver"), 38 | "/launch/", 39 | "startup.launch.py", 40 | ] 41 | ), 42 | launch_arguments={ 43 | "driver_version": "eki_rsi", 44 | "cm_log_level": "INFO", 45 | }.items(), 46 | ), 47 | launch_testing.actions.ReadyToTest(), 48 | ] 49 | ) 50 | 51 | 52 | class TestDriverStartup(unittest.TestCase): 53 | def test_read_stdout(self, proc_output): 54 | # Check for successful initialization 55 | proc_output.assertWaitFor("Robot initialized", timeout=5) 56 | proc_output.assertWaitFor( 57 | "Successful initialization of hardware 'kr6_r700_sixx'", timeout=5 58 | ) 59 | # Check whether disabling automatic activation was successful 60 | proc_output.assertWaitFor( 61 | "Setting component 'kr6_r700_sixx' to 'unconfigured' state.", timeout=5 62 | ) 63 | -------------------------------------------------------------------------------- /kuka_rsi_driver/test/test_driver_startup_mxa_rsi.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 KUKA Hungaria Kft. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import unittest 16 | 17 | import launch 18 | import launch_testing.actions 19 | import launch_testing.markers 20 | import pytest 21 | from ament_index_python.packages import get_package_share_directory 22 | from launch.actions.include_launch_description import IncludeLaunchDescription 23 | from launch.launch_description_sources.python_launch_description_source import ( 24 | PythonLaunchDescriptionSource, 25 | ) 26 | 27 | 28 | # Launch all of the robot visualisation launch files one by one 29 | @pytest.mark.launch_test 30 | @launch_testing.markers.keep_alive 31 | def generate_test_description(): 32 | return launch.LaunchDescription( 33 | [ 34 | IncludeLaunchDescription( 35 | PythonLaunchDescriptionSource( 36 | [ 37 | get_package_share_directory("kuka_rsi_driver"), 38 | "/launch/", 39 | "startup.launch.py", 40 | ] 41 | ), 42 | launch_arguments={ 43 | "driver_version": "mxa_rsi", 44 | "cm_log_level": "INFO", 45 | }.items(), 46 | ), 47 | launch_testing.actions.ReadyToTest(), 48 | ] 49 | ) 50 | 51 | 52 | class TestDriverStartup(unittest.TestCase): 53 | def test_read_stdout(self, proc_output): 54 | # Check for successful initialization 55 | proc_output.assertWaitFor("Robot initialized", timeout=5) 56 | proc_output.assertWaitFor( 57 | "Successful initialization of hardware 'kr6_r700_sixx'", timeout=5 58 | ) 59 | # Check whether disabling automatic activation was successful 60 | proc_output.assertWaitFor( 61 | "Setting component 'kr6_r700_sixx' to 'unconfigured' state.", timeout=5 62 | ) 63 | -------------------------------------------------------------------------------- /kuka_rsi_driver/test/test_driver_startup_rsi_only.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 KUKA Hungaria Kft. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import unittest 16 | 17 | import launch 18 | import launch_testing.actions 19 | import launch_testing.markers 20 | import pytest 21 | from ament_index_python.packages import get_package_share_directory 22 | from launch.actions.include_launch_description import IncludeLaunchDescription 23 | from launch.launch_description_sources.python_launch_description_source import ( 24 | PythonLaunchDescriptionSource, 25 | ) 26 | 27 | 28 | # Launch all of the robot visualisation launch files one by one 29 | @pytest.mark.launch_test 30 | @launch_testing.markers.keep_alive 31 | def generate_test_description(): 32 | return launch.LaunchDescription( 33 | [ 34 | IncludeLaunchDescription( 35 | PythonLaunchDescriptionSource( 36 | [ 37 | get_package_share_directory("kuka_rsi_driver"), 38 | "/launch/", 39 | "startup.launch.py", 40 | ] 41 | ), 42 | launch_arguments={ 43 | "driver_version": "rsi_only", 44 | "cm_log_level": "INFO", 45 | }.items(), 46 | ), 47 | launch_testing.actions.ReadyToTest(), 48 | ] 49 | ) 50 | 51 | 52 | class TestDriverStartup(unittest.TestCase): 53 | def test_read_stdout(self, proc_output): 54 | # Check for successful initialization 55 | proc_output.assertWaitFor("Robot initialized", timeout=5) 56 | proc_output.assertWaitFor( 57 | "Successful initialization of hardware 'kr6_r700_sixx'", timeout=5 58 | ) 59 | # Check whether disabling automatic activation was successful 60 | proc_output.assertWaitFor( 61 | "Setting component 'kr6_r700_sixx' to 'unconfigured' state.", timeout=5 62 | ) 63 | -------------------------------------------------------------------------------- /kuka_drivers_core/include/communication_helpers/service_tools.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Zoltán Rési 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef COMMUNICATION_HELPERS__SERVICE_TOOLS_HPP_ 16 | #define COMMUNICATION_HELPERS__SERVICE_TOOLS_HPP_ 17 | 18 | #include 19 | #include 20 | 21 | #include "rclcpp/rclcpp.hpp" 22 | 23 | namespace kuka_drivers_core 24 | { 25 | template 26 | std::future_status wait_for_result(FutureT & future, WaitTimeT time_to_wait) 27 | { 28 | auto end = std::chrono::steady_clock::now() + time_to_wait; 29 | std::chrono::milliseconds wait_period(100); 30 | std::future_status status = std::future_status::timeout; 31 | do 32 | { 33 | auto now = std::chrono::steady_clock::now(); 34 | auto time_left = end - now; 35 | if (time_left <= std::chrono::seconds(0)) 36 | { 37 | break; 38 | } 39 | status = future.wait_for((time_left < wait_period) ? time_left : wait_period); 40 | } while (rclcpp::ok() && status != std::future_status::ready); 41 | return status; 42 | } 43 | 44 | template 45 | std::shared_ptr sendRequest( 46 | ClientT client, RequestT request, const uint32_t & service_timeout_ms = 2000, 47 | const uint32_t & response_timeout_ms = 100) 48 | { 49 | if ( 50 | service_timeout_ms && !client->wait_for_service(std::chrono::milliseconds(service_timeout_ms))) 51 | { 52 | printf("Wait for service failed\n"); 53 | return nullptr; 54 | } 55 | auto future_result = client->async_send_request(request); 56 | auto future_status = 57 | wait_for_result(future_result, std::chrono::milliseconds(response_timeout_ms)); 58 | if (future_status != std::future_status::ready) 59 | { 60 | printf("Request timed out\n"); 61 | return nullptr; 62 | } 63 | return future_result.get(); 64 | } 65 | } // namespace kuka_drivers_core 66 | 67 | #endif // COMMUNICATION_HELPERS__SERVICE_TOOLS_HPP_ 68 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: "Bug Report" 2 | description: Create a new ticket for a bug. 3 | title: "[BUG] - " 4 | labels: [ 5 | "bug" 6 | ] 7 | body: 8 | - type: textarea 9 | id: description 10 | attributes: 11 | label: "Description" 12 | description: Please enter an explicit description of your issue 13 | placeholder: Describe your issue in a few sentences 14 | validations: 15 | required: true 16 | - type: dropdown 17 | id: robot-os 18 | attributes: 19 | label: "KUKA robot OS" 20 | description: Version of the KUKA OS are you using 21 | multiple: true 22 | options: 23 | - KSS 24 | - Sunrise 25 | - iiQKA 26 | - type: input 27 | id: os-version 28 | attributes: 29 | label: "KUKA robot OS version" 30 | description: Version of the KUKA robot OS 31 | placeholder: eg. KSS 8.6 32 | validations: 33 | required: true 34 | - type: input 35 | id: if-version 36 | attributes: 37 | label: "KUKA external interface version" 38 | description: Version of the KUKA external interface 39 | placeholder: eg. RSI 4.1.3 40 | validations: 41 | required: true 42 | - type: input 43 | id: robot-model 44 | attributes: 45 | label: "Affected robot model(s)" 46 | description: Robot model the issue came up with 47 | placeholder: eg. KR10 R1100-2 48 | validations: 49 | required: true 50 | - type: input 51 | id: driver-version 52 | attributes: 53 | label: "Version or commit hash of the driver" 54 | description: If the issue came up with an older version (not master), provide the release version or commit hash 55 | validations: 56 | required: false 57 | - type: textarea 58 | id: setup 59 | attributes: 60 | label: "Setup" 61 | description: Describe your setup, launch files and executables started (optionally attach rqt_graph output), modifications to code 62 | render: bash 63 | validations: 64 | required: true 65 | - type: textarea 66 | id: reprod 67 | attributes: 68 | label: "Reproduction steps" 69 | description: Clear and ordered steps of reporoducing 70 | render: bash 71 | validations: 72 | required: true 73 | - type: textarea 74 | id: logs 75 | attributes: 76 | label: "Logs" 77 | description: Attach relevant log output here, mentioning if lines were omitted to help readability. 78 | render: bash 79 | validations: 80 | required: false 81 | -------------------------------------------------------------------------------- /controllers/kuka_event_broadcaster/include/kuka_event_broadcaster/kuka_event_broadcaster.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_EVENT_BROADCASTER__KUKA_EVENT_BROADCASTER_HPP_ 16 | #define KUKA_EVENT_BROADCASTER__KUKA_EVENT_BROADCASTER_HPP_ 17 | 18 | #include <memory> 19 | #include <string> 20 | #include <vector> 21 | 22 | #include "controller_interface/controller_interface.hpp" 23 | #include "pluginlib/class_list_macros.hpp" 24 | #include "rclcpp/duration.hpp" 25 | #include "rclcpp/time.hpp" 26 | #include "std_msgs/msg/u_int8.hpp" 27 | 28 | #include "kuka_event_broadcaster/visibility_control.h" 29 | 30 | namespace kuka_controllers 31 | { 32 | class EventBroadcaster : public controller_interface::ControllerInterface 33 | { 34 | public: 35 | KUKA_EVENT_BROADCASTER_PUBLIC controller_interface::InterfaceConfiguration 36 | command_interface_configuration() const override; 37 | 38 | KUKA_EVENT_BROADCASTER_PUBLIC controller_interface::InterfaceConfiguration 39 | state_interface_configuration() const override; 40 | 41 | KUKA_EVENT_BROADCASTER_PUBLIC controller_interface::return_type update( 42 | const rclcpp::Time & time, const rclcpp::Duration & period) override; 43 | 44 | KUKA_EVENT_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_configure( 45 | const rclcpp_lifecycle::State & previous_state) override; 46 | 47 | KUKA_EVENT_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_activate( 48 | const rclcpp_lifecycle::State & previous_state) override; 49 | 50 | KUKA_EVENT_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_deactivate( 51 | const rclcpp_lifecycle::State & previous_state) override; 52 | 53 | KUKA_EVENT_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_init() override; 54 | 55 | private: 56 | rclcpp::Publisher<std_msgs::msg::UInt8>::SharedPtr event_publisher_; 57 | std_msgs::msg::UInt8 event_msg_; 58 | int last_event_ = 0; 59 | }; 60 | } // namespace kuka_controllers 61 | #endif // KUKA_EVENT_BROADCASTER__KUKA_EVENT_BROADCASTER_HPP_ 62 | -------------------------------------------------------------------------------- /controllers/fri_state_broadcaster/include/fri_state_broadcaster/fri_state_broadcaster.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef FRI_STATE_BROADCASTER__FRI_STATE_BROADCASTER_HPP_ 16 | #define FRI_STATE_BROADCASTER__FRI_STATE_BROADCASTER_HPP_ 17 | 18 | #include <memory> 19 | #include <string> 20 | #include <vector> 21 | 22 | #include "controller_interface/controller_interface.hpp" 23 | #include "kuka_driver_interfaces/msg/fri_state.hpp" 24 | #include "pluginlib/class_list_macros.hpp" 25 | #include "rclcpp/duration.hpp" 26 | #include "rclcpp/time.hpp" 27 | 28 | #include "fri_state_broadcaster/visibility_control.h" 29 | 30 | namespace kuka_controllers 31 | { 32 | class FRIStateBroadcaster : public controller_interface::ControllerInterface 33 | { 34 | public: 35 | FRI_STATE_BROADCASTER_PUBLIC controller_interface::InterfaceConfiguration 36 | command_interface_configuration() const override; 37 | 38 | FRI_STATE_BROADCASTER_PUBLIC controller_interface::InterfaceConfiguration 39 | state_interface_configuration() const override; 40 | 41 | FRI_STATE_BROADCASTER_PUBLIC controller_interface::return_type update( 42 | const rclcpp::Time & time, const rclcpp::Duration & period) override; 43 | 44 | FRI_STATE_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_configure( 45 | const rclcpp_lifecycle::State & previous_state) override; 46 | 47 | FRI_STATE_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_activate( 48 | const rclcpp_lifecycle::State & previous_state) override; 49 | 50 | FRI_STATE_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_deactivate( 51 | const rclcpp_lifecycle::State & previous_state) override; 52 | 53 | FRI_STATE_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_init() override; 54 | 55 | private: 56 | int counter_ = 0; 57 | rclcpp::Publisher<kuka_driver_interfaces::msg::FRIState>::SharedPtr robot_state_publisher_; 58 | kuka_driver_interfaces::msg::FRIState state_msg_; 59 | }; 60 | } // namespace kuka_controllers 61 | #endif // FRI_STATE_BROADCASTER__FRI_STATE_BROADCASTER_HPP_ 62 | -------------------------------------------------------------------------------- /kuka_iiqka_eac_driver/include/kuka_iiqka_eac_driver/event_observer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 Márk Szitanics 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_IIQKA_EAC_DRIVER__EVENT_OBSERVER_HPP_ 16 | #define KUKA_IIQKA_EAC_DRIVER__EVENT_OBSERVER_HPP_ 17 | 18 | #include <string> 19 | #include "rclcpp/macros.hpp" 20 | 21 | #include "kuka/external-control-sdk/iiqka/sdk.h" 22 | #include "kuka_drivers_core/hardware_event.hpp" 23 | #include "kuka_iiqka_eac_driver/hardware_interface.hpp" 24 | 25 | namespace kuka_eac 26 | { 27 | class KukaEACEventObserver : public kuka::external::control::EventHandler 28 | { 29 | public: 30 | explicit KukaEACEventObserver(KukaEACHardwareInterface * hw_interface) 31 | : hw_interface_(hw_interface) 32 | { 33 | } 34 | void OnSampling() override 35 | { 36 | hw_interface_->set_server_event(kuka_drivers_core::HardwareEvent::CONTROL_STARTED); 37 | RCLCPP_INFO(rclcpp::get_logger("KukaEACHardwareInterface"), "External control is active"); 38 | } 39 | void OnControlModeSwitch(const std::string &) override 40 | { 41 | hw_interface_->set_server_event(kuka_drivers_core::HardwareEvent::CONTROL_MODE_SWITCH); 42 | RCLCPP_INFO( 43 | rclcpp::get_logger("KukaEACHardwareInterface"), "Control mode switch is in progress"); 44 | hw_interface_->reset_cycle_count(); 45 | } 46 | void OnStopped(const std::string &) override 47 | { 48 | hw_interface_->set_server_event(kuka_drivers_core::HardwareEvent::CONTROL_STOPPED); 49 | RCLCPP_INFO(rclcpp::get_logger("KukaEACHardwareInterface"), "External control finished"); 50 | } 51 | void OnError(const std::string & reason) override 52 | { 53 | hw_interface_->set_server_event(kuka_drivers_core::HardwareEvent::ERROR); 54 | RCLCPP_ERROR( 55 | rclcpp::get_logger("KukaEACHardwareInterface"), "External control stopped by an error"); 56 | RCLCPP_ERROR(rclcpp::get_logger("KukaEACHardwareInterface"), reason.c_str()); 57 | } 58 | 59 | private: 60 | KukaEACHardwareInterface * hw_interface_; 61 | }; 62 | 63 | } // namespace kuka_eac 64 | 65 | #endif // KUKA_IIQKA_EAC_DRIVER__EVENT_OBSERVER_HPP_ 66 | -------------------------------------------------------------------------------- /examples/iiqka_moveit_example/src/moveit_constrained_planning_example.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 Áron Svastits 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include <math.h> 16 | #include <memory> 17 | 18 | #include "iiqka_moveit_example/moveit_example.hpp" 19 | 20 | int main(int argc, char * argv[]) 21 | { 22 | // Setup 23 | // Initialize ROS and create the Node 24 | rclcpp::init(argc, argv); 25 | auto const example_node = std::make_shared<MoveitExample>(); 26 | rclcpp::executors::SingleThreadedExecutor executor; 27 | executor.add_node(example_node); 28 | std::thread([&executor]() { executor.spin(); }).detach(); 29 | 30 | example_node->initialize(); 31 | 32 | // Add robot platform 33 | example_node->addRobotPlatform(); 34 | 35 | // Go to correct position for the example 36 | auto init_trajectory = example_node->planToPosition( 37 | std::vector<double>{0.0017, -2.096, 1.514, 0.0012, -0.9888, -0.0029}); 38 | if (init_trajectory != nullptr) 39 | { 40 | example_node->moveGroupInterface()->execute(*init_trajectory); 41 | } 42 | 43 | // Add collision object 44 | example_node->addCollisionBox( 45 | geometry_msgs::build<geometry_msgs::msg::Vector3>().x(0.125).y(0.15).z(0.5), 46 | geometry_msgs::build<geometry_msgs::msg::Vector3>().x(0.1).y(1.0).z(0.1)); 47 | example_node->addBreakPoint(); 48 | 49 | auto cart_goal = 50 | Eigen::Isometry3d(Eigen::Translation3d(0.4, -0.15, 0.55) * Eigen::Quaterniond::Identity()); 51 | 52 | geometry_msgs::msg::Quaternion q; 53 | q.x = 0; 54 | q.y = 0; 55 | q.z = 0; 56 | q.w = 1; 57 | 58 | example_node->moveGroupInterface()->setPlanningTime(30.0); 59 | 60 | example_node->setOrientationConstraint(q); 61 | // Plan with collision avoidance 62 | auto planned_trajectory = 63 | example_node->planToPointUntilSuccess(cart_goal, "ompl", "RRTkConfigDefault"); 64 | if (planned_trajectory != nullptr) 65 | { 66 | example_node->drawTrajectory(*planned_trajectory); 67 | example_node->addBreakPoint(); 68 | example_node->moveGroupInterface()->execute(*planned_trajectory); 69 | } 70 | 71 | // Shutdown ROS 72 | rclcpp::shutdown(); 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /controllers/fri_configuration_controller/include/fri_configuration_controller/fri_configuration_controller.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef FRI_CONFIGURATION_CONTROLLER__FRI_CONFIGURATION_CONTROLLER_HPP_ 16 | #define FRI_CONFIGURATION_CONTROLLER__FRI_CONFIGURATION_CONTROLLER_HPP_ 17 | 18 | #include <memory> 19 | #include <string> 20 | #include <vector> 21 | 22 | #include "controller_interface/controller_interface.hpp" 23 | #include "kuka_driver_interfaces/msg/fri_configuration.hpp" 24 | #include "pluginlib/class_list_macros.hpp" 25 | #include "rclcpp/duration.hpp" 26 | #include "rclcpp/time.hpp" 27 | 28 | #include "fri_configuration_controller/visibility_control.h" 29 | 30 | namespace kuka_controllers 31 | { 32 | class FRIConfigurationController : public controller_interface::ControllerInterface 33 | { 34 | public: 35 | FRI_CONFIGURATION_CONTROLLER_PUBLIC 36 | controller_interface::InterfaceConfiguration command_interface_configuration() const override; 37 | 38 | FRI_CONFIGURATION_CONTROLLER_PUBLIC 39 | controller_interface::InterfaceConfiguration state_interface_configuration() const override; 40 | 41 | FRI_CONFIGURATION_CONTROLLER_PUBLIC controller_interface::return_type update( 42 | const rclcpp::Time & time, const rclcpp::Duration & period) override; 43 | 44 | FRI_CONFIGURATION_CONTROLLER_PUBLIC controller_interface::CallbackReturn on_configure( 45 | const rclcpp_lifecycle::State & previous_state) override; 46 | 47 | FRI_CONFIGURATION_CONTROLLER_PUBLIC controller_interface::CallbackReturn on_activate( 48 | const rclcpp_lifecycle::State & previous_state) override; 49 | 50 | FRI_CONFIGURATION_CONTROLLER_PUBLIC controller_interface::CallbackReturn on_deactivate( 51 | const rclcpp_lifecycle::State & previous_state) override; 52 | 53 | FRI_CONFIGURATION_CONTROLLER_PUBLIC controller_interface::CallbackReturn on_init() override; 54 | 55 | private: 56 | rclcpp::Subscription<kuka_driver_interfaces::msg::FriConfiguration>::SharedPtr fri_config_sub_; 57 | double receive_multiplier_ = 1; 58 | double send_period_ms_ = 10; 59 | }; 60 | } // namespace kuka_controllers 61 | #endif // FRI_CONFIGURATION_CONTROLLER__FRI_CONFIGURATION_CONTROLLER_HPP_ 62 | -------------------------------------------------------------------------------- /controllers/kuka_control_mode_handler/include/kuka_control_mode_handler/kuka_control_mode_handler.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_CONTROL_MODE_HANDLER__KUKA_CONTROL_MODE_HANDLER_HPP_ 16 | #define KUKA_CONTROL_MODE_HANDLER__KUKA_CONTROL_MODE_HANDLER_HPP_ 17 | 18 | #include <atomic> 19 | #include <memory> 20 | #include <string> 21 | #include <vector> 22 | 23 | #include "controller_interface/controller_interface.hpp" 24 | #include "kuka_drivers_core/control_mode.hpp" 25 | #include "pluginlib/class_list_macros.hpp" 26 | #include "rclcpp/duration.hpp" 27 | #include "rclcpp/time.hpp" 28 | #include "std_msgs/msg/u_int32.hpp" 29 | 30 | #include "kuka_control_mode_handler/visibility_control.h" 31 | 32 | namespace kuka_controllers 33 | { 34 | class ControlModeHandler : public controller_interface::ControllerInterface 35 | { 36 | public: 37 | KUKA_CONTROL_MODE_HANDLER_PUBLIC controller_interface::InterfaceConfiguration 38 | command_interface_configuration() const override; 39 | 40 | KUKA_CONTROL_MODE_HANDLER_PUBLIC controller_interface::InterfaceConfiguration 41 | state_interface_configuration() const override; 42 | 43 | KUKA_CONTROL_MODE_HANDLER_PUBLIC controller_interface::return_type update( 44 | const rclcpp::Time & time, const rclcpp::Duration & period) override; 45 | 46 | KUKA_CONTROL_MODE_HANDLER_PUBLIC controller_interface::CallbackReturn on_configure( 47 | const rclcpp_lifecycle::State & previous_state) override; 48 | 49 | KUKA_CONTROL_MODE_HANDLER_PUBLIC controller_interface::CallbackReturn on_activate( 50 | const rclcpp_lifecycle::State & previous_state) override; 51 | 52 | KUKA_CONTROL_MODE_HANDLER_PUBLIC controller_interface::CallbackReturn on_deactivate( 53 | const rclcpp_lifecycle::State & previous_state) override; 54 | 55 | KUKA_CONTROL_MODE_HANDLER_PUBLIC controller_interface::CallbackReturn on_init() override; 56 | 57 | private: 58 | rclcpp::Subscription<std_msgs::msg::UInt32>::SharedPtr control_mode_subscriber_; 59 | std::atomic<kuka_drivers_core::ControlMode> control_mode_ = 60 | kuka_drivers_core::ControlMode::CONTROL_MODE_UNSPECIFIED; 61 | }; 62 | } // namespace kuka_controllers 63 | #endif // KUKA_CONTROL_MODE_HANDLER__KUKA_CONTROL_MODE_HANDLER_HPP_ 64 | -------------------------------------------------------------------------------- /kuka_drivers_core/include/communication_helpers/ros2_control_tools.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Aron Svastits 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef COMMUNICATION_HELPERS__ROS2_CONTROL_TOOLS_HPP_ 16 | #define COMMUNICATION_HELPERS__ROS2_CONTROL_TOOLS_HPP_ 17 | 18 | #include <memory> 19 | #include <string> 20 | #include <vector> 21 | 22 | #include "communication_helpers/service_tools.hpp" 23 | #include "controller_manager_msgs/srv/set_hardware_component_state.hpp" 24 | #include "controller_manager_msgs/srv/switch_controller.hpp" 25 | #include "rclcpp/rclcpp.hpp" 26 | 27 | namespace kuka_drivers_core 28 | { 29 | 30 | inline bool changeHardwareState( 31 | rclcpp::Client<controller_manager_msgs::srv::SetHardwareComponentState>::SharedPtr client, 32 | const std::string & hardware_name, uint8_t state, int timeout_ms = 2000) 33 | { 34 | auto hw_request = 35 | std::make_shared<controller_manager_msgs::srv::SetHardwareComponentState::Request>(); 36 | hw_request->name = hardware_name; 37 | hw_request->target_state.id = state; 38 | auto hw_response = sendRequest<controller_manager_msgs::srv::SetHardwareComponentState::Response>( 39 | client, hw_request, 0, timeout_ms); 40 | if (!hw_response || !hw_response->ok) 41 | { 42 | return false; 43 | } 44 | return true; 45 | } 46 | 47 | inline bool changeControllerState( 48 | rclcpp::Client<controller_manager_msgs::srv::SwitchController>::SharedPtr client, 49 | const std::vector<std::string> & activate_controllers, 50 | const std::vector<std::string> & deactivate_controllers, 51 | int32_t strictness = controller_manager_msgs::srv::SwitchController::Request::STRICT) 52 | { 53 | auto controller_request = 54 | std::make_shared<controller_manager_msgs::srv::SwitchController::Request>(); 55 | controller_request->strictness = strictness; 56 | controller_request->activate_controllers = activate_controllers; 57 | controller_request->deactivate_controllers = deactivate_controllers; 58 | 59 | auto controller_response = sendRequest<controller_manager_msgs::srv::SwitchController::Response>( 60 | client, controller_request, 0, 2000); 61 | if (!controller_response || !controller_response->ok) 62 | { 63 | return false; 64 | } 65 | return true; 66 | } 67 | } // namespace kuka_drivers_core 68 | 69 | #endif // COMMUNICATION_HELPERS__ROS2_CONTROL_TOOLS_HPP_ 70 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/include/kuka_sunrise_fri_driver/serialization.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Zoltán Rési 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef KUKA_SUNRISE_FRI_DRIVER__SERIALIZATION_HPP_ 16 | #define KUKA_SUNRISE_FRI_DRIVER__SERIALIZATION_HPP_ 17 | 18 | #include <string.h> 19 | #include <algorithm> 20 | #include <cstdint> 21 | #include <string> 22 | #include <vector> 23 | 24 | namespace kuka_sunrise_fri_driver 25 | { 26 | 27 | int serializeNext(int integer_in, std::vector<std::uint8_t> & serialized_out) 28 | { 29 | std::uint8_t * bytes = reinterpret_cast<std::uint8_t *>(&integer_in); 30 | auto it = serialized_out.end(); 31 | serialized_out.insert(it, bytes, bytes + sizeof(int)); 32 | 33 | // Redefine iterator because of possible invalidation 34 | auto from_it = std::prev(serialized_out.end(), sizeof(int)); 35 | std::reverse(from_it, serialized_out.end()); 36 | // TODO(resizoltan): assert that int is 4 bytes long 37 | // TODO(resizoltan): check endianness 38 | return sizeof(int); 39 | } 40 | 41 | int deserializeNext(const std::vector<std::uint8_t> & serialized_in, int & integer_out) 42 | { 43 | if (serialized_in.size() < sizeof(int)) 44 | { 45 | // TODO(resizoltan): error 46 | } 47 | std::vector<std::uint8_t> serialized_copy = serialized_in; 48 | integer_out = *(reinterpret_cast<int *>(serialized_copy.data())); 49 | return sizeof(int); 50 | } 51 | 52 | int serializeNext(double double_in, std::vector<std::uint8_t> & serialized_out) 53 | { 54 | std::uint8_t * bytes = reinterpret_cast<std::uint8_t *>(&double_in); 55 | serialized_out.insert(serialized_out.end(), bytes, bytes + sizeof(double)); 56 | 57 | // Redefine iterator because of possible invalidation 58 | auto from_it = std::prev(serialized_out.end(), sizeof(double)); 59 | std::reverse(from_it, serialized_out.end()); 60 | // TODO(resizoltan): assert that int is 4 bytes long 61 | // TODO(resizoltan): check endianness 62 | return sizeof(int); 63 | } 64 | 65 | int deserializeNext(const std::vector<std::uint8_t> & serialized_in, double & double_out) 66 | { 67 | if (serialized_in.size() < sizeof(double)) 68 | { 69 | // TODO(resizoltan): error 70 | } 71 | std::vector<std::uint8_t> serialized_copy = serialized_in; 72 | double_out = *(reinterpret_cast<int *>(serialized_copy.data())); 73 | return sizeof(int); 74 | } 75 | } // namespace kuka_sunrise_fri_driver 76 | 77 | #endif // KUKA_SUNRISE_FRI_DRIVER__SERIALIZATION_HPP_ 78 | -------------------------------------------------------------------------------- /controllers/kuka_event_broadcaster/src/kuka_event_broadcaster.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "kuka_drivers_core/hardware_interface_types.hpp" 16 | 17 | #include "kuka_event_broadcaster/kuka_event_broadcaster.hpp" 18 | 19 | namespace kuka_controllers 20 | { 21 | controller_interface::CallbackReturn EventBroadcaster::on_init() 22 | { 23 | event_publisher_ = get_node()->create_publisher<std_msgs::msg::UInt8>( 24 | "~/hardware_event", rclcpp::SystemDefaultsQoS()); 25 | return controller_interface::CallbackReturn::SUCCESS; 26 | } 27 | 28 | controller_interface::InterfaceConfiguration EventBroadcaster::command_interface_configuration() 29 | const 30 | { 31 | return controller_interface::InterfaceConfiguration{ 32 | controller_interface::interface_configuration_type::NONE}; 33 | } 34 | 35 | controller_interface::InterfaceConfiguration EventBroadcaster::state_interface_configuration() const 36 | { 37 | controller_interface::InterfaceConfiguration config; 38 | config.type = controller_interface::interface_configuration_type::INDIVIDUAL; 39 | config.names.emplace_back( 40 | std::string(hardware_interface::STATE_PREFIX) + "/" + hardware_interface::SERVER_STATE); 41 | return config; 42 | } 43 | 44 | controller_interface::CallbackReturn EventBroadcaster::on_configure(const rclcpp_lifecycle::State &) 45 | { 46 | return controller_interface::CallbackReturn::SUCCESS; 47 | } 48 | 49 | controller_interface::CallbackReturn EventBroadcaster::on_activate(const rclcpp_lifecycle::State &) 50 | { 51 | return controller_interface::CallbackReturn::SUCCESS; 52 | } 53 | 54 | controller_interface::CallbackReturn EventBroadcaster::on_deactivate( 55 | const rclcpp_lifecycle::State &) 56 | { 57 | return controller_interface::CallbackReturn::SUCCESS; 58 | } 59 | 60 | controller_interface::return_type EventBroadcaster::update( 61 | const rclcpp::Time &, const rclcpp::Duration &) 62 | { 63 | auto current_event = 64 | static_cast<uint8_t>(state_interfaces_[0].get_optional().value_or(last_event_)); 65 | if (current_event != last_event_) 66 | { 67 | event_msg_.data = current_event; 68 | event_publisher_->publish(event_msg_); 69 | last_event_ = current_event; 70 | } 71 | return controller_interface::return_type::OK; 72 | } 73 | } // namespace kuka_controllers 74 | 75 | PLUGINLIB_EXPORT_CLASS( 76 | kuka_controllers::EventBroadcaster, controller_interface::ControllerInterface) 77 | -------------------------------------------------------------------------------- /kuka_rsi_driver/src/hardware_interface_rsi_only.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2023 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include <vector> 16 | 17 | #include "hardware_interface/types/hardware_interface_type_values.hpp" 18 | #include "pluginlib/class_list_macros.hpp" 19 | 20 | #include "kuka_drivers_core/hardware_event.hpp" 21 | #include "kuka_drivers_core/hardware_interface_types.hpp" 22 | #include "kuka_rsi_driver/hardware_interface_rsi_only.hpp" 23 | 24 | namespace kuka_rsi_driver 25 | { 26 | CallbackReturn KukaRSIHardwareInterface::on_configure(const rclcpp_lifecycle::State &) 27 | { 28 | kuka::external::control::kss::Configuration rsi_config; 29 | rsi_config.installed_interface = 30 | kuka::external::control::kss::Configuration::InstalledInterface::RSI_ONLY; 31 | const bool setup_success = SetupRobot(rsi_config, nullptr, nullptr); 32 | return setup_success ? CallbackReturn::SUCCESS : CallbackReturn::ERROR; 33 | } 34 | 35 | CallbackReturn KukaRSIHardwareInterface::on_activate(const rclcpp_lifecycle::State &) 36 | { 37 | Read(10 * READ_TIMEOUT_MS); 38 | 39 | std::copy(hw_states_.cbegin(), hw_states_.cend(), hw_commands_.begin()); 40 | CopyGPIOStatesToCommands(); 41 | 42 | Write(); 43 | 44 | msg_received_ = false; 45 | is_active_ = true; 46 | 47 | RCLCPP_INFO(logger_, "Received position data from robot controller!"); 48 | set_server_event(kuka_drivers_core::HardwareEvent::CONTROL_STARTED); 49 | 50 | return CallbackReturn::SUCCESS; 51 | } 52 | 53 | CallbackReturn KukaRSIHardwareInterface::on_deactivate(const rclcpp_lifecycle::State &) 54 | { 55 | // If control is active, send stop signal 56 | if (msg_received_) 57 | { 58 | RCLCPP_INFO(logger_, "Deactivating hardware interface by sending stop signal"); 59 | 60 | // StopControlling sometimes calls a blocking read, which could conflict with the read() method, 61 | // but resource manager handles locking (resources_lock_), so is not necessary here 62 | robot_ptr_->StopControlling(); 63 | } 64 | 65 | is_active_ = false; 66 | msg_received_ = false; 67 | 68 | RCLCPP_INFO(logger_, "Stop requested!"); 69 | return CallbackReturn::SUCCESS; 70 | } 71 | 72 | void KukaRSIHardwareInterface::CreateRobotInstance( 73 | const kuka::external::control::kss::Configuration & config) 74 | { 75 | robot_ptr_ = std::make_unique<kuka::external::control::kss::rsi::Robot>(config); 76 | } 77 | } // namespace kuka_rsi_driver 78 | 79 | PLUGINLIB_EXPORT_CLASS( 80 | kuka_rsi_driver::KukaRSIHardwareInterface, hardware_interface::SystemInterface) 81 | -------------------------------------------------------------------------------- /kuka_drivers_core/src/parameter_handler.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Gergely Kovács 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "kuka_drivers_core/parameter_handler.hpp" 16 | 17 | #include <memory> 18 | #include <string> 19 | #include <vector> 20 | 21 | namespace kuka_drivers_core 22 | { 23 | ParameterHandler::ParameterHandler(rclcpp_lifecycle::LifecycleNode * node) : node_(node) {} 24 | 25 | rcl_interfaces::msg::SetParametersResult ParameterHandler::onParamChange( 26 | const std::vector<rclcpp::Parameter> & parameters) const 27 | { 28 | rcl_interfaces::msg::SetParametersResult result; 29 | result.successful = false; 30 | for (const rclcpp::Parameter & param : parameters) 31 | { 32 | auto found_param_it = std::find_if( 33 | params_.begin(), params_.end(), 34 | [¶m](auto param_ptr) { return param_ptr->getName() == param.get_name(); }); 35 | // When used properly, we should not reach this 36 | // but better to keep additional check to filter improper use 37 | if (found_param_it == params_.end()) 38 | { 39 | printf("Invalid parameter name\n"); 40 | } 41 | else if (canSetParameter(*(*found_param_it))) 42 | { 43 | result.successful = (*found_param_it)->callCallback(param); 44 | } 45 | } 46 | return result; 47 | } 48 | 49 | bool ParameterHandler::canSetParameter(const ParameterBase & param) const 50 | { 51 | if (node_ == nullptr) 52 | { 53 | // Node is not lifecycle node, parameter can always be set 54 | return true; 55 | } 56 | try 57 | { 58 | if (!param.getRights().isSetAllowed(node_->get_current_state().id())) 59 | { 60 | RCLCPP_ERROR( 61 | node_->get_logger(), "Parameter %s cannot be changed while in state %s", 62 | param.getName().c_str(), node_->get_current_state().label().c_str()); 63 | return false; 64 | } 65 | } 66 | catch (const std::out_of_range &) 67 | { 68 | RCLCPP_ERROR( 69 | node_->get_logger(), "Parameter set access rights for parameter %s couldn't be determined", 70 | param.getName().c_str()); 71 | return false; 72 | } 73 | return true; 74 | } 75 | 76 | void ParameterHandler::registerParameter( 77 | std::shared_ptr<ParameterBase> param_shared_ptr, bool block) 78 | { 79 | params_.emplace_back(param_shared_ptr); 80 | param_shared_ptr->getParameterInterface()->declare_parameter( 81 | param_shared_ptr->getName(), param_shared_ptr->getDefaultValue()); 82 | if (block) 83 | { 84 | param_shared_ptr->blockParameter(); 85 | } 86 | } 87 | 88 | } // namespace kuka_drivers_core 89 | -------------------------------------------------------------------------------- /kuka_drivers_core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(kuka_drivers_core) 3 | 4 | if(NOT CMAKE_C_STANDARD) 5 | set(CMAKE_C_STANDARD 99) 6 | endif() 7 | 8 | if(NOT CMAKE_CXX_STANDARD) 9 | set(CMAKE_CXX_STANDARD 14) 10 | endif() 11 | 12 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 13 | add_compile_options(-Wall -Wextra -Wpedantic) 14 | endif() 15 | 16 | include_directories(include) 17 | 18 | find_package(ament_cmake REQUIRED) 19 | find_package(rclcpp REQUIRED) 20 | find_package(rclcpp_lifecycle REQUIRED) 21 | find_package(lifecycle_msgs REQUIRED) 22 | find_package(controller_manager REQUIRED) 23 | 24 | add_library(kuka_drivers_core SHARED 25 | src/ros2_base_node.cpp 26 | src/ros2_base_lc_node.cpp 27 | src/parameter_handler.cpp 28 | src/controller_handler.cpp 29 | ) 30 | ament_target_dependencies(kuka_drivers_core rclcpp rclcpp_lifecycle lifecycle_msgs) 31 | 32 | add_executable(control_node 33 | src/control_node.cpp) 34 | ament_target_dependencies(control_node rclcpp rclcpp_lifecycle controller_manager) 35 | 36 | ament_export_targets(export_kuka_drivers_core HAS_LIBRARY_TARGET) 37 | ament_export_dependencies(rclcpp rclcpp_lifecycle lifecycle_msgs) 38 | ament_export_libraries(${PROJECT_NAME}) 39 | 40 | add_library(communication_helpers SHARED 41 | include/communication_helpers/ros2_control_tools.hpp 42 | include/communication_helpers/service_tools.hpp) 43 | ament_target_dependencies(communication_helpers rclcpp) 44 | set_target_properties(communication_helpers PROPERTIES LINKER_LANGUAGE CXX) 45 | 46 | ament_export_targets(communication_helpers HAS_LIBRARY_TARGET) 47 | ament_export_dependencies(rclcpp) 48 | 49 | install(DIRECTORY include/${PROJECT_NAME}/ 50 | DESTINATION include/${PROJECT_NAME}/ 51 | ) 52 | 53 | install(TARGETS kuka_drivers_core 54 | EXPORT export_kuka_drivers_core 55 | LIBRARY DESTINATION lib 56 | ARCHIVE DESTINATION lib 57 | RUNTIME DESTINATION bin 58 | INCLUDES DESTINATION include) 59 | 60 | install(DIRECTORY include/communication_helpers DESTINATION include) 61 | install( 62 | TARGETS communication_helpers 63 | EXPORT communication_helpers 64 | LIBRARY DESTINATION lib 65 | INCLUDES DESTINATION include 66 | ) 67 | 68 | install(TARGETS ${PROJECT_NAME} control_node 69 | DESTINATION lib/${PROJECT_NAME}) 70 | 71 | ament_export_include_directories(include) 72 | 73 | if(BUILD_TESTING) 74 | 75 | endif() 76 | 77 | ament_package() 78 | 79 | set(SONARQUBE_PACKAGES_FILE "none" CACHE STRING "Path to the file that contains the package source directories for SonarQube.") 80 | option(TEST_COVERAGE "Generate test coverage reports upon testing." OFF) 81 | 82 | if(NOT ${SONARQUBE_PACKAGES_FILE} MATCHES "none") 83 | file(APPEND ${SONARQUBE_PACKAGES_FILE} "${PROJECT_NAME};${PROJECT_SOURCE_DIR}\n") 84 | message(${SONARQUBE_PACKAGES_FILE}) 85 | endif() 86 | 87 | if(TEST_COVERAGE) 88 | set(CMAKE_BUILD_TYPE Debug) 89 | list(APPEND CMAKE_MODULE_PATH "/usr/lib/cmake/CodeCoverage") 90 | include(CodeCoverage) 91 | append_coverage_compiler_flags() 92 | set_coverage_output_dir() 93 | endif() 94 | 95 | if(TEST_COVERAGE) 96 | endif() 97 | -------------------------------------------------------------------------------- /kuka_sunrise_fri_driver/robot_application/src/ros2/serialization/ControlModeParams.java: -------------------------------------------------------------------------------- 1 | package ros2.serialization; 2 | 3 | import java.io.Externalizable; 4 | import java.io.IOException; 5 | import java.io.ObjectInput; 6 | import java.io.ObjectOutput; 7 | import java.util.Arrays; 8 | 9 | 10 | import com.kuka.roboticsAPI.motionModel.controlModeModel.IMotionControlMode; 11 | import com.kuka.roboticsAPI.motionModel.controlModeModel.JointImpedanceControlMode; 12 | import com.kuka.roboticsAPI.motionModel.controlModeModel.PositionControlMode; 13 | 14 | public abstract class ControlModeParams implements Externalizable{ 15 | public static int length = 0; 16 | 17 | private enum ControlModeID{ 18 | POSITION( (byte)1), 19 | JOINT_IMPEDANCE((byte)2); 20 | 21 | public final byte value; 22 | 23 | ControlModeID(byte value){ 24 | this.value = value; 25 | } 26 | 27 | public static ControlModeID fromByte(byte value){ 28 | for(ControlModeID id : ControlModeID.values()){ 29 | if(value == id.value){ 30 | return id; 31 | } 32 | } 33 | throw new RuntimeException("Byte " + value + " does not represent an ControlModeID"); 34 | } 35 | } 36 | 37 | public static ControlModeParams fromSerialData(byte[] serialData){ 38 | if(serialData.length == 0){ 39 | throw new RuntimeException("serialData is empty"); 40 | } 41 | ControlModeID controlModeID = ControlModeID.fromByte(serialData[0]); 42 | ControlModeParams controlModeParams = null; 43 | switch(controlModeID){ 44 | case POSITION: 45 | controlModeParams = new PositionControlModeParams(); 46 | break; 47 | case JOINT_IMPEDANCE: 48 | controlModeParams = new JointImpedanceControlModeParams(); 49 | break; 50 | } 51 | serialData = Arrays.copyOfRange(serialData, 1, serialData.length); 52 | MessageEncoding.Decode(serialData, controlModeParams); 53 | return controlModeParams; 54 | } 55 | 56 | public static ControlModeParams fromMotionControlMode(IMotionControlMode controlMode){ 57 | if(controlMode == null){ 58 | throw new RuntimeException("ControlMode is null"); 59 | } 60 | ControlModeParams controlModeParams; 61 | if(controlMode instanceof PositionControlMode){ 62 | controlModeParams = new PositionControlModeParams(); 63 | } else if (controlMode instanceof JointImpedanceControlMode){ 64 | controlModeParams = new JointImpedanceControlModeParams((JointImpedanceControlMode) controlMode); 65 | } else { 66 | throw new RuntimeException("Control mode not supported"); 67 | } 68 | return controlModeParams; 69 | } 70 | 71 | @Override 72 | public void writeExternal(ObjectOutput out) throws IOException { 73 | 74 | 75 | } 76 | 77 | @Override 78 | public void readExternal(ObjectInput in) throws IOException, 79 | ClassNotFoundException { 80 | 81 | } 82 | 83 | } 84 | 85 | class PositionControlModeParams extends ControlModeParams{ 86 | 87 | 88 | } 89 | 90 | class JointImpedanceControlModeParams extends ControlModeParams{ 91 | public JointImpedanceControlModeParams(){ 92 | 93 | } 94 | public JointImpedanceControlModeParams(JointImpedanceControlMode controlMode){ 95 | 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /controllers/joint_group_impedance_controller/src/joint_group_impedance_controller.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "pluginlib/class_list_macros.hpp" 16 | 17 | #include "kuka_drivers_core/hardware_interface_types.hpp" 18 | 19 | #include "joint_group_impedance_controller/joint_group_impedance_controller.hpp" 20 | 21 | namespace kuka_controllers 22 | { 23 | 24 | JointGroupImpedanceController::JointGroupImpedanceController() : ForwardControllersBase() {} 25 | 26 | void JointGroupImpedanceController::declare_parameters() 27 | { 28 | param_listener_ = std::make_shared<ParamListener>(get_node()); 29 | } 30 | 31 | controller_interface::CallbackReturn JointGroupImpedanceController::read_parameters() 32 | { 33 | if (!param_listener_) 34 | { 35 | RCLCPP_ERROR(get_node()->get_logger(), "Error encountered during init"); 36 | return controller_interface::CallbackReturn::ERROR; 37 | } 38 | params_ = param_listener_->get_params(); 39 | 40 | if (params_.joints.empty()) 41 | { 42 | RCLCPP_ERROR(get_node()->get_logger(), "'joints' parameter is empty"); 43 | return controller_interface::CallbackReturn::ERROR; 44 | } 45 | 46 | if (params_.interface_names.empty()) 47 | { 48 | RCLCPP_ERROR(get_node()->get_logger(), "'interfaces' parameter is empty"); 49 | return controller_interface::CallbackReturn::ERROR; 50 | } 51 | 52 | for (const auto & joint : params_.joints) 53 | { 54 | for (const auto & interface : params_.interface_names) 55 | { 56 | command_interface_types_.push_back(joint + "/" + interface); 57 | } 58 | } 59 | 60 | return controller_interface::CallbackReturn::SUCCESS; 61 | } 62 | 63 | controller_interface::CallbackReturn JointGroupImpedanceController::on_init() 64 | { 65 | auto ret = ForwardControllersBase::on_init(); 66 | if (ret != CallbackReturn::SUCCESS) 67 | { 68 | return ret; 69 | } 70 | 71 | try 72 | { 73 | // Explicitly set the interfaces parameter declared by the 74 | // forward_command_controller 75 | get_node()->set_parameter(rclcpp::Parameter( 76 | "interface_names", 77 | std::vector<std::string>{ 78 | hardware_interface::HW_IF_STIFFNESS, hardware_interface::HW_IF_DAMPING})); 79 | } 80 | catch (const std::exception & e) 81 | { 82 | fprintf(stderr, "Exception thrown during init stage with message: %s \n", e.what()); 83 | return CallbackReturn::ERROR; 84 | } 85 | 86 | return CallbackReturn::SUCCESS; 87 | } 88 | } // namespace kuka_controllers 89 | 90 | PLUGINLIB_EXPORT_CLASS( 91 | kuka_controllers::JointGroupImpedanceController, controller_interface::ControllerInterface) 92 | -------------------------------------------------------------------------------- /kuka_drivers_core/src/control_node.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 KUKA Hungaria Kft. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include <memory> 16 | #include <thread> 17 | 18 | #include "controller_manager/controller_manager.hpp" 19 | #include "rclcpp/rclcpp.hpp" 20 | #include "std_msgs/msg/bool.hpp" 21 | 22 | int main(int argc, char ** argv) 23 | { 24 | rclcpp::init(argc, argv); 25 | auto executor = std::make_shared<rclcpp::executors::MultiThreadedExecutor>(); 26 | auto controller_manager = 27 | std::make_shared<controller_manager::ControllerManager>(executor, "controller_manager"); 28 | 29 | auto qos = rclcpp::QoS(rclcpp::KeepLast(1)); 30 | qos.best_effort(); 31 | 32 | std::atomic_bool is_configured = false; 33 | auto is_configured_sub = controller_manager->create_subscription<std_msgs::msg::Bool>( 34 | "robot_manager/is_configured", qos, 35 | [&is_configured](std_msgs::msg::Bool::SharedPtr msg) { is_configured = msg->data; }); 36 | 37 | std::thread control_loop( 38 | [controller_manager, &is_configured]() 39 | { 40 | struct sched_param param; 41 | param.sched_priority = 95; 42 | if (sched_setscheduler(0, SCHED_FIFO, ¶m) == -1) 43 | { 44 | RCLCPP_ERROR(controller_manager->get_logger(), "setscheduler error"); 45 | RCLCPP_ERROR(controller_manager->get_logger(), strerror(errno)); 46 | RCLCPP_WARN( 47 | controller_manager->get_logger(), 48 | "You can use the driver but scheduler priority was not set"); 49 | } 50 | 51 | const rclcpp::Duration dt = 52 | rclcpp::Duration::from_seconds(1.0 / controller_manager->get_update_rate()); 53 | std::chrono::milliseconds dt_ms{1000 / controller_manager->get_update_rate()}; 54 | 55 | try 56 | { 57 | while (rclcpp::ok()) 58 | { 59 | if (is_configured) 60 | { 61 | controller_manager->read(controller_manager->now(), dt); 62 | controller_manager->update(controller_manager->now(), dt); 63 | controller_manager->write(controller_manager->now(), dt); 64 | } 65 | else 66 | { 67 | controller_manager->update(controller_manager->now(), dt); 68 | std::this_thread::sleep_for(dt_ms); 69 | } 70 | } 71 | } 72 | catch (std::exception & e) 73 | { 74 | RCLCPP_ERROR( 75 | controller_manager->get_logger(), "Quitting control loop due to: %s", e.what()); 76 | } 77 | }); 78 | 79 | executor->add_node(controller_manager); 80 | 81 | executor->spin(); 82 | control_loop.join(); 83 | 84 | // shutdown 85 | rclcpp::shutdown(); 86 | 87 | return 0; 88 | } 89 | --------------------------------------------------------------------------------