Skip to content

Commit

Permalink
Merge branch 'ros-controls:master' into feature/issue-815-hardware-in…
Browse files Browse the repository at this point in the history
…terface-add-return-value
  • Loading branch information
flochre authored Apr 8, 2023
2 parents ce1b1f6 + e7366d0 commit 93763c5
Show file tree
Hide file tree
Showing 88 changed files with 1,965 additions and 1,001 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-coverage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
env:
ROS_DISTRO: rolling
steps:
- uses: ros-tooling/setup-ros@0.5.0
- uses: ros-tooling/setup-ros@0.6.1
with:
required-ros-distributions: ${{ env.ROS_DISTRO }}
- uses: actions/checkout@v3
- uses: ros-tooling/action-ros-ci@0.2.7
- uses: ros-tooling/action-ros-ci@0.3.0
with:
target-ros2-distro: ${{ env.ROS_DISTRO }}
import-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-ros-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
linter: [cppcheck, copyright, lint_cmake]
steps:
- uses: actions/checkout@v3
- uses: ros-tooling/setup-ros@0.5.0
- uses: ros-tooling/setup-ros@0.6.1
- uses: ros-tooling/[email protected]
with:
distribution: rolling
Expand All @@ -36,7 +36,7 @@ jobs:
linter: [cpplint]
steps:
- uses: actions/checkout@v3
- uses: ros-tooling/setup-ros@0.5.0
- uses: ros-tooling/setup-ros@0.6.1
- uses: ros-tooling/[email protected]
with:
distribution: rolling
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
Expand All @@ -42,7 +42,7 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand All @@ -62,7 +62,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
Expand All @@ -82,7 +82,7 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-ros-tooling-source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: ros-tooling/setup-ros@0.5.0
- uses: ros-tooling/setup-ros@0.6.1
with:
required-ros-distributions: ${{ inputs.ros_distro }}
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- uses: ros-tooling/action-ros-ci@0.2.7
- uses: ros-tooling/action-ros-ci@0.3.0
with:
target-ros2-distro: ${{ inputs.ros_distro }}
# build all packages listed in the meta package
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reviewer_lottery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: uesteibar/reviewer-lottery@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/rolling-abi-compatibility.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/workflows/rolling-rhel-binary-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Rolling RHEL Binary Build
on:
workflow_dispatch:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
Expand Down
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ repos:

# PyDocStyle
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.2.2
rev: 6.3.0
hooks:
- id: pydocstyle
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]

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

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
Expand Down Expand Up @@ -117,7 +123,7 @@ repos:
exclude: CHANGELOG\.rst$

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
- id: rst-backticks
exclude: CHANGELOG\.rst$
Expand Down
12 changes: 12 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Migration Notes

API changes in ros2_control releases

## ROS Rolling

#### Controller Interface

`update_reference_from_subscribers()` method got parameters and now has the following signature:
```
update_reference_from_subscribers(const rclcpp::Time & time, const rclcpp::Duration & /*period*/)
```
25 changes: 25 additions & 0 deletions controller_interface/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
Changelog for package controller_interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

3.12.0 (2023-04-02)
-------------------
* [Controller Interface] Add time and period paramters to update_reference_from_subscribers() (`#846 <https://github.com/ros-controls/ros2_control/issues/846>`_) #API-break
* Contributors: Robotgir, Denis Štogl

3.11.0 (2023-03-22)
-------------------
* [ControllerManager] Add Class for Async Controllers and Lifecycle Management (`#932 <https://github.com/ros-controls/ros2_control/issues/932>`_)
* Contributors: Márk Szitanics

3.10.0 (2023-03-16)
-------------------

3.9.1 (2023-03-09)
------------------

3.9.0 (2023-02-28)
------------------

3.8.0 (2023-02-10)
------------------
* Fix CMake install so overriding works (`#926 <https://github.com/ros-controls/ros2_control/issues/926>`_)
* Async params (`#927 <https://github.com/ros-controls/ros2_control/issues/927>`_)
* Contributors: Márk Szitanics, Tyler Weaver

3.7.0 (2023-01-24)
------------------

Expand Down
120 changes: 52 additions & 68 deletions controller_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,104 +1,88 @@
cmake_minimum_required(VERSION 3.5)
project(controller_interface)
cmake_minimum_required(VERSION 3.16)
project(controller_interface LANGUAGES CXX)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
hardware_interface
rclcpp_lifecycle
)

