Skip to content

Commit

Permalink
Merge branch 'master' into robot-description-in-arg-66
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl authored Aug 14, 2024
2 parents daf0f55 + 41d9e74 commit adb5f26
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 32 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

ROS2 Distro | Branch | Build status | Documentation | Released packages
:---------: | :----: | :----------: | :-----------: | :---------------:
**Rolling** | [`rolling`](https://github.com/ros-controls/kinematics_interface/tree/rolling) | [![Rolling Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build.yml?branch=master) <br /> [![Rolling Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build.yml?branch=master) <br /> [![Rolling Source Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-source-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-source-build.yml?branch=master) | [API](http://docs.ros.org/en/rolling/p/kinematics_interface/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#rolling)
**Rolling** | [`master`](https://github.com/ros-controls/kinematics_interface/tree/master) | [![Rolling Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build.yml?branch=master) <br /> [![Rolling Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build.yml?branch=master) <br /> [![Rolling Source Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-source-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-source-build.yml?branch=master) | [API](http://docs.ros.org/en/rolling/p/kinematics_interface/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#rolling)
**Jazzy** | [`master`](https://github.com/ros-controls/kinematics_interface/tree/master) | see above | [API](http://docs.ros.org/en/jazzy/p/kinematics_interface/) [API kdl](http://docs.ros.org/en/jazzy/p/kinematics_interface_kdl/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#jazzy)
**Iron** | [`master`](https://github.com/ros-controls/kinematics_interface/tree/master) | see above | [API](http://docs.ros.org/en/iron/p/kinematics_interface/) [API kdl](http://docs.ros.org/en/iron/p/kinematics_interface_kdl/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#iron)
**Humble** | [`humble`](https://github.com/ros-controls/kinematics_interface/tree/humble) | [![Humble Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build.yml?branch=master) <br /> [![Humble Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build.yml?branch=master) <br /> [![Humble Source Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-source-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-source-build.yml?branch=master) | [API](http://docs.ros.org/en/humble/p/kinematics_interface/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#humble)

### Explanation of different build types
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/humble-coverage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ jobs:
secrets: inherit
with:
ros_distro: humble
os_name: ubuntu-22.04
7 changes: 1 addition & 6 deletions .github/workflows/humble-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,5 @@ on:
jobs:
pre-commit:
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [humble]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
os_name: ubuntu-22.04
ros_distro: humble
1 change: 1 addition & 0 deletions .github/workflows/humble-source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
ros_distro: ${{ matrix.ROS_DISTRO }}
ref: master
ros2_repo_branch: ${{ matrix.ROS_DISTRO }}
os_name: ubuntu-22.04
2 changes: 1 addition & 1 deletion .github/workflows/rolling-abi-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling, iron]
ROS_DISTRO: [rolling, jazzy, iron]
steps:
- uses: actions/checkout@v4
- uses: ros-industrial/industrial_ci@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rolling-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling, iron]
ROS_DISTRO: [rolling, jazzy, iron]
ROS_REPO: [main, testing]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rolling-coverage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ jobs:
secrets: inherit
with:
ros_distro: rolling
os_name: ubuntu-22.04
2 changes: 1 addition & 1 deletion .github/workflows/rolling-debian-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling, iron]
ROS_DISTRO: [rolling, jazzy, iron]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
upstream_workspace: kinematics_interface.${{ matrix.ROS_DISTRO }}.repos
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/rolling-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling, iron]
ROS_DISTRO: [iron, jazzy, rolling]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
os_name: ubuntu-22.04
2 changes: 1 addition & 1 deletion .github/workflows/rolling-rhel-semi-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling, iron]
ROS_DISTRO: [rolling, jazzy, iron]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
upstream_workspace: kinematics_interface.${{ matrix.ROS_DISTRO }}.repos
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rolling-semi-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling, iron]
ROS_DISTRO: [rolling, jazzy, iron]
ROS_REPO: [main, testing]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/rolling-source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling, iron]
include:
- ROS_DISTRO: iron
CONTAINER: ""
OS_NAME: ubuntu-22.04
- ROS_DISTRO: jazzy
CONTAINER: ubuntu:24.04
OS_NAME: ubuntu-latest
- ROS_DISTRO: rolling
CONTAINER: ubuntu:24.04
OS_NAME: ubuntu-latest
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
ref: master
ros2_repo_branch: ${{ matrix.ROS_DISTRO }}
os_name: ${{ matrix.OS_NAME }}
container: ${{ matrix.CONTAINER }}
2 changes: 1 addition & 1 deletion .github/workflows/update-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Auto Update pre-commit
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Run every Sunday at midnight
- cron: '0 0 1 * *' # Runs at 00:00, on day 1 of the month

