Skip to content

Commit

Permalink
Merge branch 'master' into issue-759
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl authored Feb 2, 2024
2 parents bcb013d + 786d5b5 commit 4d4ed45
Show file tree
Hide file tree
Showing 70 changed files with 634 additions and 1,242 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci-coverage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
required-ros-distributions: ${{ env.ROS_DISTRO }}
- uses: actions/checkout@v4
- uses: ros-tooling/action-ros-ci@0.3.5
- uses: ros-tooling/action-ros-ci@0.3.6
with:
target-ros2-distro: ${{ env.ROS_DISTRO }}
import-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -30,6 +30,7 @@ jobs:
controller_interface
controller_manager
hardware_interface
hardware_interface_testing
transmission_interface

vcs-repo-file-url: |
Expand All @@ -41,12 +42,12 @@ jobs:
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
- uses: codecov/codecov-action@v3.1.4
- uses: codecov/codecov-action@v3.1.5
with:
file: ros_ws/lcov/total_coverage.info
flags: unittests
name: codecov-umbrella
- uses: actions/upload-artifact@v4.2.0
- uses: actions/upload-artifact@v4.3.0
with:
name: colcon-logs-ubuntu-22.04-coverage-rolling
path: ros_ws/log
2 changes: 2 additions & 0 deletions .github/workflows/ci-ros-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
controller_manager
controller_manager_msgs
hardware_interface
hardware_interface_testing
ros2controlcli
ros2_control
ros2_control_test_assets
Expand All @@ -49,6 +50,7 @@ jobs:
controller_manager
controller_manager_msgs
hardware_interface
hardware_interface_testing
ros2controlcli
ros2_control
ros2_control_test_assets
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/humble-debian-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Debian Humble Build
on:
workflow_dispatch:
pull_request:
branches:
- humble
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '03 1 * * *'


jobs:
humble_debian:
name: Humble debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: humble
container: ghcr.io/ros-controls/ros:humble-debian
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_control
- name: Build and test
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
vcs import src < src/ros2_control/ros2_control.${{ env.ROS_DISTRO }}.repos
colcon build --packages-skip rqt_controller_manager
colcon test --packages-skip rqt_controller_manager control_msgs controller_manager_msgs
colcon test-result --verbose
13 changes: 7 additions & 6 deletions .github/workflows/humble-rhel-binary-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Humble RHEL Binary Build
name: RHEL Humble Binary Build
on:
workflow_dispatch:
push:
branches:
- humble
pull_request:
branches:
- humble
Expand All @@ -22,10 +19,14 @@ jobs:
- uses: actions/checkout@v4
with:
path: src/ros2_control
- run: |
- name: Install dependencies
run: |
rosdep update
rosdep install -iyr --from-path src/ros2_control || true
- name: Build and test
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/setup.bash
colcon build --packages-skip rqt_controller_manager
colcon test --packages-skip rqt_controller_manager ros2controlcli
colcon test-result
colcon test-result --verbose
30 changes: 30 additions & 0 deletions .github/workflows/iron-debian-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Debian Iron Build
on:
workflow_dispatch:
pull_request:
branches:
- iron
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '03 1 * * *'


jobs:
iron_debian:
name: Iron debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: iron
container: ghcr.io/ros-controls/ros:iron-debian
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_control
- name: Build and test
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
vcs import src < src/ros2_control/ros2_control.${{ env.ROS_DISTRO }}.repos
colcon build --packages-skip rqt_controller_manager
colcon test --packages-skip rqt_controller_manager control_msgs controller_manager_msgs
colcon test-result --verbose
13 changes: 7 additions & 6 deletions .github/workflows/iron-rhel-binary-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Iron RHEL Binary Build
name: RHEL Iron Binary Build
on:
workflow_dispatch:
push:
branches:
- iron
pull_request:
branches:
- iron
Expand All @@ -23,10 +20,14 @@ jobs:
- uses: actions/checkout@v4
with:
path: src/ros2_control
- run: |
- name: Install dependencies
run: |
rosdep update
rosdep install -iyr --from-path src/ros2_control || true
- name: Build and test
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/setup.bash
colcon build --packages-skip rqt_controller_manager
colcon test --packages-skip rqt_controller_manager ros2controlcli
colcon test-result
colcon test-result --verbose
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 @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ros-tooling/action-ros-ci@0.3.5
- uses: ros-tooling/action-ros-ci@0.3.6
with:
target-ros2-distro: ${{ inputs.ros_distro }}
# build all packages listed in the meta package
Expand All @@ -50,7 +50,7 @@ jobs:
https://raw.githubusercontent.com/ros2/ros2/${{ inputs.ros2_repo_branch }}/ros2.repos
https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/ros2_control.${{ inputs.ros_distro }}.repos?token=${{ secrets.GITHUB_TOKEN }}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
- uses: actions/upload-artifact@v4.2.0
- uses: actions/upload-artifact@v4.3.0
with:
name: colcon-logs-ubuntu-22.04
path: ros_ws/log
30 changes: 30 additions & 0 deletions .github/workflows/rolling-debian-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Debian Rolling Build
on:
workflow_dispatch:
pull_request:
branches:
- master
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '03 1 * * *'


