Fawkes API  Fawkes Development Version
fawkes::NavGraphEstimator Class Reference

Estimate the execution time for the skill goto by querying the distance from the navgraph. More...

Inheritance diagram for fawkes::NavGraphEstimator:

Public Member Functions

 NavGraphEstimator (LockPtr< NavGraph > navgraph, Configuration *config, const std::string &cfg_prefix)
 Constructor. More...
 
float get_execution_time (const Skill &skill) override
 Get the estimated execution time for the given skill string. More...
 
bool can_provide_exec_time (const Skill &skill) const override
 Check if this estimator can give an estimate for a given skill. More...
 
std::pair< SkillerInterface::SkillStatusEnum, std::string > execute (const Skill &skill) override
 Let the estimator know that we are executing this skill, so it can apply possible side effects. More...
 
- Public Member Functions inherited from fawkes::ExecutionTimeEstimator
 ExecutionTimeEstimator (Configuration *config, const ::std::string &cfg_prefix)
 Constructor. More...
 
virtual ~ExecutionTimeEstimator ()=default
 Destructor. More...
 
virtual bool can_execute (const Skill &skill)
 Check if this estimator is both allowed and able to give an estimate for a given skill. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::ExecutionTimeEstimator
std::map< std::string, Skillget_skills_from_config (const std::string &path) const
 Load skill descriptions from a yaml config. More...
 
template<typename T >
get_property (const Property< T > &property) const
 Get the current property value for active_whitelist_entry_. More...
 
- Protected Attributes inherited from fawkes::ExecutionTimeEstimator
Configuration *const config_
 Config to obtain common configurables. More...
 
const std::string cfg_prefix_
 Config prefix of the estimator. More...
 
const float speed_
 Config estimator-specific speedup factor. More...
 
std::map< std::string, Skill >::const_iterator active_whitelist_entry_
 Points to the whitelist entry that matches the skill to execute. More...
 
const std::map< std::string, Skillwhitelist_
 Whitelist of skills that the estimator is allowed to process. More...
 
const std::map< std::string, Skillblacklist_
 Blacklist of skills that the estimator must not process. More...
 

Detailed Description

Estimate the execution time for the skill goto by querying the distance from the navgraph.

Definition at line 33 of file navgraph_estimator.h.

Constructor & Destructor Documentation

◆ NavGraphEstimator()

fawkes::NavGraphEstimator::NavGraphEstimator ( LockPtr< NavGraph navgraph,
Configuration config,
const std::string &  cfg_prefix 
)

Constructor.

Parameters
navgraphThe navgraph to read the node positions from
configThe config to read the initial position from
cfg_prefixThe config prefix to use for config parameters

Definition at line 35 of file navgraph_estimator.cpp.

References fawkes::Configuration::get_float_or_default().

Member Function Documentation

◆ can_provide_exec_time()

bool fawkes::NavGraphEstimator::can_provide_exec_time ( const Skill skill) const
overridevirtual

Check if this estimator can give an estimate for a given skill.

Parameters
skillThe skill object to check.
Returns
true if this estimator can give an execution time estimate for the given skill.

Implements fawkes::ExecutionTimeEstimator.

Definition at line 48 of file navgraph_estimator.cpp.

References fawkes::ExecutionTimeEstimator::get_property(), and fawkes::ExecutionTimeEstimator::Skill::skill_args.

◆ execute()

std::pair< SkillerInterface::SkillStatusEnum, std::string > fawkes::NavGraphEstimator::execute ( const Skill skill)
overridevirtual

Let the estimator know that we are executing this skill, so it can apply possible side effects.

Parameters
skillThe skill to execute
Returns
skill status after simulated execution along with an error description in case the skill fails

Reimplemented from fawkes::ExecutionTimeEstimator.

Definition at line 73 of file navgraph_estimator.cpp.

References fawkes::ExecutionTimeEstimator::Skill::skill_args.

◆ get_execution_time()

float fawkes::NavGraphEstimator::get_execution_time ( const Skill skill)
overridevirtual

Get the estimated execution time for the given skill string.

Parameters
skillThe skill object to compute the execution time for.
Returns
The execution time in seconds.

Implements fawkes::ExecutionTimeEstimator.

Definition at line 55 of file navgraph_estimator.cpp.

References fawkes::ExecutionTimeEstimator::get_property(), fawkes::ExecutionTimeEstimator::Skill::skill_args, and fawkes::ExecutionTimeEstimator::speed_.


The documentation for this class was generated from the following files: