Fixed goal reached topic not sent when move_base has finished

This commit is contained in:
matlabbe
2015-09-22 15:47:10 -04:00
parent 00f04e62c0
commit 9a201f5e2e
+7 -1
View File
@@ -1887,6 +1887,12 @@ bool CoreWrapper::cancelGoalCallback(std_srvs::Empty::Request& req, std_srvs::Em
{
mbClient_.cancelGoal();
}
if(goalReachedPub_.getNumSubscribers())
{
std_msgs::Bool result;
result.data = false;
goalReachedPub_.publish(result);
}
}
return true;
@@ -2126,7 +2132,7 @@ void CoreWrapper::goalDoneCb(const actionlib::SimpleClientGoalState& state,
ROS_ERROR("Planning: move_base failed for some reason. Aborting the plan...");
}
if(!ignore && !goalReachedPub_.getNumSubscribers())
if(!ignore && goalReachedPub_.getNumSubscribers())
{
std_msgs::Bool result;
result.data = state == actionlib::SimpleClientGoalState::SUCCEEDED;