jobs:
rolling_debian:
name: Rolling debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: rolling
container: ghcr.io/ros-controls/ros:rolling-debian
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_control
- name: Build and test
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
vcs import src < src/ros2_control/ros2_control.${{ env.ROS_DISTRO }}.repos
colcon build --packages-skip rqt_controller_manager
colcon test --packages-skip rqt_controller_manager
colcon test-result --verbose
13 changes: 7 additions & 6 deletions .github/workflows/rolling-rhel-binary-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Rolling RHEL Binary Build
name: RHEL Rolling Binary Build
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
Expand All @@ -23,10 +20,14 @@ jobs:
- uses: actions/checkout@v4
with:
path: src/ros2_control
- run: |
- name: Install dependencies
run: |
rosdep update
rosdep install -iyr --from-path src/ros2_control || true
- name: Build and test
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/setup.bash
colcon build --packages-skip rqt_controller_manager
colcon test --packages-skip rqt_controller_manager ros2controlcli
colcon test-result
colcon test-result --verbose
3 changes: 3 additions & 0 deletions controller_interface/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package controller_interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.4.0 (2024-01-31)
------------------

4.3.0 (2024-01-20)
------------------
* Issue 695: Changing 'namespace\_' variables to 'node_namespace' to make it more explicit (`#1239 <https://github.com/ros-controls/ros2_control/issues/1239>`_)
Expand Down
2 changes: 2 additions & 0 deletions controller_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ if(BUILD_TESTING)
)

ament_add_gmock(test_controller_with_options test/test_controller_with_options.cpp)
install(FILES test/test_controller_node_options.yaml
DESTINATION test)
target_link_libraries(test_controller_with_options
controller_interface
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,9 @@ class ControllerInterfaceBase : public rclcpp_lifecycle::node_interfaces::Lifecy
void release_interfaces();

CONTROLLER_INTERFACE_PUBLIC
virtual return_type init(
return_type init(
const std::string & controller_name, const std::string & urdf, unsigned int cm_update_rate,
const std::string & node_namespace = "",
const rclcpp::NodeOptions & node_options = rclcpp::NodeOptions().enable_logger_service(true));
const std::string & node_namespace, const rclcpp::NodeOptions & node_options);

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

/**
* Method used by the controller_manager for base NodeOptions to instantiate the Lifecycle node
* of the controller upon loading the controller.
*
* \note The controller_manager will modify these NodeOptions in case a params file is passed
* by the spawner to load the controller parameters or when controllers are loaded in simulation
* (see ros2_control#1311, ros2_controllers#698 , ros2_controllers#795,ros2_controllers#966 for
* more details)
*
* @returns NodeOptions required for the configuration of the controller lifecycle node
*/
CONTROLLER_INTERFACE_PUBLIC
virtual rclcpp::NodeOptions define_custom_node_options() const
{
return rclcpp::NodeOptions().enable_logger_service(true);
}

/// Declare and initialize a parameter with a type.
/**
*
Expand Down
2 changes: 1 addition & 1 deletion 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>4.3.0</version>
<version>4.4.0</version>
<description>Description of controller_interface</description>
<maintainer email="bence.magyar.robotics@gmail.com">Bence Magyar</maintainer>
<maintainer email="denis@stoglrobotics.de">Denis Štogl</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion controller_interface/src/controller_interface_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ return_type ControllerInterfaceBase::init(
const std::string & controller_name, const std::string & urdf, unsigned int cm_update_rate,
const std::string & node_namespace, const rclcpp::NodeOptions & node_options)
{
urdf_ = urdf;
node_ = std::make_shared<rclcpp_lifecycle::LifecycleNode>(
controller_name, node_namespace, node_options,
false); // disable LifecycleNode service interfaces
urdf_ = urdf;

try
{
Expand Down
30 changes: 24 additions & 6 deletions controller_interface/test/test_chainable_controller_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ TEST_F(ChainableControllerInterfaceTest, default_returns)
TestableChainableControllerInterface controller;

// initialize, create node
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
const auto node_options = controller.define_custom_node_options();
ASSERT_EQ(
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
controller_interface::return_type::OK);
ASSERT_NO_THROW(controller.get_node());

EXPECT_TRUE(controller.is_chainable());
Expand All @@ -33,7 +36,10 @@ TEST_F(ChainableControllerInterfaceTest, export_reference_interfaces)
TestableChainableControllerInterface controller;

// initialize, create node
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
const auto node_options = controller.define_custom_node_options();
ASSERT_EQ(
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
controller_interface::return_type::OK);
ASSERT_NO_THROW(controller.get_node());

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

// initialize, create node
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
const auto node_options = controller.define_custom_node_options();
ASSERT_EQ(
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
controller_interface::return_type::OK);
ASSERT_NO_THROW(controller.get_node());

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

// initialize, create node
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
const auto node_options = controller.define_custom_node_options();
ASSERT_EQ(
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
controller_interface::return_type::OK);
ASSERT_NO_THROW(controller.get_node());

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

// initialize, create node
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
const auto node_options = controller.define_custom_node_options();
ASSERT_EQ(
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
controller_interface::return_type::OK);
ASSERT_NO_THROW(controller.get_node());

auto reference_interfaces = controller.export_reference_interfaces();
Expand Down Expand Up @@ -126,7 +141,10 @@ TEST_F(ChainableControllerInterfaceTest, test_update_logic)
TestableChainableControllerInterface controller;

// initialize, create node
ASSERT_EQ(controller.init(TEST_CONTROLLER_NAME, "", 50.0), controller_interface::return_type::OK);
const auto node_options = controller.define_custom_node_options();
ASSERT_EQ(
controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options),
controller_interface::return_type::OK);
ASSERT_NO_THROW(controller.get_node());

EXPECT_FALSE(controller.is_in_chained_mode());
Expand Down
Loading

0 comments on commit 4d4ed45

Please sign in to comment.