Skip to content
Snippets Groups Projects
Commit d74ee960 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

In the action_done callback, the action status is only updated if the tiemout...

In the action_done callback, the action status is only updated if the tiemout and watchdog have not been activated.
parent d1f8967c
No related branches found
No related tags found
No related merge requests found
......@@ -217,26 +217,29 @@ class CModuleAction
void action_done(const actionlib::SimpleClientGoalState& state,const ResultConstPtr& result)
{
this->action_access.enter();
if(state==actionlib::SimpleClientGoalState::ABORTED)
if(this->status==ACTION_RUNNING)
{
ROS_ERROR_STREAM("CModuleAction::action_done: goal on server " << this->name << " aborted");
this->status=ACTION_ABORTED;
}
if(state==actionlib::SimpleClientGoalState::REJECTED)
{
ROS_ERROR_STREAM("CModuleAction::action_done: goal on server " << this->name << " rejected");
this->status=ACTION_REJECTED;
}
else if(state==actionlib::SimpleClientGoalState::PREEMPTED)
{
ROS_WARN_STREAM("CModuleAction::action_done: goal on server " << this->name << " preempted");
this->status=ACTION_PREEMPTED;
if(state==actionlib::SimpleClientGoalState::ABORTED)
{
ROS_ERROR_STREAM("CModuleAction::action_done: goal on server " << this->name << " aborted");
this->status=ACTION_ABORTED;
}
if(state==actionlib::SimpleClientGoalState::REJECTED)
{
ROS_ERROR_STREAM("CModuleAction::action_done: goal on server " << this->name << " rejected");
this->status=ACTION_REJECTED;
}
else if(state==actionlib::SimpleClientGoalState::PREEMPTED)
{
ROS_WARN_STREAM("CModuleAction::action_done: goal on server " << this->name << " preempted");
this->status=ACTION_PREEMPTED;
}
else if(state==actionlib::SimpleClientGoalState::SUCCEEDED)
{
ROS_INFO_STREAM("CModuleAction::action_done: goal on server " << this->name << " successfull");
this->status=ACTION_SUCCESS;
}
}
else if(state==actionlib::SimpleClientGoalState::SUCCEEDED)
{
ROS_INFO_STREAM("CModuleAction::action_done: goal on server " << this->name << " successfull");
this->status=ACTION_SUCCESS;
}
this->action_result_msg=*result;
this->action_feedback_msg=Feedback();
this->action_access.exit();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment