Fawkes API Fawkes Development Version
|
A Golog++ action executor that sends a message to a blackboard interface. More...
Public Member Functions | |
BBMessageActionExecutor (Logger *logger, BlackBoard *blackboard, Configuration *config, const std::string &cfg_prefix) | |
Constructor. More... | |
virtual | ~BBMessageActionExecutor () |
Destructor. More... | |
void | start (std::shared_ptr< gologpp::Activity > activity) override |
Start the given activity. More... | |
void | stop (std::shared_ptr< gologpp::Grounding< gologpp::Action > > activity) override |
Stop the given activity. More... | |
bool | can_execute_activity (std::shared_ptr< gologpp::Activity > activity) const override |
Determine if this executor can execute the given activity. More... | |
![]() | |
ActionExecutor (Logger *logger) | |
Constructor of an abstract executor. More... | |
virtual void | start (std::shared_ptr< gologpp::Activity > activity)=0 |
Start the given activity. More... | |
virtual void | stop (std::shared_ptr< gologpp::Grounding< gologpp::Action > > activity)=0 |
Stop the given activity. More... | |
virtual bool | can_execute_activity (std::shared_ptr< gologpp::Activity > activity) const =0 |
Determine if this executor can execute the given activity. More... | |
Additional Inherited Members | |
![]() | |
std::shared_ptr< gologpp::Activity > | running_activity_ |
A pointer to the currently running activity. More... | |
Logger * | logger_ |
The logger to use for logging messages. More... | |
A Golog++ action executor that sends a message to a blackboard interface.
Definition at line 36 of file message_action_executor.h.
fawkes::gpp::BBMessageActionExecutor::BBMessageActionExecutor | ( | Logger * | logger, |
BlackBoard * | blackboard, | ||
Configuration * | config, | ||
const std::string & | cfg_prefix | ||
) |
Constructor.
Initializes the executor with all the action mappings specified in the config.
logger | A logger to use for logging messages |
blackboard | The blackboard to use to send messages to |
config | The configuration to read the mapping from |
cfg_prefix | The config prefix to use for the message mapping |
Definition at line 47 of file message_action_executor.cpp.
|
virtual |
Destructor.
Clean up and close all interfaces.
Definition at line 58 of file message_action_executor.cpp.
References fawkes::BlackBoard::close().
|
overridevirtual |
Determine if this executor can execute the given activity.
activity | The activity to execute. |
Implements fawkes::gpp::ActionExecutor.
Definition at line 66 of file message_action_executor.cpp.
Referenced by start().
|
overridevirtual |
Start the given activity.
activity | The activity to execute. |
Implements fawkes::gpp::ActionExecutor.
Definition at line 72 of file message_action_executor.cpp.
References can_execute_activity(), fawkes::Interface::fields(), fawkes::Interface::fields_end(), fawkes::Logger::log_error(), fawkes::gpp::ActionExecutor::logger_, and fawkes::BlackBoard::open_for_reading().
|
overridevirtual |
Stop the given activity.
The executor is expected to keep track of the currently executed activity. Only stop the activity if the executor is actually executing it. If the given activity is not executed by this executor, do nothing.
activity | The activity to stop. |
Implements fawkes::gpp::ActionExecutor.
Definition at line 113 of file message_action_executor.cpp.
References fawkes::Logger::log_error(), and fawkes::gpp::ActionExecutor::logger_.