Skip to content

Commit

Permalink
Cleanup in on_cleanup instead on_deactivate
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauch committed Nov 14, 2023
1 parent 86defa7 commit 81be24b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ur_robot_driver/src/hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,15 @@ URPositionHardwareInterface::on_activate(const rclcpp_lifecycle::State& previous
}

hardware_interface::CallbackReturn
URPositionHardwareInterface::on_deactivate(const rclcpp_lifecycle::State& previous_state)
URPositionHardwareInterface::on_cleanup(const rclcpp_lifecycle::State& previous_state)
{
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"), "Stopping ...please wait...");

async_thread_shutdown_ = true;
async_thread_->join();
async_thread_.reset();
if (async_thread_) {
async_thread_shutdown_ = true;
async_thread_->join();
async_thread_.reset();
}

ur_driver_.reset();

Expand Down

0 comments on commit 81be24b

Please sign in to comment.