jobs:
auto_update_and_create_pr:
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ repos:

# Python hooks
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py36-plus]
Expand All @@ -49,20 +49,20 @@ repos:
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]

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

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
args: ["--extend-ignore=E501"]

# CPP hooks
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.3
rev: v18.1.8
hooks:
- id: clang-format
args: ['-fallback-style=none', '-i']
Expand Down Expand Up @@ -124,14 +124,14 @@ repos:
# Spellcheck in comments and docs
# skipping of *.svg files is not working...
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: ['--write-changes']
exclude: CHANGELOG\.rst|\.(svg|pyc)$

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.1
rev: 0.29.1
hooks:
- id: check-github-workflows
args: ["--verbose"]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This is a ROS 2 package for using C++ kinematics frameworks in the context of RO
ROS2 Distro | Branch | Build status | Documentation | Released packages
:---------: | :----: | :----------: | :-----------: | :---------------:
**Rolling** | [`master`](https://github.com/ros-controls/kinematics_interface/tree/master) | [![Rolling Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build.yml) <br /> [![Rolling Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build.yml) | [API](http://docs.ros.org/en/rolling/p/kinematics_interface/) [API kdl](http://docs.ros.org/en/rolling/p/kinematics_interface_kdl/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#rolling)
**Jazzy** | [`master`](https://github.com/ros-controls/kinematics_interface/tree/master) | see above | [API](http://docs.ros.org/en/jazzy/p/kinematics_interface/) [API kdl](http://docs.ros.org/en/jazzy/p/kinematics_interface_kdl/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#jazzy)
**Iron** | [`master`](https://github.com/ros-controls/kinematics_interface/tree/master) | see above | [API](http://docs.ros.org/en/iron/p/kinematics_interface/) [API kdl](http://docs.ros.org/en/iron/p/kinematics_interface_kdl/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#iron)
**Humble** | [`humble`](https://github.com/ros-controls/kinematics_interface/tree/humble) | [![Humble Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build.yml/badge.svg?branch=humble)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build.yml) <br /> [![Humble Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build.yml/badge.svg?branch=humble)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build.yml) | [API](http://docs.ros.org/en/humble/p/kinematics_interface/) [API kdl](http://docs.ros.org/en/humble/p/kinematics_interface_kdl/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#humble)

Expand Down
6 changes: 6 additions & 0 deletions kinematics_interface-not-released.jazzy.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repositories:
## EXAMPLE DEPENDENCY
# <some_ros_package>:
# type: git
# url: [email protected]:<some_github_namespace>/<some_ros_package>.git
# version: master
5 changes: 5 additions & 0 deletions kinematics_interface.jazzy.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repositories:
ros2_control:
type: git
url: https://github.com/ros-controls/ros2_control.git
version: master
5 changes: 5 additions & 0 deletions kinematics_interface/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package kinematics_interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.1.0 (2024-05-20)
------------------
* Use CMake targets for eigen (`#50 <https://github.com/ros-controls/kinematics_interface/issues/50>`_)
* Contributors: Christoph Fröhlich

1.0.0 (2023-11-16)
------------------
* Use a dynamic library instead of header-only (`#21 <https://github.com/ros-controls/kinematics_interface/issues/21>`_)
Expand Down
2 changes: 1 addition & 1 deletion kinematics_interface/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>kinematics_interface</name>
<version>1.0.0</version>
<version>1.1.0</version>
<description>Kinematics interface for ROS 2 control</description>
<maintainer email="[email protected]">Denis Štogl</maintainer>
<maintainer email="[email protected]">Bence Magyar</maintainer>
Expand Down
6 changes: 6 additions & 0 deletions kinematics_interface_kdl/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog for package kinematics_interface_kdl
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.1.0 (2024-05-20)
------------------
* Read base parameter in initialize function (`#73 <https://github.com/ros-controls/kinematics_interface/issues/73>`_)
* Use CMake targets for eigen (`#50 <https://github.com/ros-controls/kinematics_interface/issues/50>`_)
* Contributors: Bence Magyar, Christoph Fröhlich

1.0.0 (2023-11-16)
------------------
* 🤔 Remove compile warnings and unify for-loop syntax. (`#15 <https://github.com/ros-controls/kinematics_interface/issues/15>`_)
Expand Down
2 changes: 1 addition & 1 deletion kinematics_interface_kdl/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>kinematics_interface_kdl</name>
<version>1.0.0</version>
<version>1.1.0</version>
<description>KDL implementation of ros2_control kinematics interface</description>
<maintainer email="[email protected]">Bence Magyar</maintainer>
<maintainer email="[email protected]">Denis Štogl</maintainer>
Expand Down
25 changes: 19 additions & 6 deletions kinematics_interface_kdl/src/kinematics_interface_kdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ bool KinematicsInterfaceKDL::initialize(
{
// track initialization plugin
initialized = true;

// get parameters
std::string ns = !param_namespace.empty() ? param_namespace + "." : "";

std::string robot_description_local;
if (robot_description.empty())
{
// If the robot_description input argument is empty, try to get the
// robot_description from the node's parameters.
auto robot_param = rclcpp::Parameter();
if (!parameters_interface->get_parameter(param_namespace + "robot_description", robot_param))
if (!parameters_interface->get_parameter(ns + "robot_description", robot_param))
{
RCLCPP_ERROR(LOGGER, "parameter robot_description not set in kinematics_interface_kdl");
return false;
Expand All @@ -46,8 +49,6 @@ bool KinematicsInterfaceKDL::initialize(
robot_description_local = robot_description;
}

// get parameters
std::string ns = !param_namespace.empty() ? param_namespace + "." : "";
// get alpha damping term
auto alpha_param = rclcpp::Parameter("alpha", 0.000005);
if (parameters_interface->has_parameter(ns + "alpha"))
Expand All @@ -57,16 +58,28 @@ bool KinematicsInterfaceKDL::initialize(
alpha = alpha_param.as_double();
// get end-effector name
auto end_effector_name = rclcpp::Parameter("tip", "MISSING_END_EFFECTOR_NAME");
if (parameters_interface->has_parameter(ns + "tip"))
if (parameters_interface->has_parameter(param_namespace + "tip"))
{
parameters_interface->get_parameter(ns + "tip", end_effector_name);
}

// create kinematic chain
KDL::Tree robot_tree;
kdl_parser::treeFromString(robot_description_local, robot_tree);
root_name_ = robot_tree.getRootSegment()->first;
if (!robot_tree.getChain(root_name_, end_effector_name.as_string(), chain_))

// get root name
auto base_param = rclcpp::Parameter();
if (parameters_interface->has_parameter(ns + "base"))
{
parameters_interface->get_parameter(ns + "base", base_param);
root_name_ = base_param.as_string();
}
else
{
root_name_ = robot_tree.getRootSegment()->first;
}

if (!robot_tree.getChain(root_name_, end_effector_name, chain_))
{
RCLCPP_ERROR(
LOGGER, "failed to find chain from robot root %s to end effector %s", root_name_.c_str(),
Expand Down

0 comments on commit adb5f26

Please sign in to comment.