41 #include <boost/exception/diagnostic_information.hpp> 49 const std::string &name,
51 const TFPtr &tf_listener_ptr,
52 const MoveBaseFlexConfig &config) :
54 behavior_(recovery_ptr), tf_listener_ptr_(tf_listener_ptr), state_(INITIALIZED)
67 boost::lock_guard<boost::mutex> guard(
conf_mtx_);
79 boost::lock_guard<boost::mutex> guard(
state_mtx_);
86 boost::lock_guard<boost::mutex> guard(
state_mtx_);
96 ROS_WARN_STREAM(
"Cancel recovery behavior \"" <<
name_ <<
"\" failed or is not supported by the plugin. " 97 <<
"Wait until the current recovery behavior finished!");
105 boost::lock_guard<boost::mutex> guard1(
conf_mtx_);
106 boost::lock_guard<boost::mutex> guard2(
time_mtx_);
131 catch (boost::thread_interrupted &ex)
138 ROS_FATAL_STREAM(
"Unknown error occurred in recovery behavior \"" <<
name_ <<
"\": " << boost::current_exception_diagnostic_information());
boost::condition_variable condition_
condition variable to wake up control thread
The recovery execution was canceled.
The recovery behavior plugin is running.
void reconfigure(const MoveBaseFlexConfig &config)
Reconfigures the current configuration and reloads all parameters. This method is called from a dynam...
std::string name_
the plugin name; not the plugin type!
The recovery behavior execution is done.
AbstractRecoveryExecution::RecoveryState getState()
Returns the current state, thread-safe communication.
bool cancel_
flag for canceling controlling
virtual ~AbstractRecoveryExecution()
Destructor.
The recovery execution has been stopped.
std::string message_
the last received plugin execution message
void setState(RecoveryState state)
Sets the current internal state. This method is thread communication safe.
RecoveryState
internal state.
#define ROS_FATAL_STREAM(args)
RecoveryState state_
current internal state
virtual void run()
Main execution method which will be executed by the recovery execution thread_.
uint32_t outcome_
the last received plugin execution outcome
AbstractRecoveryExecution(const std::string &name, const mbf_abstract_core::AbstractRecovery::Ptr &recovery_ptr, const TFPtr &tf_listener_ptr, const MoveBaseFlexConfig &config)
Constructor.
ros::Time start_time_
recovery behavior start time
boost::mutex state_mtx_
mutex to handle safe thread communication for the current state
boost::mutex conf_mtx_
dynamic reconfigure and start time mutexes to mutually exclude read/write configuration ...
An internal error occurred.
ros::Duration patience_
recovery behavior allowed time
#define ROS_WARN_STREAM(args)
#define ROS_DEBUG_STREAM(args)
virtual bool cancel()
Cancel the planner execution. This calls the cancel method of the planner plugin. This could be usefu...
mbf_abstract_core::AbstractRecovery::Ptr behavior_
the current loaded recovery behavior
bool isPatienceExceeded()
Checks whether the patience was exceeded.