Skip to content

Commit 367269c

Browse files
corotcorot
authored andcommitted
Update running controller goal also when we are preempting it
1 parent 8e91d2b commit 367269c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

mbf_abstract_nav/include/mbf_abstract_nav/abstract_action_base.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class AbstractActionBase
143143
// if there is already a plugin running on the same slot, cancel it
144144
slot_it->second.execution->cancel();
145145

146-
// TODO + WARNING: this will block the main thread for an arbitrary time during which we won't execute callbacks
146+
// WARNING: this will block the main thread for an arbitrary time during which we won't execute callbacks
147147
if (slot_it->second.thread_ptr->joinable()) {
148148
slot_it->second.thread_ptr->join();
149149
}

mbf_abstract_nav/src/controller_action.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ void ControllerAction::start(
8181
if(slot_it != concurrency_slots_.end() && slot_it->second.in_use)
8282
{
8383
boost::lock_guard<boost::mutex> goal_guard(goal_mtx_);
84+
const auto slot_status = slot_it->second.goal_handle.getGoalStatus().status;
8485
if ((slot_it->second.execution->getName() == goal_handle.getGoal()->controller ||
8586
goal_handle.getGoal()->controller.empty()) &&
86-
slot_it->second.goal_handle.getGoalStatus().status == actionlib_msgs::GoalStatus::ACTIVE)
87+
(slot_status == actionlib_msgs::GoalStatus::ACTIVE || slot_status == actionlib_msgs::GoalStatus::PREEMPTING))
8788
{
8889
ROS_DEBUG_STREAM_NAMED(name_, "Updating running controller goal of slot " << static_cast<int>(slot));
8990
update_plan = true;

0 commit comments

Comments
 (0)