Changes have been pushed for the repository "fawkesrobotics/fawkes".

Clone:  https://github.com/fawkesrobotics/fawkes.git
Gitweb: https://github.com/fawkesrobotics/fawkes

The branch, thofmann/standalone-execution-time-estimator has been updated
        to  99ae21b2984c4ef9a8eaf4ccd62fda84496a04a3 (commit)
       via  095fbd7f012ace3c0883ecbb8e62103b4ff3a00f (commit)
       via  04b09440788053b4ef539fd14ac33de31a2744b4 (commit)
      from  dd868135105608f844721acd11b2bcf2a636aded (commit)

https://github.com/fawkesrobotics/fawkes/tree/thofmann/standalone-execution-time-estimator

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit 04b09440788053b4ef539fd14ac33de31a2744b4
Author:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
AuthorDate: Thu May 7 09:09:31 2020 +0200
Commit:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
CommitDate: Thu May 7 09:11:43 2020 +0200

    execution-time-estimator: move static estimate config to `skills/`
    
    Move the static estimate config values for particular skills to the
    `skills` sub-space in the config. This avoids mixing general config
    values with the skill estimates.

https://github.com/fawkesrobotics/fawkes/commit/04b094407

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 095fbd7f012ace3c0883ecbb8e62103b4ff3a00f
Author:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
AuthorDate: Thu May 7 09:19:04 2020 +0200
Commit:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
CommitDate: Thu May 7 09:19:04 2020 +0200

    execution-time-estimator: move cfg prefix to thread class
    
    We will also need the config prefix in the plugin's thread itself. To avoid
    defining it twice, only define it in the thread class and pass it to the
    estimator.

https://github.com/fawkesrobotics/fawkes/commit/095fbd7f0

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 99ae21b2984c4ef9a8eaf4ccd62fda84496a04a3
Author:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
AuthorDate: Thu May 7 09:21:34 2020 +0200
Commit:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
CommitDate: Thu May 7 09:24:47 2020 +0200

    execution-time-estimator: make static estimator's priority configurable

https://github.com/fawkesrobotics/fawkes/commit/99ae21b29

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 cfg/conf.d/execution-time-estimator.yaml               |  3 ++-
 .../estimators/config_estimator.cpp                    | 18 ++++++++++--------
 .../estimators/config_estimator.h                      |  6 +++---
 .../execution_time_estimator_thread.cpp                |  5 ++++-
 .../execution_time_estimator_thread.h                  |  1 +
 5 files changed, 20 insertions(+), 13 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* 04b09440788053b4ef539fd14ac33de31a2744b4 - - - - - - - - - -
Author:  Till Hofmann <hofm...@kbsg.rwth-aachen.de>
Date:    Thu May 7 09:09:31 2020 +0200
Subject: execution-time-estimator: move static estimate config to `skills/`

 cfg/conf.d/execution-time-estimator.yaml                           | 3 ++-
 .../execution-time-estimator/estimators/config_estimator.cpp       | 7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

_Diff for modified files_:
diff --git a/cfg/conf.d/execution-time-estimator.yaml 
b/cfg/conf.d/execution-time-estimator.yaml
index fae2689a7..d94d6ccc1 100644
--- a/cfg/conf.d/execution-time-estimator.yaml
+++ b/cfg/conf.d/execution-time-estimator.yaml
@@ -4,7 +4,8 @@
 plugins/execution-time-estimator:
   static:
     default: 1
-    say: 2.5
+    skills:
+      say: 2.5
   navgraph:
     speed: 0.5
     skills:
