Skip to content

Commit 4d4ed45

Browse files
authored
Merge branch 'master' into issue-759
2 parents bcb013d + 786d5b5 commit 4d4ed45

File tree

70 files changed

+634
-1242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+634
-1242
lines changed

.github/workflows/ci-coverage-build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
required-ros-distributions: ${{ env.ROS_DISTRO }}
2323
- uses: actions/checkout@v4
24-
- uses: ros-tooling/[email protected].5
24+
- uses: ros-tooling/[email protected].6
2525
with:
2626
target-ros2-distro: ${{ env.ROS_DISTRO }}
2727
import-token: ${{ secrets.GITHUB_TOKEN }}
@@ -30,6 +30,7 @@ jobs:
3030
controller_interface
3131
controller_manager
3232
hardware_interface
33+
hardware_interface_testing
3334
transmission_interface
3435

3536
vcs-repo-file-url: |
@@ -41,12 +42,12 @@ jobs:
4142
}
4243
}
4344
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
44-
- uses: codecov/[email protected].4
45+
- uses: codecov/[email protected].5
4546
with:
4647
file: ros_ws/lcov/total_coverage.info
4748
flags: unittests
4849
name: codecov-umbrella
49-
- uses: actions/upload-artifact@v4.2.0
50+
- uses: actions/upload-artifact@v4.3.0
5051
with:
5152
name: colcon-logs-ubuntu-22.04-coverage-rolling
5253
path: ros_ws/log

.github/workflows/ci-ros-lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
controller_manager
2525
controller_manager_msgs
2626
hardware_interface
27+
hardware_interface_testing
2728
ros2controlcli
2829
ros2_control
2930
ros2_control_test_assets
@@ -49,6 +50,7 @@ jobs:
4950
controller_manager
5051
controller_manager_msgs
5152
hardware_interface
53+
hardware_interface_testing
5254
ros2controlcli
5355
ros2_control
5456
ros2_control_test_assets
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Debian Humble Build
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches:
6+
- humble
7+
schedule:
8+
# Run every day to detect flakiness and broken dependencies
9+
- cron: '03 1 * * *'
10+
11+
12+
jobs:
13+
humble_debian:
14+
name: Humble debian build
15+
runs-on: ubuntu-latest
16+
env:
17+
ROS_DISTRO: humble
18+
container: ghcr.io/ros-controls/ros:humble-debian
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
path: src/ros2_control
23+
- name: Build and test
24+
shell: bash
25+
run: |
26+
source /opt/ros2_ws/install/setup.bash
27+
vcs import src < src/ros2_control/ros2_control.${{ env.ROS_DISTRO }}.repos
28+
colcon build --packages-skip rqt_controller_manager
29+
colcon test --packages-skip rqt_controller_manager control_msgs controller_manager_msgs
30+
colcon test-result --verbose

.github/workflows/humble-rhel-binary-build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
name: Humble RHEL Binary Build
1+
name: RHEL Humble Binary Build
22
on:
33
workflow_dispatch:
4-
push:
5-
branches:
6-
- humble
74
pull_request:
85
branches:
96
- humble
@@ -22,10 +19,14 @@ jobs:
2219
- uses: actions/checkout@v4
2320
with:
2421
path: src/ros2_control
25-
- run: |
22+
- name: Install dependencies
23+
run: |
2624
rosdep update
2725
rosdep install -iyr --from-path src/ros2_control || true
26+
- name: Build and test
27+
run: |
2828
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
29+
source /opt/ros2_ws/install/setup.bash
2930
colcon build --packages-skip rqt_controller_manager
3031
colcon test --packages-skip rqt_controller_manager ros2controlcli
31-
colcon test-result
32+
colcon test-result --verbose
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Debian Iron Build
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches:
6+
- iron
7+
schedule:
8+
# Run every day to detect flakiness and broken dependencies
9+
- cron: '03 1 * * *'
10+
11+
12+
jobs:
13+
iron_debian:
14+
name: Iron debian build
15+
runs-on: ubuntu-latest
16+
env:
17+
ROS_DISTRO: iron
18+
container: ghcr.io/ros-controls/ros:iron-debian
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
path: src/ros2_control
23+
- name: Build and test
24+
shell: bash
25+
run: |
26+
source /opt/ros2_ws/install/setup.bash
27+
vcs import src < src/ros2_control/ros2_control.${{ env.ROS_DISTRO }}.repos
28+
colcon build --packages-skip rqt_controller_manager
29+
colcon test --packages-skip rqt_controller_manager control_msgs controller_manager_msgs
30+
colcon test-result --verbose

