Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ros2 control support package added #12

Open
wants to merge 47 commits into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2749aab
created new package 'kuka_ros2_control_support'
Feb 27, 2023
6f903b8
single ros2_control launch file for all of the kuka robots except 'k…
Feb 27, 2023
2b6cc2d
moved common_macro.ros2_control.xacro to kuka_ros2_control_support
Feb 27, 2023
68d98c4
making base kuka files independent of ros2_control
Feb 27, 2023
96f9e52
making base kuka files independent of ros2_control-2
Feb 27, 2023
dcca250
common xacro and ros2_controlxacro
Feb 28, 2023
814e1e2
functional ros2_control support for kuka base models
Feb 28, 2023
aaa2b63
correction
Feb 28, 2023
84fd1c7
removed unused xacro
Mar 2, 2023
18455fa
removed dependency not needed in ros2
Mar 3, 2023
2bbd567
removed arguments not necessary
Mar 2, 2023
8b2bcaa
[URDF] Adding inertial and using `find` for getting package paths for…
Robotgir Mar 3, 2023
72a109e
ran pre-commit for all ecept *_rsi_* pkgs
Mar 4, 2023
63cd2f5
Update kuka_ros2_control_support/urdf/common_kuka.xacro
Robotgir Mar 4, 2023
b35a8e2
Update kuka_ros2_control_support/urdf/common_macro.ros2_control.xacro
Robotgir Mar 4, 2023
a448b1b
Apply suggestions from code review
Robotgir Mar 4, 2023
1baa52d
included kuka_lbr in the comman launch and xacro files
Mar 4, 2023
ae644a9
ran-precommit
Mar 4, 2023
699f5de
kuka_ros2_control_support, complete macro including gazebo plugins
Mar 6, 2023
efe1a0a
Merge branch 'rolling' into ros2_control_support_package_added
Robotgir Mar 11, 2023
8d4bad6
removed unused xacro and added one useful
Mar 2, 2023
06f0e0f
corrections
Mar 11, 2023
7e22296
updated readme on how to use
Mar 17, 2023
7ef5835
Update README.md
Robotgir Mar 17, 2023
363e273
Apply suggestions from code review
destogl Mar 27, 2023
669018b
added test for kuka_ros2_control_support
muritane Mar 28, 2023
294580d
pre-commit changes for ros2_control_support_test
muritane Mar 28, 2023
3740da9
added initial_positions_file arg
Apr 4, 2023
8d71b5b
add control node and ip address/port options
mamueluth Apr 4, 2023
df54ab6
Merge branch 'rolling' into ros2_control_support_package_added
destogl Apr 4, 2023
e67614c
add joint trajecotry controller goals publisher
mamueluth Apr 7, 2023
97a8802
Update first part of the readme file.
destogl May 8, 2023
2a6059c
Removing, cleaning, renaming and moving configuration files.
destogl May 8, 2023
4304d5e
Revert some file and optimize CMakeLists.txt
destogl May 9, 2023
10fb2d8
Some cleanups.
destogl May 9, 2023
7d6bf22
Cleaning.
destogl May 9, 2023
a7fa385
ros2 control support test works
muritane May 19, 2023
0ff20d8
added joint trajectory test
muritane May 20, 2023
174d386
Update kuka_ros2_control_support/test/ros2_control_support.py
muritane May 26, 2023
f88076e
Update initial_positions_all_zeros.yaml
muritane May 26, 2023
ea2b5f7
add tests for joint and traj state retrieval, init_pos arg, start_rvi…
muritane May 26, 2023
0e7f143
[test_bringup.launch.py] set use_mock_hardware default to true
muritane May 30, 2023
9d6b587
Added a tcp transform test to validate RSP and TFs
gwalck May 30, 2023
d53d9cd
Moved tf_listener to func to avoid thread issues
gwalck May 30, 2023
4d370a1
Added missing line to cleanly initialize executor
gwalck Jun 1, 2023
a50234a
Working with Mock Hardware.
destogl May 9, 2023
33961eb
Cleanup more files.
destogl Jun 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ msg/_.*\.py$

\.pcd$
.pyc$
**/__pycache__/

# Generated by dynamic reconfigure
\.cfgc$
Expand Down
166 changes: 161 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@

# Kuka experimental

