Skip to content

Commit

Permalink
Feature/namespacing (#133)
Browse files Browse the repository at this point in the history
* add namespace to rsi driver

* pipe name

* workflow names

* add namespace

* fix ns

* fix service name

* fake hw

* ip param to launch arg

* modify robot model with ns

* add initial pos args

* rpy

* add qos config arg

* lint

* add qos config file arg

* configs

* robot manager ip param

* extend launch file with args

* modify base_link in example

* tf_prefix _

* config files for multi-robot test

* add config files as argument

* noqa

* add test file for multi-robot scenario

* fix timeout

* rviz config for multi-robot

* add multi-robot example

* add iisy11 to example

* remove duplicated codespell

* add rviz config argument to kss&sunrise launch files

* add config args for kss

* config file args for sunrise

* fix tf prefix

* add multi-robot tests for kss sunrise

* fix test

* launch arg simplify

* launch arg simplification 2

* multi-robot md

* iiqka config

* format

* iiqka launch arg md

* add controller_ip argument

* extend all mds

* fix ip config section

* fix config

* flake 8 noqa

---------

Co-authored-by: Aron Svastits <svastits1@gmail.com>
Co-authored-by: Komaromi Sándor <sanyi.komaromi@gmail.com>
  • Loading branch information
3 people authored Jan 10, 2024
1 parent 4bdc9df commit 5001bb6
Show file tree
Hide file tree
Showing 54 changed files with 1,424 additions and 158 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/industrial_ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI
name: ROS-Industrial CI
run-name: ROS-Industrial CI - ${{ github.event_name }}

# This determines when this workflow is run
# on: [push, pull_request] # on all pushes and PRs
Expand All @@ -23,6 +24,7 @@ on:

jobs:
industrial_ci:
name: ROS-Industrial CI
strategy:
matrix:
env:
Expand Down Expand Up @@ -55,14 +57,3 @@ jobs:
# Run industrial_ci
- uses: 'kroshu/industrial_ci@master'
env: ${{ matrix.env }}
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4.7.1
with:
python-version: '3.10'
- run: pip install git+https://github.com/codespell-project/codespell.git
- uses: codespell-project/actions-codespell@v2
with:
check_filenames: true
3 changes: 2 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# This is a format job. Pre-commit has a first-party GitHub action, so we use
# that: https://github.com/pre-commit/action

name: Format
name: Pre-commit format
run-name: Pre-commit format - ${{ github.event_name }}

on:
workflow_dispatch:
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ repos:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
args: [--line-length=99]

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
args: ["--max-line-length", "99"]

# PyDocStyle
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
Expand Down
4 changes: 4 additions & 0 deletions doc/wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ Note: the first three examples should be executed consequently (without restarti

Note: The examples need user interaction in `rviz`, the `Next` button (`RvizVisualToolsGui` tab) should be pressed each time the logs indicate it.

## Multi-robot scenario

As the robot controllers manage the timing of the drivers, it does not make sense to add more robots to the same control loop, as it would only lead to timeouts on the controller side. Therefore to start the drivers of multiple robots, all components has to be duplicated. This can be achieved by using the `namespace` argument of the launch files (which is available for all drivers) to avoid name collisions. This will add a namespace to all nodes and controllers of the driver and will also modify the `prefix` argument of the robot description macro to `namespace_`. To adapt to the new namespace and prefix, the configurations files of the driver must also be modified to reflect the new node and joint names. An example of this can found in the `iiqka_moveit_example` package, that starts two robots with `test1` and `test2` namespaces and modified configuration files.

## Detailed setup and startup instructions

For more detailed information about the drivers, visit the dedicated wiki pages for [KSS](https://github.com/kroshu/kuka_drivers/wiki/KSS_RSI), [Sunrise](https://github.com/kroshu/kuka_drivers/wiki/Sunrise_FRI) or [iiQKA](https://github.com/kroshu/kuka_drivers/wiki/iiQKA_EAC) robots.
16 changes: 15 additions & 1 deletion doc/wiki/KSS_RSI.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,16 @@ The following parameters must be set in the driver configuration file:

The KSS driver currently does not have runtime parameters. Control mode cannot be changed if the driver is running, as that also requires modifying the RSI context on the controller.

#### IP Configuration
The IP address of the client machine must be provided as a launch argument. For further information see section [launch arguments](#launch-arguments).

### Usage

#### Starting the driver

1. To start the driver, two launch file are available, with and without `rviz`. To launch (without `rviz`), run:
```
ros2 launch kuka_kss_rsi_driver startup.launch.py
ros2 launch kuka_kss_rsi_driver startup.launch.py client_ip:=0.0.0.0
```
- This starts the 3 core components of every driver (described in the *Non-real-time interface* section of the [project overview](Project%20overview.md)) and the following controllers:
- `joint_state_broadcaster` (no configuration file, all state interfaces are published)
Expand All @@ -115,8 +118,19 @@ On successful activation the brakes of the robot will be released and external c
##### Launch arguments
Both launch files support the following arguments:
- `client_ip`: IP address of the client machine
- `client_port`: port of the client machine (default: 59152)
- `robot_model` and `robot_family`: defines which robot to use. The available options for the valid model and family combinations can be found in the [readme](https://github.com/kroshu/kuka_robot_descriptions?tab=readme-ov-file#what-data-is-verified) of the `kuka_robot_descriptions` repository.
- `use_fake_hardware`: if true, the `mock_components/GenericSystem` will be used instead of the `KukaRSIHardwareInterface`. This enables trying out the driver without actual hardware.
- `namespace`: adds a namespace to all nodes and controllers of the driver, and modifies the `prefix` argument of the robot description macro to `namespace_`
- `x`, `y`, `z`: define the position of `base_link` relative to the `world` frame (default: [0, 0, 0])
- `roll`, `pitch`, `yaw`: define the orientation of `base_link` relative to the `world` frame (default: [0, 0, 0])
- `controller_config`: the location of the `ros2_control` configuration file (defaults to `kuka_kss_rsi_driver/config/ros2_controller_config.yaml`)
- `jtc_config`: the location of the configuration file for the `joint_trajectory_controller` (defaults to `kuka_kss_rsi_driver/config/joint_trajectory_controller_config.yaml`)
The `startup_with_rviz.launch.py` additionally contains one argument:
- `rviz_config`: the location of the `rviz` configuration file (defaults to `kuka_resources/config/"view_6_axis_urdf.rviz`)
#### Stopping external control
Expand Down
26 changes: 19 additions & 7 deletions doc/wiki/Sunrise_FRI.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@
#### Startup configuration

The following configuration files are available in the `config` directory of the package:
- `driver_config.yaml`: contains IP addresses and runtime parameters
- `driver_config.yaml`: : contains runtime parameters of the `robot_manager` node
- `ros2_controller_config.yaml`: contains the controller types for every controller name. Should be only modified if a different controller is to be used. The `configure_components_on_start` parameter should never be modified, which ensures that the hardware interface is not activated at startup.
- configuration files for specific controllers, for further information, see the documentation of the given controller
- `gpio_config.xacro`: contains the I/O setup of the system, but this was not tested yet

##### IP configuration
The following parameter must be set in the driver configuration file:
- `controller_ip`: IP address of the controller
The IP address of robot controller must be provided as a launch argument. For further information see section [launch arguments](#launch-arguments).

#### Runtime parameters
The parameters in the driver configuration file can be also changed during runtime using the parameter interface of the `robot_manager` node:
- `send_period_ms` (integer): this parameter defines the send rate in milliseconds (with which the controller sends robot state updates). It must be between 1 and 10 for control and can be only changed in `inactive` and `configuring` states.
- `receive_multiplier` (integer): this parameter defines the answer rate factor (the client should sends commands in every `receive_multiplier`*`send_period_ms` milliseconds). It must be at least 1 and can be only changed in `inactive` and `configuring` states.
- `control_mode`, `command_mode` (strings): control mode related parameters, which will be combined to support the defined enums. They cannot be changed in active state.
- `joint_damping`, `joint_stiffness` (double vectors): these parameters change the stiffness and damping attributes of joint impedance control mode. They will be removed after changing to using the `joint_group_impedance_controller` to adapt to conventions.
- `position_controller_name`: The name of the controller (string) that controls the `position` interface of the robot. It can't be changed in active state.
- `torque_controller_name`: The name of the controller (string) that controls the `effort` interface of the robot. It can't be changed in active state.

### Usage

Expand All @@ -38,11 +39,11 @@ The parameters in the driver configuration file can be also changed during runti
1. On the controller, start the uploaded robot application (ROS2_Control).
2. To start the driver, two launch file are available, with and without `rviz`. To launch (without `rviz`), run
```
ros2 launch kuka_iiqka_eac_driver startup.launch.py`
ros2 launch kuka_sunrise_fri_driver startup.launch.py controller_ip:=0.0.0.0
```
- This starts the 3 core components of every driver (described in the *Non-real-time interface* section of the [project overview](Project%20overview.md)) and the following controllers:
- `joint_state_broadcaster` (no configuration file, all state interfaces are published)
- `joint_trajectory_controller` ([configuration file](../../kuka_iiqka_eac_driver/config/joint_trajectory_controller_config.yaml))
- `joint_trajectory_controller` ([configuration file](../../kuka_sunrise_fri_driver/config/joint_trajectory_controller_config.yaml))
- [`fri_configuration_controller`](https://github.com/kroshu/kuka_controllers?tab=readme-ov-file#fri_configuration_controller) (no configuration file)
- [`fri_state_broadcaster`](https://github.com/kroshu/kuka_controllers?tab=readme-ov-file#fri_state_broadcaster) (no configuration file)
Expand All @@ -57,8 +58,19 @@ On successful activation the brakes of the robot will be released and external c
##### Launch arguments
Both launch files support the following argument:
- `controller_ip`: IP address of the robot controller
- `robot_model`: defines which LBR iiwa robot to use. Available options: `lbr_iiwa14_r820` (default)
- `use_fake_hardware`: if true, the `mock_components/GenericSystem` will be used instead of the `KukaRSIHardwareInterface`. This enables trying out the driver without actual hardware.
- `use_fake_hardware`: if true, the `mock_components/GenericSystem` will be used instead of the `KukaFRIHardwareInterface`. This enables trying out the driver without actual hardware.
- `namespace`: adds a namespace to all nodes and controllers of the driver, and modifies the `prefix` argument of the robot description macro to `namespace_`
- `x`, `y`, `z`: define the position of `base_link` relative to the `world` frame (default: [0, 0, 0])
- `roll`, `pitch`, `yaw`: define the orientation of `base_link` relative to the `world` frame (default: [0, 0, 0])
- `controller_config`: the location of the `ros2_control` configuration file (defaults to `kuka_sunrise_fri_driver/config/ros2_controller_config.yaml`)
- `jtc_config`: the location of the configuration file for the `joint_trajectory_controller` (defaults to `kuka_sunrise_fri_driver/config/joint_trajectory_controller_config.yaml`)
The `startup_with_rviz.launch.py` additionally contains one argument:
- `rviz_config`: the location of the `rviz` configuration file (defaults to `kuka_resources/config/"view_6_axis_urdf.rviz`)
#### Stopping external control
Expand All @@ -73,5 +85,5 @@ BEWARE, that this is a non-realtime process including lifecycle management, so t
- The control mode handling for the driver is not the one defined in the `kuka_drivers_core` package
- enum definition and controller switching logic is not used
- joint impedance control is not implemented properly using command interfaces
- I/O control was not tested at all
- I/O control was not tested
- Cartesian modes are not yet supported
37 changes: 25 additions & 12 deletions doc/wiki/iiQKA_EAC.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,37 @@

### Configuration

#### Startup configuration
#### Configuration files

The following configuration files are available in the `config` directory of the package:
- `driver_config.yaml`: contains IP addresses and runtime parameters
- `qos_profiles.yaml`: contains the configuration options for the QoS profile defining the connection quality (description later)
- `driver_config.yaml`: contains runtime parameters of the `robot_manager` node
- `qos_config.yaml`: contains the configuration options for the QoS profile defining the connection quality (description later)
- `ros2_controller_config.yaml`: contains the controller types for every controller name. Should be only modified if a different controller is to be used. The `configure_components_on_start` parameter should never be modified, which ensures that the hardware interface is not activated at startup.
- configuration files for specific controllers, for further information, see the documentation of the given controller
- configuration files for specific controllers (for further information, see the documentation of the given controller)

##### QoS profile configuration
It is possible to configure the required connection quality of external control using a QoS profile, which defines under which conditions should external control be terminated in case of packet losses. A packet is considered lost if the controller does not receive a command in 2.5 milliseconds after publishing the state. In case of a packet loss, extrapolation is used to optimize the robot behaviour, unless the limits defined in the profile are violated. Two limits can be defined:
- Consequent packet losses allowed, defined by `consequent_lost_packets` parameter, maximum value is 5
- Allowed packet losses in given timeframe: defined by `lost_packets_in_timeframe` (maximum value is 25) and `timeframe_ms` parameters, maximum ratio is 25/sec

##### IP configuration
The following parameters must be set in the driver configuration file:
- `client_ip`: IP address of the client machine
- `controller_ip`: KONI IP of the controller

#### Runtime parameters
The not IP-related parameters in the driver configuration file can be also changed during runtime using the parameter interface of the `robot_manager` node:
The parameters in the driver configuration file can be also changed during runtime using the parameter interface of the `robot_manager` node:
- `control_mode`: The enum value of the control mode should be given. It can be changed in all primary states, but in active state the brakes are always closed before control is started in a new mode.
- `position_controller_name`: The name of the controller (string) that controls the `position` interface of the robot. It can't be changed in active state.
- `impedance_controller_name`: The name of the controller (string) that controls the `stiffness` and `damping` interfaces of the robot. It can't be changed in active state.
- `torque_controller_name`: The name of the controller (string) that controls the `effort` interface of the robot. It can't be changed in active state.

#### IP Configuration
The IP address of the client machine and robot controller must be provided as a launch argument. For further information see section [launch arguments](#launch-arguments).

### Usage

#### Starting the driver

To start the driver, two launch file are available, with and without `rviz`. To launch (without `rviz`), run:

```
ros2 launch kuka_iiqka_eac_driver startup.launch.py
ros2 launch kuka_iiqka_eac_driver startup.launch.py client_ip:=0.0.0.0 controller_ip=0.0.0.0
```

This starts the 3 core components of every driver (described in the *Non-real-time interface* section of the [project overview](Project%20overview.md)) and the following controllers:
Expand All @@ -70,8 +68,23 @@ On successful activation the brakes of the robot will be released and external c

##### Launch arguments

Both launch files support the following argument:
Both launch files support the following arguments:
- `client_ip`: IP address of the client machine
- `controller_ip`: KONI IP of the controller
- `robot_model`: defines which LBR iisy robot to use. Available options: `lbr_iisy3_r760` (default), `lbr_iisy11_r1300`, `lbr_iisy15_r930`
- `use_fake_hardware`: if true, the `mock_components/GenericSystem` will be used instead of the `KukaEACHardwareInterface`. This enables trying out the driver without actual hardware.
- `namespace`: adds a namespace to all nodes and controllers of the driver, and modifies the `prefix` argument of the robot description macro to `namespace_`
- `x`, `y`, `z`: define the position of `base_link` relative to the `world` frame (default: [0, 0, 0])
- `roll`, `pitch`, `yaw`: define the orientation of `base_link` relative to the `world` frame (default: [0, 0, 0])
- `qos_config`: the location of the QoS configuration file (defaults to `kuka_iiqka_eac_driver/config/qos_config.yaml`)
- `controller_config`: the location of the `ros2_control` configuration file (defaults to `kuka_iiqka_eac_driver/config/ros2_controller_config.yaml`)
- `jtc_config`: the location of the configuration file for the `joint_trajectory_controller` (defaults to `kuka_iiqka_eac_driver/config/joint_trajectory_controller_config.yaml`)
- `jic_config`: the location of the configuration file for the `joint_impedance_controller` (defaults to `kuka_iiqka_eac_driver/config/joint_impedance_controller_config.yaml`)
- `ec_config`: the location of the configuration file for the `effort_controller` (defaults to `kuka_iiqka_eac_driver/config/effort_controller_config.yaml`)


The `startup_with_rviz.launch.py` additionally contains one argument:
- `rviz_config`: the location of the `rviz` configuration file (defaults to `kuka_resources/config/"view_6_axis_urdf.rviz`)

#### Stopping external control

Expand Down
Loading

0 comments on commit 5001bb6

Please sign in to comment.