Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions nav2_util/include/nav2_util/lifecycle_service_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ class LifecycleServiceClient
const std::string & lifecycle_node_name,
rclcpp::Node::SharedPtr parent_node);

~LifecycleServiceClient()
{
change_state_.stop();
get_state_.stop();
}

/// Trigger a state change
/**
* Throws std::runtime_error on failure
Expand Down
10 changes: 10 additions & 0 deletions nav2_util/include/nav2_util/service_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ class ServiceClient
return service_name_;
}

/**
* @brief Stop any running spin operations on the internal executor
*/
void stop()
{
if (client_) {
callback_group_executor_.cancel();
}
}

protected:
std::string service_name_;
NodeT node_;
Expand Down
Loading