find_package(ament_cmake REQUIRED)
find_package(hardware_interface REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()

add_library(
${PROJECT_NAME}
SHARED
add_library(controller_interface SHARED
src/controller_interface_base.cpp
src/controller_interface.cpp
src/chainable_controller_interface.cpp
)
target_include_directories(
${PROJECT_NAME}
PRIVATE
include
)
ament_target_dependencies(
${PROJECT_NAME}
hardware_interface
rclcpp_lifecycle
target_compile_features(controller_interface PUBLIC cxx_std_17)
target_include_directories(controller_interface PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/controller_interface>
)
ament_target_dependencies(controller_interface PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS})
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${PROJECT_NAME} PRIVATE "CONTROLLER_INTERFACE_BUILDING_DLL")

install(DIRECTORY include/
DESTINATION include
)
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
target_compile_definitions(controller_interface PRIVATE "CONTROLLER_INTERFACE_BUILDING_DLL")

if(BUILD_TESTING)
find_package(ament_cmake_gmock REQUIRED)

find_package(hardware_interface REQUIRED)
find_package(sensor_msgs REQUIRED)

ament_add_gmock(test_controller_interface test/test_controller_interface.cpp)
target_link_libraries(test_controller_interface ${PROJECT_NAME})
target_include_directories(test_controller_interface PRIVATE include)
target_link_libraries(test_controller_interface
controller_interface
)

ament_add_gmock(test_controller_with_options test/test_controller_with_options.cpp)
target_link_libraries(test_controller_with_options ${PROJECT_NAME})
target_include_directories(test_controller_with_options PRIVATE include)
target_link_libraries(test_controller_with_options
controller_interface
)

ament_add_gmock(test_chainable_controller_interface test/test_chainable_controller_interface.cpp)
target_link_libraries(test_chainable_controller_interface ${PROJECT_NAME})
target_include_directories(test_chainable_controller_interface PRIVATE include)
ament_target_dependencies(test_chainable_controller_interface hardware_interface)

ament_add_gmock(
test_semantic_component_interface
test/test_semantic_component_interface.cpp
)
target_include_directories(test_semantic_component_interface PRIVATE include)
ament_target_dependencies(
test_semantic_component_interface
hardware_interface
target_link_libraries(test_chainable_controller_interface
controller_interface
hardware_interface::hardware_interface
)

ament_add_gmock(
test_force_torque_sensor
test/test_force_torque_sensor.cpp
ament_add_gmock(test_semantic_component_interface test/test_semantic_component_interface.cpp)
target_link_libraries(test_semantic_component_interface
controller_interface
hardware_interface::hardware_interface
)
target_include_directories(test_force_torque_sensor PRIVATE include)
ament_target_dependencies(
test_force_torque_sensor
hardware_interface

ament_add_gmock(test_force_torque_sensor test/test_force_torque_sensor.cpp)
target_link_libraries(test_force_torque_sensor
controller_interface
hardware_interface::hardware_interface
)

ament_add_gmock(
test_imu_sensor
test/test_imu_sensor.cpp
ament_add_gmock(test_imu_sensor test/test_imu_sensor.cpp)
target_link_libraries(test_imu_sensor
controller_interface
hardware_interface::hardware_interface
)
target_include_directories(test_imu_sensor PRIVATE include)
ament_target_dependencies(
test_imu_sensor
hardware_interface
ament_target_dependencies(test_imu_sensor
sensor_msgs
)
endif()

ament_export_dependencies(
hardware_interface
rclcpp_lifecycle
sensor_msgs
)
ament_export_include_directories(
include
install(
DIRECTORY include/
DESTINATION include/controller_interface
)
ament_export_libraries(
${PROJECT_NAME}
install(TARGETS controller_interface
EXPORT export_controller_interface
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

ament_export_targets(export_controller_interface HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class ChainableControllerInterface : public ControllerInterfaceBase
*
* \returns return_type::OK if update is successfully, otherwise return_type::ERROR.
*/
virtual return_type update_reference_from_subscribers() = 0;
virtual return_type update_reference_from_subscribers(
const rclcpp::Time & time, const rclcpp::Duration & period) = 0;

/// Execute calculations of the controller and update command interfaces.
/**
Expand Down
7 changes: 2 additions & 5 deletions controller_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_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>controller_interface</name>
<version>3.7.0</version>
<version>3.12.0</version>
<description>Description of controller_interface</description>
<maintainer email="[email protected]">Bence Magyar</maintainer>
<maintainer email="[email protected]">Denis Štogl</maintainer>
Expand All @@ -14,11 +14,8 @@
<build_depend>rclcpp_lifecycle</build_depend>
<build_depend>sensor_msgs</build_depend>

<exec_depend>hardware_interface</exec_depend>
<exec_depend>rclcpp_lifecycle</exec_depend>
<exec_depend>sensor_msgs</exec_depend>

<test_depend>ament_cmake_gmock</test_depend>
<test_depend>sensor_msgs</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ return_type ChainableControllerInterface::update(

if (!is_in_chained_mode())
{
ret = update_reference_from_subscribers();
ret = update_reference_from_subscribers(time, period);
if (ret != return_type::OK)
{
return ret;
Expand Down
Loading

0 comments on commit 93763c5

Please sign in to comment.