.github/workflows/iron-rhel-binary-build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
name: Iron RHEL Binary Build
1+
name: RHEL Iron Binary Build
22
on:
33
workflow_dispatch:
4-
push:
5-
branches:
6-
- iron
74
pull_request:
85
branches:
96
- iron
@@ -23,10 +20,14 @@ jobs:
2320
- uses: actions/checkout@v4
2421
with:
2522
path: src/ros2_control
26-
- run: |
23+
- name: Install dependencies
24+
run: |
2725
rosdep update
2826
rosdep install -iyr --from-path src/ros2_control || true
27+
- name: Build and test
28+
run: |
2929
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
30+
source /opt/ros2_ws/install/setup.bash
3031
colcon build --packages-skip rqt_controller_manager
3132
colcon test --packages-skip rqt_controller_manager ros2controlcli
32-
colcon test-result
33+
colcon test-result --verbose

.github/workflows/reusable-ros-tooling-source-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- uses: actions/checkout@v4
3333
with:
3434
ref: ${{ inputs.ref }}
35-
- uses: ros-tooling/[email protected].5
35+
- uses: ros-tooling/[email protected].6
3636
with:
3737
target-ros2-distro: ${{ inputs.ros_distro }}
3838
# build all packages listed in the meta package
@@ -50,7 +50,7 @@ jobs:
5050
https://raw.githubusercontent.com/ros2/ros2/${{ inputs.ros2_repo_branch }}/ros2.repos
5151
https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/ros2_control.${{ inputs.ros_distro }}.repos?token=${{ secrets.GITHUB_TOKEN }}
5252
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
53-
- uses: actions/upload-artifact@v4.2.0
53+
- uses: actions/upload-artifact@v4.3.0
5454
with:
5555
name: colcon-logs-ubuntu-22.04
5656
path: ros_ws/log
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Debian Rolling Build
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches:
6+
- master
7+
schedule:
8+
# Run every day to detect flakiness and broken dependencies
9+
- cron: '03 1 * * *'
10+
11+
12+
jobs:
13+
rolling_debian:
14+
name: Rolling debian build
15+
runs-on: ubuntu-latest
16+
env:
17+
ROS_DISTRO: rolling
18+
container: ghcr.io/ros-controls/ros:rolling-debian
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
path: src/ros2_control
23+
- name: Build and test
24+
shell: bash
25+
run: |
26+
source /opt/ros2_ws/install/setup.bash
27+
vcs import src < src/ros2_control/ros2_control.${{ env.ROS_DISTRO }}.repos
28+
colcon build --packages-skip rqt_controller_manager
29+
colcon test --packages-skip rqt_controller_manager
30+
colcon test-result --verbose

.github/workflows/rolling-rhel-binary-build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
name: Rolling RHEL Binary Build
1+
name: RHEL Rolling Binary Build
22
on:
33
workflow_dispatch:
4-
push:
5-
branches:
6-
- master
74
pull_request:
85
branches:
96
- master
@@ -23,10 +20,14 @@ jobs:
2320
- uses: actions/checkout@v4
2421
with:
2522
path: src/ros2_control
26-
- run: |
23+
- name: Install dependencies
24+
run: |
2725
rosdep update
2826
rosdep install -iyr --from-path src/ros2_control || true
27+
- name: Build and test
28+
run: |
2929
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
30+
source /opt/ros2_ws/install/setup.bash
3031
colcon build --packages-skip rqt_controller_manager
3132
colcon test --packages-skip rqt_controller_manager ros2controlcli
32-
colcon test-result
33+
colcon test-result --verbose

controller_interface/CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Changelog for package controller_interface
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
4.4.0 (2024-01-31)
6+
------------------
7+
58
4.3.0 (2024-01-20)
69
------------------
710
* Issue 695: Changing 'namespace\_' variables to 'node_namespace' to make it more explicit (`#1239 <https://github.com/ros-controls/ros2_control/issues/1239>`_)

controller_interface/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ if(BUILD_TESTING)
4040
)
4141

4242
ament_add_gmock(test_controller_with_options test/test_controller_with_options.cpp)
43+
install(FILES test/test_controller_node_options.yaml
44+
DESTINATION test)
4345
target_link_libraries(test_controller_with_options
4446
controller_interface
4547
)

controller_interface/include/controller_interface/controller_interface_base.hpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,9 @@ class ControllerInterfaceBase : public rclcpp_lifecycle::node_interfaces::Lifecy
113113
void release_interfaces();
114114

115115
CONTROLLER_INTERFACE_PUBLIC
116-
virtual return_type init(
116+
return_type init(
117117
const std::string & controller_name, const std::string & urdf, unsigned int cm_update_rate,
118-
const std::string & node_namespace = "",
119-
const rclcpp::NodeOptions & node_options = rclcpp::NodeOptions().enable_logger_service(true));
118+
const std::string & node_namespace, const rclcpp::NodeOptions & node_options);
120119