[![Build Status: Ubuntu Bionic (Actions)](https://github.com/ros-industrial/kuka_experimental/workflows/CI%20-%20Ubuntu%20Bionic/badge.svg?branch=melodic-devel)](https://github.com/ros-industrial/kuka_experimental/actions?query=workflow%3A%22CI+-+Ubuntu+Bionic%22)
[![Build Status: Ubuntu Focal (Actions)](https://github.com/ros-industrial/kuka_experimental/workflows/CI%20-%20Ubuntu%20Focal/badge.svg?branch=melodic-devel)](https://github.com/ros-industrial/kuka_experimental/actions?query=workflow%3A%22CI+-+Ubuntu+Focal%22)

[![support level: community](https://img.shields.io/badge/support%20level-community-lightgray.svg)](http://rosindustrial.org/news/2016/10/7/better-supporting-a-growing-ros-industrial-software-platform)

Experimental packages for Kuka manipulators within [ROS-Industrial][].
See the [ROS wiki][] page for more information.

## Contents

This repository contains packages that will be migrated to the [kuka][]
repository after they have received sufficient testing. The contents of
these packages are subject to change, without prior notice. Any available
Expand All @@ -21,6 +16,16 @@ and / or functional.
[ROS wiki]: http://wiki.ros.org/kuka_experimental
[kuka]: https://github.com/ros-industrial/kuka

## Contents

KUKA is one the major robot manufacturers in the world. Therefore, KUKA robots can be found in many industrial applications and research labs.

This branch contains ROS 2 version of the driver supporting new features enabled by ROS 2, such as decreased latency, improved security, and more flexibility regarding middleware configuration.
The repository contains descriptions for many KUKA manipulators, ros2_control support for RSI and EKI Protocols to control the robot, as well as generic MoveIt2 setup to get you started.

[//]: <> (TODO: I you want to learn more check the videos and presentation about the repository:)


## Build status

ROS2 Distro | Branch | Build status | Documentation | Released packages
Expand All @@ -44,3 +49,154 @@ ROS2 Distro | Branch | Build status | Documentation | Released packages
Uses repos file: `$NAME$.repos`

1. Source build - also core ROS packages are build from source. It shows potential issues in the mid future.


## Packages in the Repository:

- `kuka_experimental` - Meta package that provides a single point of installation for the released packages.
- `kuka_eki_hw_interface` - Hardware interface implementation for ros2_control based on EKI communication protocol.
- `kuka_rsi_hw_interface` - Hardware interface implementation for ros2_control based on RSI communication protocol.
- `kuka_resources` - Shared resources across support packages, e.g., rviz configuration, launch files, and URDF properties (colors, materials, math constants), etc.
- `kuka_ros2_control_support` - Support files for using KUKA with ros2_control.
- `kuka_rsi_simulator` - Simple simulator of RSI communication that is useful for driver testing without connected hardware.

- **support packages** - descriptions, meshes and test-launch file for different versions of KUKA manipulators.

- `kuka_kr3_support`
- `kuka_kr5_support`
- `kuka_kr6_support`
- `kuka_kr10_support`
- `kuka_kr16_support`
- `kuka_kr120_support`
- `kuka_kr150_support`
- `kuka_kr210_support`
- `kuka_lbr_iiwa_support` - *NOT tested extensively! Note that there are packages with possibly better support!*


## Getting Started

For getting started to use this driver you have to follow the next steps:

1. **Install the driver** (see below). Currently only install from source is supported.

2. **Setup the robot**. Once driver is installed, decide which interface, RSI or EKI, you want to use and [check instructions for RSI interface](./kuka_rsi_hw_interface/krl/README.md) or [check instructions for EKI interface](./kuka_eki_hw_interface/krl/README.md).

3. **Start the driver** (see below).


### Build from Source

Before building from source please make sure that you actually need to do that. Building from source
might require some special treatment, especially when it comes to dependency management.
Dependencies might change from time to time. Upstream packages might change
their features / API which require changes in this repo. Therefore, this repo's source builds might
require upstream repositories to be present in a certain version as otherwise builds might fail.
Starting from scratch following exactly the steps below should always work, but simply pulling and
building might fail occasionally.

1. [Install ROS2](https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html).
For using this driver with ROS2 `foxy`. Checkout [foxy
branch](https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/foxy), for using it
with ROS2 ``humble``, use the [humble branch](https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/humble),
and for using it with ROS2 ``rolling``, use the [rolling
branch](https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/rolling).

Once installed, please make sure to actually [source ROS2](https://docs.ros.org/en/rolling/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#source-the-setup-files) before proceeding.

3. Make sure that `colcon`, its extensions and `vcs` are installed:
```
sudo apt install python3-colcon-common-extensions python3-vcstool
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

4. Create a new ROS2 workspace:
```
export COLCON_WS=~/workspace/ros2_kuka_driver
mkdir -p $COLCON_WS/src
```

5. Clone relevant packages, install dependencies, compile, and source the workspace by using:
```
cd $COLCON_WS
git clone https://github.com/StoglRobotics-forks/kuka_experimental.git src/kuka_experimental
vcs import src --skip-existing --input src/kuka_experimental/kuka_experimental-not-released.${ROS_DISTRO}.repos
rosdep update
rosdep install --ignore-src --from-paths src -y
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
source install/setup.bash
```

6. When consecutive pulls leads to build errors, please make sure to update the upstream packages before
filing an issue:
```
cd $COLCON_WS
vcs import src --skip-existing --input src/Universal_Robots_ROS2_Driver/Universal_Robots_ROS2_Driver-not-released.${ROS_DISTRO}.repos
rosdep update
rosdep install --ignore-src --from-paths src -y
```


### Starting the driver

1. Start *Mock Hardware* first to see how the system is setup (example for `KR5 arc`):
```
ros2 launch kuka_ros2_control_support test_bringup.launch.py description_package:=kuka_kr5_support description_macro_file:=kr5_arc_macro.xacro use_mock_hardware:=true
```
Now check started nodes, available topics and services.

2. Start test node for joint trajectory controller:
```
ros2 launch kuka_ros2_control_support test_joint_trajectory_controller.launch.py
```

3. To start other robot type use the following arguments:
```
"description_package",
choices=[
"kuka_kr3_support",
"kuka_kr5_support",
"kuka_kr6_support",
"kuka_kr10_support",
"kuka_kr16_support",
"kuka_kr120_support",
"kuka_kr150_support",
"kuka_kr210_support",
"kuka_lbr_iiwa_support",
]

"description_macro_file",
choices=[
"kr3r540_macro.xacro",
"kr5_arc_macro.xacro",
"kr6r700sixx_macro.xacro",
"kr6r900_2_macro.xacro",
"kr6r900sixx_macro.xacro",
"kr10r900_2_macro.xacro",
"kr10r1100sixx_macro.xacro",
"kr10r1420_macro.xacro",
"kr16_2_macro.xacro",
"kr120r2500pro_macro.xacro",
"kr150_2_macro.xacro",
"kr150r3100_2_macro.xacro",
"kr210l150_macro.xacro",
"lbr_iiwa_14_r820_macro.xacro",
]

"controllers_file",
choices=[
"kuka_6dof_controllers.yaml",
"kuka_7dof_controllers.yaml",
# Note: for the robot kuka_lbr_iiwa_14_r820, kuka_7dof_controllers.yaml should be used
# and the rest use kuka_6dof_controllers.yaml
]

```
**NOTE: Please choose only the related combination of the various parameters.**

4. Start the real hardware using the following arguments on `test_bringup.launch.py`:
```
use_rsi_communication:=true rsi_listen_ip:=<IP_OF_PC_IN_RSI_Network> rsi_listen_port:=49152
```
You can omit `rsi_listen_port` if you didn't change it in the robots configuration.
For example:
```
```
1 change: 0 additions & 1 deletion kuka_eki_hw_interface/config/controller_joint_names.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions kuka_eki_hw_interface/config/hardware_controllers.yaml

This file was deleted.

36 changes: 36 additions & 0 deletions kuka_eki_hw_interface/config/hardware_controllers_6dof.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
controller_manager:
ros__parameters:

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

position_trajectory_controller:
type: joint_trajectory_controller/JointTrajectoryController


position_trajectory_controller:
ros__parameters:

joints:
- joint_a1
- joint_a2
- joint_a3
- joint_a4
- joint_a5
- joint_a6

command_interfaces:
- position

state_interfaces:
- position

state_publish_rate: 2.0 # Defaults to 50
action_monitor_rate: 2.0 # Defaults to 20

allow_partial_joints_goal: false # Defaults to false
open_loop_control: true
allow_integration_in_goal_trajectories: true
constraints:
stopped_velocity_tolerance: 0.01 # Defaults to 0.01
goal_time: 0.0 # Defaults to 0.0 (start immediately)
37 changes: 37 additions & 0 deletions kuka_eki_hw_interface/config/hardware_controllers_7dof.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
controller_manager:
ros__parameters:

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

position_trajectory_controller:
type: joint_trajectory_controller/JointTrajectoryController


position_trajectory_controller:
ros__parameters:

joints:
- joint_a1
- joint_a2
- joint_a3
- joint_a4
- joint_a5
- joint_a6
- joint_a7

command_interfaces:
- position

state_interfaces:
- position

state_publish_rate: 2.0 # Defaults to 50
action_monitor_rate: 2.0 # Defaults to 20

allow_partial_joints_goal: false # Defaults to false
open_loop_control: true
allow_integration_in_goal_trajectories: true
constraints:
stopped_velocity_tolerance: 0.01 # Defaults to 0.01
goal_time: 0.0 # Defaults to 0.0 (start immediately)
13 changes: 8 additions & 5 deletions kuka_experimental.foxy.repos
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
repositories:
## EXAMPLE DEPENDENCY
# <some_ros_package>:
# type: git
# url: [email protected]:<some_github_namespace>/<some_ros_package>.git
# version: master
ros2_control:
type: git
url: https://github.com/ros-controls/ros2_control.git
version: foxy
ros2_controllers:
type: git
url: https://github.com/ros-controls/ros2_controllers.git
version: foxy
13 changes: 8 additions & 5 deletions kuka_experimental.rolling.repos
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
repositories:
## EXAMPLE DEPENDENCY
# <some_ros_package>:
# type: git
# url: [email protected]:<some_github_namespace>/<some_ros_package>.git
# version: master
ros2_control:
type: git
url: https://github.com/ros-controls/ros2_control.git
version: master
ros2_controllers:
type: git
url: https://github.com/ros-controls/ros2_controllers.git
version: master
6 changes: 4 additions & 2 deletions kuka_experimental/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<author>Shaun Edwards</author>
<maintainer email="[email protected]">G.A. vd. Hoorn (TU Delft Robotics Institute)</maintainer>
<license>BSD</license>
<maintainer email="[email protected]">Dr. Denis Štogl (Stogl Robotics Consulting)</maintainer>
<license>BSD</license>

<url type="website">http://wiki.ros.org/kuka_experimental</url>
<url type="bugtracker">https://github.com/ros-industrial/kuka_experimental/issues</url>
Expand All @@ -23,8 +25,8 @@
<exec_depend>kuka_kr6_support</exec_depend>
<exec_depend>kuka_lbr_iiwa_support</exec_depend>
<exec_depend>kuka_resources</exec_depend>
<!--<exec_depend>kuka_rsi_hw_interface</exec_depend>-->
<exec_depend>kuka_eki_hw_interface</exec_depend>
<exec_depend>kuka_ros2_control_support</exec_depend>
<!-- <exec_depend>kuka_eki_hw_interface</exec_depend> -->
<exec_depend>kuka_rsi_hw_interface</exec_depend>
<exec_depend>kuka_rsi_simulator</exec_depend>

Expand Down
3 changes: 1 addition & 2 deletions kuka_kr10_support/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.16)

project(kuka_kr10_support LANGUAGES CXX)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
Expand All @@ -10,7 +9,7 @@ find_package(ament_cmake REQUIRED)


install(
DIRECTORY config launch meshes urdf
DIRECTORY launch meshes urdf
DESTINATION share/${PROJECT_NAME}
)

Expand Down
1 change: 0 additions & 1 deletion kuka_kr10_support/config/joint_names_kr10r1100sixx.yaml

This file was deleted.

1 change: 0 additions & 1 deletion kuka_kr10_support/config/joint_names_kr10r1420.yaml

This file was deleted.

1 change: 0 additions & 1 deletion kuka_kr10_support/config/joint_names_kr10r900_2.yaml

This file was deleted.

Loading