Fawkes API  Fawkes Development Version
navgraph_estimator.h
1 /***************************************************************************
2  * navgraph_estimator.h - Estimate skill exec times from the navgraph
3  *
4  * Created: Tue 07 Jan 2020 16:18:59 CET 16:18
5  * Copyright 2020 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
6  ****************************************************************************/
7 
8 /* This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Library General Public License for more details.
17  *
18  * Read the full text in the LICENSE.GPL file in the doc directory.
19  */
20 
21 #pragma once
22 
23 #include "interfaces/Position3DInterface.h"
24 
25 #include <config/config.h>
26 #include <execution_time_estimator/aspect/execution_time_estimator.h>
27 #include <navgraph/navgraph.h>
28 
29 #include <string>
30 #include <vector>
31 
32 namespace fawkes {
34 {
35 public:
37  Configuration * config,
38  const std::string &cfg_prefix);
39  float get_execution_time(const Skill &skill) override;
40  bool can_provide_exec_time(const Skill &skill) const override;
41  std::pair<SkillerInterface::SkillStatusEnum, std::string> execute(const Skill &skill) override;
42 
43 private:
44  LockPtr<NavGraph> navgraph_;
45  float last_pose_x_;
46  float last_pose_y_;
47  const Property<std::string> source_names_;
48  const Property<std::string> dest_names_;
49 };
50 } // namespace fawkes
Interface for configuration handling.
Definition: config.h:68
A configurable property that is skill-specific and may have a default value.
A structured representation of a skill.
An abstract estimator for the execution time of a skill.
LockPtr<> is a reference-counting shared lockable smartpointer.
Definition: lockptr.h:55
Estimate the execution time for the skill goto by querying the distance from the navgraph.
bool can_provide_exec_time(const Skill &skill) const override
Check if this estimator can give an estimate for a given skill.
float get_execution_time(const Skill &skill) override
Get the estimated execution time for the given skill string.
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.
NavGraphEstimator(LockPtr< NavGraph > navgraph, Configuration *config, const std::string &cfg_prefix)
Constructor.
Fawkes library namespace.