121120
/// Custom configure method to read additional parameters for controller-nodes
122121
/*
@@ -159,6 +158,23 @@ class ControllerInterfaceBase : public rclcpp_lifecycle::node_interfaces::Lifecy
159158
CONTROLLER_INTERFACE_PUBLIC
160159
const std::string & get_robot_description() const;
161160

161+
/**
162+
* Method used by the controller_manager for base NodeOptions to instantiate the Lifecycle node
163+
* of the controller upon loading the controller.
164+
*
165+
* \note The controller_manager will modify these NodeOptions in case a params file is passed
166+
* by the spawner to load the controller parameters or when controllers are loaded in simulation
167+
* (see ros2_control#1311, ros2_controllers#698 , ros2_controllers#795,ros2_controllers#966 for
168+
* more details)
169+
*
170+
* @returns NodeOptions required for the configuration of the controller lifecycle node
171+
*/
172+
CONTROLLER_INTERFACE_PUBLIC
173+
virtual rclcpp::NodeOptions define_custom_node_options() const
174+
{
175+
return rclcpp::NodeOptions().enable_logger_service(true);
176+
}
177+
162178
/// Declare and initialize a parameter with a type.
163179
/**
164180
*

controller_interface/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="2">
44
<name>controller_interface</name>
5-
<version>4.3.0</version>
5+
<version>4.4.0</version>
66
<description>Description of controller_interface</description>
77
<maintainer email="[email protected]">Bence Magyar</maintainer>
88
<maintainer email="[email protected]">Denis Štogl</maintainer>

controller_interface/src/controller_interface_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ return_type ControllerInterfaceBase::init(
2828
const std::string & controller_name, const std::string & urdf, unsigned int cm_update_rate,
2929
const std::string & node_namespace, const rclcpp::NodeOptions & node_options)
3030
{
31+
urdf_ = urdf;
3132
node_ = std::make_shared<rclcpp_lifecycle::LifecycleNode>(
3233
controller_name, node_namespace, node_options,
3334
false); // disable LifecycleNode service interfaces
34-
urdf_ = urdf;
3535

3636
try
3737
{

controller_interface/test/test_chainable_controller_interface.cpp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ TEST_F(ChainableControllerInterfaceTest, default_returns)
2121
TestableChainableControllerInterface controller;
2222

2323
// initialize, create node
24-
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
24+
const auto node_options = controller.define_custom_node_options();
25+
ASSERT_EQ(
26+
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
27+
controller_interface::return_type::OK);
2528
ASSERT_NO_THROW(controller.get_node());
2629

2730
EXPECT_TRUE(controller.is_chainable());
@@ -33,7 +36,10 @@ TEST_F(ChainableControllerInterfaceTest, export_reference_interfaces)
3336
TestableChainableControllerInterface controller;
3437

3538
// initialize, create node
36-
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
39+
const auto node_options = controller.define_custom_node_options();
40+
ASSERT_EQ(
41+
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
42+
controller_interface::return_type::OK);
3743
ASSERT_NO_THROW(controller.get_node());
3844

3945
auto reference_interfaces = controller.export_reference_interfaces();
@@ -50,7 +56,10 @@ TEST_F(ChainableControllerInterfaceTest, reference_interfaces_storage_not_correc
5056
TestableChainableControllerInterface controller;
5157

5258
// initialize, create node
53-
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
59+
const auto node_options = controller.define_custom_node_options();
60+
ASSERT_EQ(
61+
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
62+
controller_interface::return_type::OK);
5463
ASSERT_NO_THROW(controller.get_node());
5564

5665
// expect empty return because storage is not resized
@@ -64,7 +73,10 @@ TEST_F(ChainableControllerInterfaceTest, reference_interfaces_prefix_is_not_node
6473
TestableChainableControllerInterface controller;
6574

6675
// initialize, create node
67-
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
76+
const auto node_options = controller.define_custom_node_options();
77+
ASSERT_EQ(
78+
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
79+
controller_interface::return_type::OK);
6880
ASSERT_NO_THROW(controller.get_node());
6981

7082
controller.set_name_prefix_of_reference_interfaces("some_not_correct_interface_prefix");
@@ -79,7 +91,10 @@ TEST_F(ChainableControllerInterfaceTest, setting_chained_mode)
7991
TestableChainableControllerInterface controller;
8092

8193
// initialize, create node
82-
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
94+
const auto node_options = controller.define_custom_node_options();
95+
ASSERT_EQ(
96+
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
97+
controller_interface::return_type::OK);
8398
ASSERT_NO_THROW(controller.get_node());
8499

85100
auto reference_interfaces = controller.export_reference_interfaces();
@@ -126,7 +141,10 @@ TEST_F(ChainableControllerInterfaceTest, test_update_logic)
126141
TestableChainableControllerInterface controller;
127142

128143
// initialize, create node
129-
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
144+
const auto node_options = controller.define_custom_node_options();
145+
ASSERT_EQ(
146+
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
147+
controller_interface::return_type::OK);
130148
ASSERT_NO_THROW(controller.get_node());
131149

132150
EXPECT_FALSE(controller.is_in_chained_mode());

0 commit comments

Comments
 (0)