42 #include <boost/exception/diagnostic_information.hpp> 51 const std::string name,
53 const TFPtr &tf_listener_ptr,
54 const MoveBaseFlexConfig &config,
55 boost::function<
void()> setup_fn,
56 boost::function<
void()> cleanup_fn) :
58 behavior_(recovery_ptr), tf_listener_ptr_(tf_listener_ptr), state_(INITIALIZED)
71 boost::lock_guard<boost::mutex> guard(
conf_mtx_);
83 boost::lock_guard<boost::mutex> guard(
state_mtx_);
90 boost::lock_guard<boost::mutex> guard(
state_mtx_);
100 ROS_WARN_STREAM(
"Cancel recovering failed or is not supported by the plugin. " 101 <<
"Wait until the current recovery behavior finished!");
109 boost::lock_guard<boost::mutex> guard1(
conf_mtx_);
110 boost::lock_guard<boost::mutex> guard2(
time_mtx_);
135 catch (boost::thread_interrupted &ex)
140 ROS_FATAL_STREAM(
"Unknown error occurred: " << 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...
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_.
AbstractRecoveryExecution(const std::string name, const mbf_abstract_core::AbstractRecovery::Ptr recovery_ptr, const TFPtr &tf_listener_ptr, const MoveBaseFlexConfig &config, boost::function< void()> setup_fn, boost::function< void()> cleanup_fn)
Constructor.
uint32_t outcome_
the last received plugin execution outcome
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.
void notify_one() BOOST_NOEXCEPT