diff --git 
a/src/plugins/execution-time-estimator/estimators/config_estimator.cpp 
b/src/plugins/execution-time-estimator/estimators/config_estimator.cpp
index 84aef6b1b..a84c03fed 100644
--- a/src/plugins/execution-time-estimator/estimators/config_estimator.cpp
+++ b/src/plugins/execution-time-estimator/estimators/config_estimator.cpp
@@ -40,14 +40,15 @@ 
ConfigExecutionTimeEstimator::ConfigExecutionTimeEstimator(Configuration *config
 bool
 ConfigExecutionTimeEstimator::can_execute(const Skill &skill) const
 {
-       return config_->exists(cfg_prefix_ + skill.skill_name)
-              || config_->exists(cfg_prefix_ + std::string{"default"});
+       return config_->exists(std::string{cfg_prefix_} + "skills/" + 
skill.skill_name)
+              || config_->exists(std::string{cfg_prefix_} + "default");
 }
 
 float
 ConfigExecutionTimeEstimator::get_execution_time(const Skill &skill) const
 {
-       if (const std::string cfg_path = cfg_prefix_ + skill.skill_name; 
config_->exists(cfg_path)) {
+       if (const std::string cfg_path = std::string{cfg_prefix_} + "skills/" + 
skill.skill_name;
+           config_->exists(cfg_path)) {
                return config_->get_float(cfg_path);
        } else if (const std::string default_path = cfg_prefix_ + 
std::string{"default"};
                   config_->exists(default_path)) {

- *commit* 095fbd7f012ace3c0883ecbb8e62103b4ff3a00f - - - - - - - - - -
Author:  Till Hofmann <hofm...@kbsg.rwth-aachen.de>
Date:    Thu May 7 09:19:04 2020 +0200
Subject: execution-time-estimator: move cfg prefix to thread class

 .../estimators/config_estimator.cpp                     | 17 +++++++++--------
 .../estimators/config_estimator.h                       |  6 +++---
 .../execution_time_estimator_thread.cpp                 |  4 +++-
 .../execution_time_estimator_thread.h                   |  1 +
 4 files changed, 16 insertions(+), 12 deletions(-)

_Diff for modified files_:
diff --git 
a/src/plugins/execution-time-estimator/estimators/config_estimator.cpp 
b/src/plugins/execution-time-estimator/estimators/config_estimator.cpp
index a84c03fed..70fbd4c6b 100644
--- a/src/plugins/execution-time-estimator/estimators/config_estimator.cpp
+++ b/src/plugins/execution-time-estimator/estimators/config_estimator.cpp
@@ -22,8 +22,6 @@
 
 namespace fawkes {
 
-constexpr char ConfigExecutionTimeEstimator::cfg_prefix_[];
-
 /** @class ConfigExecutionTimeEstimator
  * Get a static estimate for the skill execution time from the config.
  * This simply reads the execution time from the config. It only considers
@@ -31,26 +29,29 @@ constexpr char ConfigExecutionTimeEstimator::cfg_prefix_[];
  */
 
 /** Constructor
- * @param config The config to read the execution times from
+ * @param config The config to read from
+ * @param cfg_prefix The config prefix to read from
  */
-ConfigExecutionTimeEstimator::ConfigExecutionTimeEstimator(Configuration 
*config) : config_(config)
+ConfigExecutionTimeEstimator::ConfigExecutionTimeEstimator(Configuration *    
config,
+                                                           const std::string 
&cfg_prefix)
+: config_(config), cfg_prefix_(cfg_prefix)
 {
 }
 
 bool
 ConfigExecutionTimeEstimator::can_execute(const Skill &skill) const
 {
-       return config_->exists(std::string{cfg_prefix_} + "skills/" + 
skill.skill_name)
-              || config_->exists(std::string{cfg_prefix_} + "default");
+       return config_->exists(cfg_prefix_ + "skills/" + skill.skill_name)
+              || config_->exists(cfg_prefix_ + "default");
 }
 
 float
 ConfigExecutionTimeEstimator::get_execution_time(const Skill &skill) const
 {
-       if (const std::string cfg_path = std::string{cfg_prefix_} + "skills/" + 
skill.skill_name;
+       if (const std::string cfg_path = cfg_prefix_ + "skills/" + 
skill.skill_name;
            config_->exists(cfg_path)) {
                return config_->get_float(cfg_path);
-       } else if (const std::string default_path = cfg_prefix_ + 
std::string{"default"};
+       } else if (const std::string default_path = cfg_prefix_ + "default";
                   config_->exists(default_path)) {
                return config_->get_float(default_path);
        } else
diff --git a/src/plugins/execution-time-estimator/estimators/config_estimator.h 
b/src/plugins/execution-time-estimator/estimators/config_estimator.h
index b310e1b11..9973dd6b6 100644
--- a/src/plugins/execution-time-estimator/estimators/config_estimator.h
+++ b/src/plugins/execution-time-estimator/estimators/config_estimator.h
@@ -27,13 +27,13 @@ namespace fawkes {
 class ConfigExecutionTimeEstimator : public ExecutionTimeEstimator
 {
 public:
-       ConfigExecutionTimeEstimator(Configuration *config);
+       ConfigExecutionTimeEstimator(Configuration *config, const std::string 
&cfg_prefix);
        float get_execution_time(const Skill &skill) const override;
        bool  can_execute(const Skill &skill) const override;
 
 private:
-       Configuration *const  config_;
-       constexpr static char cfg_prefix_[] = 
"/plugins/execution-time-estimator/static/";
+       Configuration *const config_;
+       const std::string    cfg_prefix_;
 };
 
 } // namespace fawkes
diff --git 
a/src/plugins/execution-time-estimator/execution_time_estimator_thread.cpp 
b/src/plugins/execution-time-estimator/execution_time_estimator_thread.cpp
index a00bb9417..7d634bca7 100644
--- a/src/plugins/execution-time-estimator/execution_time_estimator_thread.cpp
+++ b/src/plugins/execution-time-estimator/execution_time_estimator_thread.cpp
@@ -28,6 +28,8 @@
  *  @author Till Hofmann
  */
 
+constexpr char ExecutionTimeEstimatorsThread::cfg_prefix_[];
+
 ExecutionTimeEstimatorsThread::ExecutionTimeEstimatorsThread()
 : Thread("ExecutionTimeEstimatorThread", Thread::OPMODE_WAITFORWAKEUP),
   AspectProviderAspect(&provider_inifin_),
@@ -39,5 +41,5 @@ void
 ExecutionTimeEstimatorsThread::init()
 {
        execution_time_estimator_manager_.register_provider(
-         std::make_shared<fawkes::ConfigExecutionTimeEstimator>(config), -1);
+         std::make_shared<fawkes::ConfigExecutionTimeEstimator>(config, 
cfg_prefix_), -1);
 }
diff --git 
a/src/plugins/execution-time-estimator/execution_time_estimator_thread.h 
b/src/plugins/execution-time-estimator/execution_time_estimator_thread.h
index d61905f1f..f1af27f59 100644
--- a/src/plugins/execution-time-estimator/execution_time_estimator_thread.h
+++ b/src/plugins/execution-time-estimator/execution_time_estimator_thread.h
@@ -38,4 +38,5 @@ public:
 private:
        fawkes::ExecutionTimeEstimatorManager       
execution_time_estimator_manager_;
        fawkes::ExecutionTimeEstimatorsAspectIniFin provider_inifin_;
+       constexpr static char cfg_prefix_[] = 
"/plugins/execution-time-estimator/static/";
 };

- *commit* 99ae21b2984c4ef9a8eaf4ccd62fda84496a04a3 - - - - - - - - - -
Author:  Till Hofmann <hofm...@kbsg.rwth-aachen.de>
Date:    Thu May 7 09:21:34 2020 +0200
Subject: execution-time-estimator: make static estimator's priority configurable

 .../execution-time-estimator/execution_time_estimator_thread.cpp       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

_Diff for modified files_:
diff --git 
a/src/plugins/execution-time-estimator/execution_time_estimator_thread.cpp 
b/src/plugins/execution-time-estimator/execution_time_estimator_thread.cpp
index 7d634bca7..f35efb8a7 100644
--- a/src/plugins/execution-time-estimator/execution_time_estimator_thread.cpp
+++ b/src/plugins/execution-time-estimator/execution_time_estimator_thread.cpp
@@ -41,5 +41,6 @@ void
 ExecutionTimeEstimatorsThread::init()
 {
        execution_time_estimator_manager_.register_provider(
-         std::make_shared<fawkes::ConfigExecutionTimeEstimator>(config, 
cfg_prefix_), -1);
+         std::make_shared<fawkes::ConfigExecutionTimeEstimator>(config, 
cfg_prefix_),
+         config->get_int_or_default((std::string{cfg_prefix_} + 
"priority").c_str(), 0));
 }



_______________________________________________
fawkes-commits mailing list
fawkes-commits@lists.kbsg.rwth-aachen.de
https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits

Reply via email to