From b895e98f3ad6ac2cccc94d2fcd86a715adafa60b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Castro?= Date: Wed, 16 May 2018 16:15:34 +1000 Subject: [PATCH] Prevent thread to being created every time a goal is published --- crosbot_explore/src/nodes/astar_explorer_node.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crosbot_explore/src/nodes/astar_explorer_node.cpp b/crosbot_explore/src/nodes/astar_explorer_node.cpp index 7fbf07e..85e1eee 100644 --- a/crosbot_explore/src/nodes/astar_explorer_node.cpp +++ b/crosbot_explore/src/nodes/astar_explorer_node.cpp @@ -223,7 +223,9 @@ void AStarExplorerROSNode::handleExploreMode(crosbot_explore::SetExplorerModeReq // Start planning thread planningOperating = true; - planningThread->start(); + if( !planningThread->isAlive() ){ + planningThread->start(); + } } else { ROS_ERROR("%s No pose provided for A* goal", LOG_START); response.success = false; -- GitLab