From 5c776dfac0594e6d42b47dd993014ab33ba39403 Mon Sep 17 00:00:00 2001 From: Julia Jia Date: Thu, 9 Jan 2025 06:10:47 -0800 Subject: [PATCH] Remove empty on_shutdown() callbacks (#1477) (cherry picked from commit abf3172690fb56c974d734779cca24afc75a62e6) # Conflicts: # diff_drive_controller/include/diff_drive_controller/diff_drive_controller.hpp # joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.hpp # tricycle_controller/include/tricycle_controller/tricycle_controller.hpp --- .../diff_drive_controller/diff_drive_controller.hpp | 3 +++ diff_drive_controller/src/diff_drive_controller.cpp | 6 ------ .../joint_trajectory_controller.hpp | 3 +++ .../src/joint_trajectory_controller.cpp | 8 -------- .../include/tricycle_controller/tricycle_controller.hpp | 3 +++ tricycle_controller/src/tricycle_controller.cpp | 5 ----- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/diff_drive_controller/include/diff_drive_controller/diff_drive_controller.hpp b/diff_drive_controller/include/diff_drive_controller/diff_drive_controller.hpp index 9bb7566317..9bc88b14c0 100644 --- a/diff_drive_controller/include/diff_drive_controller/diff_drive_controller.hpp +++ b/diff_drive_controller/include/diff_drive_controller/diff_drive_controller.hpp @@ -86,10 +86,13 @@ class DiffDriveController : public controller_interface::ControllerInterface controller_interface::CallbackReturn on_error( const rclcpp_lifecycle::State & previous_state) override; +<<<<<<< HEAD DIFF_DRIVE_CONTROLLER_PUBLIC controller_interface::CallbackReturn on_shutdown( const rclcpp_lifecycle::State & previous_state) override; +======= +>>>>>>> abf3172 ( Remove empty on_shutdown() callbacks (#1477)) protected: struct WheelHandle { diff --git a/diff_drive_controller/src/diff_drive_controller.cpp b/diff_drive_controller/src/diff_drive_controller.cpp index 0bbfa45f3d..05fb52cb79 100644 --- a/diff_drive_controller/src/diff_drive_controller.cpp +++ b/diff_drive_controller/src/diff_drive_controller.cpp @@ -542,12 +542,6 @@ bool DiffDriveController::reset() return true; } -controller_interface::CallbackReturn DiffDriveController::on_shutdown( - const rclcpp_lifecycle::State &) -{ - return controller_interface::CallbackReturn::SUCCESS; -} - void DiffDriveController::halt() { const auto halt_wheels = [](auto & wheel_handles) diff --git a/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.hpp b/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.hpp index d946ace806..983fea441b 100644 --- a/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.hpp +++ b/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.hpp @@ -96,10 +96,13 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa controller_interface::CallbackReturn on_error( const rclcpp_lifecycle::State & previous_state) override; +<<<<<<< HEAD JOINT_TRAJECTORY_CONTROLLER_PUBLIC controller_interface::CallbackReturn on_shutdown( const rclcpp_lifecycle::State & previous_state) override; +======= +>>>>>>> abf3172 ( Remove empty on_shutdown() callbacks (#1477)) protected: // To reduce number of variables and to make the code shorter the interfaces are ordered in types // as the following constants diff --git a/joint_trajectory_controller/src/joint_trajectory_controller.cpp b/joint_trajectory_controller/src/joint_trajectory_controller.cpp index a324de76ca..5654149304 100644 --- a/joint_trajectory_controller/src/joint_trajectory_controller.cpp +++ b/joint_trajectory_controller/src/joint_trajectory_controller.cpp @@ -1126,14 +1126,6 @@ bool JointTrajectoryController::reset() return true; } -controller_interface::CallbackReturn JointTrajectoryController::on_shutdown( - const rclcpp_lifecycle::State &) -{ - // TODO(karsten1987): what to do? - - return CallbackReturn::SUCCESS; -} - void JointTrajectoryController::publish_state( const JointTrajectoryPoint & desired_state, const JointTrajectoryPoint & current_state, const JointTrajectoryPoint & state_error) diff --git a/tricycle_controller/include/tricycle_controller/tricycle_controller.hpp b/tricycle_controller/include/tricycle_controller/tricycle_controller.hpp index 9793077780..8389d6a9b6 100644 --- a/tricycle_controller/include/tricycle_controller/tricycle_controller.hpp +++ b/tricycle_controller/include/tricycle_controller/tricycle_controller.hpp @@ -86,9 +86,12 @@ class TricycleController : public controller_interface::ControllerInterface TRICYCLE_CONTROLLER_PUBLIC CallbackReturn on_error(const rclcpp_lifecycle::State & previous_state) override; +<<<<<<< HEAD TRICYCLE_CONTROLLER_PUBLIC CallbackReturn on_shutdown(const rclcpp_lifecycle::State & previous_state) override; +======= +>>>>>>> abf3172 ( Remove empty on_shutdown() callbacks (#1477)) protected: struct TractionHandle { diff --git a/tricycle_controller/src/tricycle_controller.cpp b/tricycle_controller/src/tricycle_controller.cpp index be9c03af2b..48627e820b 100644 --- a/tricycle_controller/src/tricycle_controller.cpp +++ b/tricycle_controller/src/tricycle_controller.cpp @@ -531,11 +531,6 @@ bool TricycleController::reset() return true; } -CallbackReturn TricycleController::on_shutdown(const rclcpp_lifecycle::State &) -{ - return CallbackReturn::SUCCESS; -} - void TricycleController::halt() { traction_joint_[0].velocity_command.get().set_value(0.0);