Class AbstractExecutionBase

Inheritance Relationships

Derived Types

Class Documentation

class AbstractExecutionBase

Base class for running concurrent navigation tasks.

The class uses a dedicated thread to run potentially long-lasting jobs. The user can use waitForStateUpdate to get notification about the progress of the said job.

Subclassed by mbf_abstract_nav::AbstractControllerExecution, mbf_abstract_nav::AbstractPlannerExecution, mbf_abstract_nav::AbstractRecoveryExecution

Public Functions

AbstractExecutionBase(const std::string &name, const mbf_utility::RobotInformation::ConstPtr &robot_info, const rclcpp::Node::SharedPtr &node)
virtual ~AbstractExecutionBase()
virtual bool start()
virtual void stop()
inline virtual bool cancel()

Cancel the plugin execution.

Returns:

true, if the plugin tries / tried to cancel the computation.

void join()
std::cv_status waitForStateUpdate(std::chrono::microseconds const &duration)
uint32_t getOutcome() const

Gets the current plugin execution outcome.

const std::string &getMessage() const

Gets the current plugin execution message.

const std::string &getName() const

Returns the name of the corresponding plugin.

inline virtual void preRun()

Optional implementation-specific setup function, called right before execution.

inline virtual void postRun()

Optional implementation-specific cleanup function, called right after execution.

Protected Functions

inline virtual void run()

Protected Attributes

std::condition_variable condition_

condition variable to wake up control thread

std::thread thread_

the controlling thread object

std::mutex should_exit_mutex_

mutex for locking the condition variable

bool should_exit_
bool cancel_

flag for canceling controlling

uint32_t outcome_

the last received plugin execution outcome

std::string message_

the last received plugin execution message

std::string name_

the plugin name; not the plugin type!

mbf_utility::RobotInformation::ConstPtr robot_info_

Reference to the current robot state.

rclcpp::Node::SharedPtr node_

Pointer to node in which the execution runs in. E.g. for getting the right logger.