Fawkes API
Fawkes Development Version
|
21 #include "navgraph_estimator.h"
37 const std::string &cfg_prefix)
40 source_names_(config_, cfg_prefix_,
"start",
""),
41 dest_names_(config_, cfg_prefix_,
"target")
51 return navgraph_->node_exists(skill.
skill_args.at(dest_name));
57 float current_pose_x = last_pose_x_;
58 float current_pose_y = last_pose_y_;
60 if (source_name !=
"") {
61 const std::string start = skill.
skill_args.at(source_name);
62 if (navgraph_->node_exists(start)) {
63 current_pose_x = navgraph_->node(start).x();
64 current_pose_y = navgraph_->node(start).y();
68 .distance(current_pose_x, current_pose_y)
72 std::pair<SkillerInterface::SkillStatusEnum, std::string>
75 auto node = navgraph_->node(skill.
skill_args.at(
"place"));
76 last_pose_x_ = node.x();
77 last_pose_y_ = node.y();
78 return std::make_pair(SkillerInterface::SkillStatusEnum::S_FINAL,
"");
LockPtr<> is a reference-counting shared lockable smartpointer.
float get_execution_time(const Skill &skill) override
Get the estimated execution time for the given skill string.
virtual float get_float_or_default(const char *path, const float &default_val)
Get value from configuration which is of type float, or the given default if the path does not exist.
NavGraphEstimator(LockPtr< NavGraph > navgraph, Configuration *config, const std::string &cfg_prefix)
Constructor.
T get_property(const Property< T > &property) const
Get the current property value for active_whitelist_entry_.
Interface for configuration handling.
A structured representation of a skill.
std::unordered_map< std::string, std::string > skill_args
A map of the skill's argument keys to argument values.
Fawkes library namespace.
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.
bool can_provide_exec_time(const Skill &skill) const override
Check if this estimator can give an estimate for a given skill.
An abstract estimator for the execution time of a skill.
const float speed_
Config estimator-specific speedup factor.