Skip to content

Commit

Permalink
reset the preempt flag when leaving Task::plan()
Browse files Browse the repository at this point in the history
  • Loading branch information
captain-yoshi committed Jul 17, 2024
1 parent d99f49b commit 38a4801
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include <moveit/robot_model_loader/robot_model_loader.h>
#include <moveit/planning_pipeline/planning_pipeline.h>

#include <scope_guard/scope_guard.hpp>

#include <functional>

namespace {
Expand Down Expand Up @@ -234,6 +236,9 @@ void Task::compute() {
}

moveit::core::MoveItErrorCode Task::plan(size_t max_solutions) {
// ensure that the preempt flag is resetted once this method is exited
auto guard = sg::make_scope_guard([this]() noexcept { this->resetPreemptFlag(); });

auto impl = pimpl();
init();

Expand Down

0 comments on commit 38a4801

Please sign in to comment.