diff --git a/rclcpp_action/include/rclcpp_action/server.hpp b/rclcpp_action/include/rclcpp_action/server.hpp index 6bfe9bc076..2da21d37cb 100644 --- a/rclcpp_action/include/rclcpp_action/server.hpp +++ b/rclcpp_action/include/rclcpp_action/server.hpp @@ -291,7 +291,7 @@ class Server : public ServerBase, public std::enable_shared_from_this)>; + const GoalID &, std::shared_ptr)>; /// Signature of a callback that accepts or rejects requests to cancel a goal. using CancelCallback = std::function>)>; /// Signature of a callback that is used to notify when the goal has been accepted. @@ -395,7 +395,7 @@ class Server : public ServerBase, public std::enable_shared_from_this> goal_handle; std::weak_ptr> weak_this = this->shared_from_this(); - std::function)> on_terminal_state = + std::function)> on_terminal_state = [weak_this](const GoalID & uuid, std::shared_ptr result_message) { std::shared_ptr> shared_this = weak_this.lock(); @@ -413,7 +413,7 @@ class Server : public ServerBase, public std::enable_shared_from_thisgoal_handles_.erase(uuid); }; - std::function on_executing = + std::function on_executing = [weak_this](const GoalID & uuid) { std::shared_ptr> shared_this = weak_this.lock(); diff --git a/rclcpp_action/include/rclcpp_action/server_goal_handle.hpp b/rclcpp_action/include/rclcpp_action/server_goal_handle.hpp index 97844661a0..a6b446fbb2 100644 --- a/rclcpp_action/include/rclcpp_action/server_goal_handle.hpp +++ b/rclcpp_action/include/rclcpp_action/server_goal_handle.hpp @@ -231,8 +231,8 @@ class ServerGoalHandle : public ServerGoalHandleBase std::shared_ptr rcl_handle, GoalID uuid, std::shared_ptr goal, - std::function)> on_terminal_state, - std::function on_executing, + std::function)> on_terminal_state, + std::function on_executing, std::function)> publish_feedback ) : ServerGoalHandleBase(rcl_handle), goal_(goal), uuid_(uuid), @@ -249,8 +249,8 @@ class ServerGoalHandle : public ServerGoalHandleBase friend Server; - std::function)> on_terminal_state_; - std::function on_executing_; + std::function)> on_terminal_state_; + std::function on_executing_; std::function)> publish_feedback_; }; } // namespace rclcpp_action