47 : AbstractActionBase(name, robot_info){}
53 const mbf_msgs::RecoveryGoal &goal = *goal_handle.getGoal();
54 mbf_msgs::RecoveryResult result;
55 result.used_plugin = goal.behavior;
56 bool recovery_active =
true;
60 while (recovery_active &&
ros::ok())
62 state_recovery_input = execution.
getState();
63 switch (state_recovery_input)
72 result.outcome = mbf_msgs::RecoveryResult::STOPPED;
73 result.message =
"Recovery has been stopped!";
74 goal_handle.setAborted(result, result.message);
75 recovery_active =
false;
86 ROS_INFO_STREAM(
"Recovery behavior \"" << goal.behavior <<
"\" patience exceeded! Cancel recovering...");
95 recovery_active =
false;
96 result.outcome = mbf_msgs::RecoveryResult::CANCELED;
97 result.message =
"Recovery behaviour \"" + goal.behavior +
"\" canceled!";
98 goal_handle.setCanceled(result, result.message);
103 recovery_active =
false;
106 if (result.message.empty())
108 if (result.outcome < 10)
109 result.message =
"Recovery \"" + goal.behavior +
"\" done";
111 result.message =
"Recovery \"" + goal.behavior +
"\" FAILED";
115 goal_handle.setSucceeded(result, result.message);
120 recovery_active =
false;
121 result.outcome = mbf_msgs::RecoveryResult::INTERNAL_ERROR;
122 result.message =
"Internal error: Unknown error thrown by the plugin!";
123 goal_handle.setAborted(result, result.message);
127 result.outcome = mbf_msgs::RecoveryResult::INTERNAL_ERROR;
128 std::stringstream ss;
129 ss <<
"Internal error: Unknown state in a move base flex recovery execution with the number: "
130 <<
static_cast<int>(state_recovery_input);
131 result.message = ss.str();
133 goal_handle.setAborted(result, result.message);
134 recovery_active =
false;
146 if (!recovery_active)