From 4f63238bc639b76e02ddfe8a0585801b97327402 Mon Sep 17 00:00:00 2001 From: MNikoliCC <135981555+MNikoliCC@users.noreply.github.com> Date: Sun, 22 Dec 2024 00:26:37 +0100 Subject: [PATCH] Update GitHub artifacts action to v4 (#1014) * Update artifacts * fix controller manager (wip) * format * fix * fix * fix * disable automatic controller sync * format * format * format * format --------- Co-authored-by: Darko Lukic --- .github/workflows/sync_master_to_develop.yml | 6 ++++-- .github/workflows/test.yml | 2 +- .github/workflows/test_develop.yml | 2 +- webots_ros2_control/src/Ros2Control.cpp | 6 +++++- .../include/webots_ros2_driver/WebotsNode.hpp | 2 +- webots_ros2_driver/src/Driver.cpp | 5 ++++- webots_ros2_driver/src/WebotsNode.cpp | 4 +++- .../resource/ros2_control_abb_config.yaml | 1 - 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/sync_master_to_develop.yml b/.github/workflows/sync_master_to_develop.yml index 67af01022..8017b5151 100644 --- a/.github/workflows/sync_master_to_develop.yml +++ b/.github/workflows/sync_master_to_develop.yml @@ -1,8 +1,10 @@ name: Branch synchronizer on: - schedule: - - cron: '0 04 * * *' + workflow_dispatch: + + # schedule: + # - cron: '0 04 * * *' jobs: sync-develop-with-master: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6cd8b0790..d9703d6c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: ROS_DISTRO: ${{matrix.ROS_DISTRO}} - name: Upload Artifact if: ${{ failure() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: generic_artifacts_${{matrix.ROS_REPO}}_${{matrix.ROS_DISTRO}} path: /artifacts diff --git a/.github/workflows/test_develop.yml b/.github/workflows/test_develop.yml index 60e55bf5e..2faf8b138 100644 --- a/.github/workflows/test_develop.yml +++ b/.github/workflows/test_develop.yml @@ -31,7 +31,7 @@ jobs: ROS_DISTRO: ${{matrix.ROS_DISTRO}} - name: Upload Artifact if: ${{ failure() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: generic_artifacts_develop_${{matrix.ROS_REPO}}_${{matrix.ROS_DISTRO}} path: /artifacts diff --git a/webots_ros2_control/src/Ros2Control.cpp b/webots_ros2_control/src/Ros2Control.cpp index d73d3bdc1..e610edc1c 100644 --- a/webots_ros2_control/src/Ros2Control.cpp +++ b/webots_ros2_control/src/Ros2Control.cpp @@ -152,7 +152,11 @@ namespace webots_ros2_control { // Controller Manager mExecutor = std::make_shared(); - mControllerManager.reset(new controller_manager::ControllerManager(std::move(resourceManager), mExecutor)); + + rclcpp::NodeOptions options = controller_manager::get_cm_node_options(); + options.arguments(node->get_node_options().arguments()); + mControllerManager.reset(new controller_manager::ControllerManager(std::move(resourceManager), mExecutor, + "controller_manager", node->get_namespace(), options)); // Update rate const int updateRate = mControllerManager->get_parameter("update_rate").as_int(); diff --git a/webots_ros2_driver/include/webots_ros2_driver/WebotsNode.hpp b/webots_ros2_driver/include/webots_ros2_driver/WebotsNode.hpp index 52dcd770a..57825fd0b 100644 --- a/webots_ros2_driver/include/webots_ros2_driver/WebotsNode.hpp +++ b/webots_ros2_driver/include/webots_ros2_driver/WebotsNode.hpp @@ -35,7 +35,7 @@ namespace webots_ros2_driver { class WebotsNode : public rclcpp::Node { public: - WebotsNode(std::string name); + WebotsNode(std::string name, rclcpp::NodeOptions &options); void init(); int step(); std::string urdf() const { return mRobotDescription; }; diff --git a/webots_ros2_driver/src/Driver.cpp b/webots_ros2_driver/src/Driver.cpp index 3ea1196d1..cf79908de 100644 --- a/webots_ros2_driver/src/Driver.cpp +++ b/webots_ros2_driver/src/Driver.cpp @@ -40,7 +40,10 @@ int main(int argc, char **argv) { for (char notAllowedChar : " -.)(") std::replace(robotName.begin(), robotName.end(), notAllowedChar, '_'); - std::shared_ptr node = std::make_shared(robotName); + rclcpp::NodeOptions nodeOptions; + nodeOptions.arguments(std::vector(argv + 1, argv + argc)); + std::shared_ptr node = + std::make_shared(robotName, nodeOptions); node->init(); // The parent process must be ros2 run. Declaring from launch file is deprecated. Remove with 2024.0.0. diff --git a/webots_ros2_driver/src/WebotsNode.cpp b/webots_ros2_driver/src/WebotsNode.cpp index 9a66ad4a2..62e5f1c71 100644 --- a/webots_ros2_driver/src/WebotsNode.cpp +++ b/webots_ros2_driver/src/WebotsNode.cpp @@ -50,7 +50,9 @@ namespace webots_ros2_driver { gShutdownSignalReceived = true; } - WebotsNode::WebotsNode(std::string name) : Node(name), mPluginLoader(gPluginInterfaceName, gPluginInterface) { + WebotsNode::WebotsNode(std::string name, rclcpp::NodeOptions &options) : + Node(name, options), + mPluginLoader(gPluginInterfaceName, gPluginInterface) { mRobotDescriptionParam = this->declare_parameter("robot_description", ""); mSetRobotStatePublisher = this->declare_parameter("set_robot_state_publisher", false); if (mRobotDescriptionParam != "") { diff --git a/webots_ros2_universal_robot/resource/ros2_control_abb_config.yaml b/webots_ros2_universal_robot/resource/ros2_control_abb_config.yaml index 901edc300..c4bb58034 100644 --- a/webots_ros2_universal_robot/resource/ros2_control_abb_config.yaml +++ b/webots_ros2_universal_robot/resource/ros2_control_abb_config.yaml @@ -26,4 +26,3 @@ abb/abb_joint_trajectory_controller: - position allow_partial_joints_goal: true -