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 d77c834f1265f8ab83d013a1d1421635f5c152fa (commit) via 390263c33317b32f125bcf867f9e6285a0f8e14d (commit) via 0f46eeeb469a68e0033be13ae31518130d934c70 (commit) via 8a91719135bc95cdf870476c245a69843e2fb5ed (commit) via cf7193eac383384fab0150cc3e7b98c7283f8fa7 (commit) via 1a837bb2f70dfc713d9d2c688a91aad0f411bab4 (commit) via 3abb61226300c154a49b72e908a494ef49d964ce (commit) from 83d6fc4fe54a56d4573138fe3d591ba881bbb45e (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 3abb61226300c154a49b72e908a494ef49d964ce Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Thu Apr 30 17:46:10 2020 +0200 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Thu Apr 30 17:50:33 2020 +0200 execution_time_estimator: throw exception if no provider exists Instead of returning an optional, throw an exception if no provider exists. The optional was used to allow some default value, but we can also provide the default value directly from the estimators, which allows a cleaner interface and it makes sure that all callers use the same default value. https://github.com/fawkesrobotics/fawkes/commit/3abb61226 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commit 1a837bb2f70dfc713d9d2c688a91aad0f411bab4 Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Thu Apr 30 17:54:36 2020 +0200 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Thu Apr 30 17:54:36 2020 +0200 skiller-simulator: remove default skill runtime The default should be handled by the execution time estimators instead. https://github.com/fawkesrobotics/fawkes/commit/1a837bb2f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commit cf7193eac383384fab0150cc3e7b98c7283f8fa7 Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Thu Apr 30 17:59:00 2020 +0200 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Thu Apr 30 17:59:00 2020 +0200 execution-time-estimator: provide the default from the config estimator The default execution time should be defined in the config and thus be handled by the config estimator. https://github.com/fawkesrobotics/fawkes/commit/cf7193eac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commit 8a91719135bc95cdf870476c245a69843e2fb5ed Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Thu Apr 30 18:05:08 2020 +0200 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Thu Apr 30 18:05:08 2020 +0200 execution-time-estimator: adapt config prefix of config estimator https://github.com/fawkesrobotics/fawkes/commit/8a9171913 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commit 0f46eeeb469a68e0033be13ae31518130d934c70 Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Thu Apr 30 18:11:02 2020 +0200 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Thu Apr 30 18:11:02 2020 +0200 execution-time-estimator-navgraph: adapt config prefix Do not use `skiller-simulator` in the config prefix. Also define the config prefix instead of hardcoding it. https://github.com/fawkesrobotics/fawkes/commit/0f46eeeb4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commit 390263c33317b32f125bcf867f9e6285a0f8e14d Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Thu Apr 30 18:14:47 2020 +0200 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Thu Apr 30 18:14:47 2020 +0200 config: adapt to changes in the execution-time-estimator https://github.com/fawkesrobotics/fawkes/commit/390263c33 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commit d77c834f1265f8ab83d013a1d1421635f5c152fa Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Thu Apr 30 18:20:02 2020 +0200 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Thu Apr 30 18:20:02 2020 +0200 execution-time-estimator-navgraph: rename all classes Fix remaining references to the skiller simulator in the class names. Co-Authored-By: Tarik Viehmann <viehm...@kbsg.rwth-aachen.de> https://github.com/fawkesrobotics/fawkes/commit/d77c834f1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *Summary* ----------------------------------------------------------- cfg/conf.d/execution-time-estimator.yaml | 11 +++++++++++ cfg/conf.d/skiller-simulator.yaml | 12 ------------ .../aspect/execution_time_estimator.cpp | 11 ++++++----- .../aspect/execution_time_estimator.h | 4 +--- src/plugins/execution-time-estimator-navgraph/Makefile | 2 +- .../execution_time_estimator_navgraph_plugin.cpp | 10 +++++----- .../execution_time_estimator_navgraph_thread.cpp | 10 +++++----- .../execution_time_estimator_navgraph_thread.h | 12 ++++++------ .../navgraph_estimator.cpp | 8 +++++--- .../execution-time-estimator-navgraph/navgraph_estimator.h | 1 + .../estimators/config_estimator.cpp | 6 ++++-- .../execution-time-estimator/estimators/config_estimator.h | 2 +- src/plugins/skiller-simulator/exec_thread.cpp | 14 +++----------- src/plugins/skiller-simulator/exec_thread.h | 1 - 14 files changed, 49 insertions(+), 55 deletions(-) create mode 100644 cfg/conf.d/execution-time-estimator.yaml delete mode 100644 cfg/conf.d/skiller-simulator.yaml - *Diffs* ------------------------------------------------------------- - *commit* 3abb61226300c154a49b72e908a494ef49d964ce - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Thu Apr 30 17:46:10 2020 +0200 Subject: execution_time_estimator: throw exception if no provider exists .../aspect/execution_time_estimator.cpp | 11 ++++++----- .../aspect/execution_time_estimator.h | 4 +--- 2 files changed, 7 insertions(+), 8 deletions(-) _Diff for modified files_: diff --git a/src/libs/execution_time_estimator/aspect/execution_time_estimator.cpp b/src/libs/execution_time_estimator/aspect/execution_time_estimator.cpp index e8bb025cd..097835b50 100644 --- a/src/libs/execution_time_estimator/aspect/execution_time_estimator.cpp +++ b/src/libs/execution_time_estimator/aspect/execution_time_estimator.cpp @@ -21,6 +21,7 @@ #include "execution_time_estimator.h" #include <core/exception.h> +#include <core/exceptions/software.h> #include <algorithm> @@ -32,18 +33,18 @@ namespace fawkes { /** Get the running time provider for the given skill string. * @param skill_string The string to get the running time for - * @return an optional with a pointer to the provider, an optional without a - * value if no provider exists + * @return a pointer to the provider + * @throws IllegalArgumentException if no provider for the given skill exists */ -std::optional<std::shared_ptr<ExecutionTimeEstimator>> +std::shared_ptr<ExecutionTimeEstimator> ExecutionTimeEstimatorManager::get_provider(const std::string &skill_string) const { for (auto &provider : execution_time_estimators_) { if (provider->can_execute(skill_string)) { - return std::make_optional<std::shared_ptr<ExecutionTimeEstimator>>(provider); + return std::shared_ptr<ExecutionTimeEstimator>(provider); } } - return std::optional<std::shared_ptr<ExecutionTimeEstimator>>(); + throw IllegalArgumentException("No provider found for %s", skill_string.c_str()); } /** Add a running time provider. diff --git a/src/libs/execution_time_estimator/aspect/execution_time_estimator.h b/src/libs/execution_time_estimator/aspect/execution_time_estimator.h index f2e344908..ff111c132 100644 --- a/src/libs/execution_time_estimator/aspect/execution_time_estimator.h +++ b/src/libs/execution_time_estimator/aspect/execution_time_estimator.h @@ -24,7 +24,6 @@ #include <execution_time_estimator/execution_time_estimator.h> #include <memory> -#include <optional> #include <vector> namespace fawkes { @@ -32,8 +31,7 @@ namespace fawkes { class ExecutionTimeEstimatorManager { public: - std::optional<std::shared_ptr<ExecutionTimeEstimator>> - get_provider(const std::string &skill_string) const; + std::shared_ptr<ExecutionTimeEstimator> get_provider(const std::string &skill_string) const; void register_provider(std::shared_ptr<ExecutionTimeEstimator> provider); void unregister_provider(std::shared_ptr<ExecutionTimeEstimator> provider); - *commit* 1a837bb2f70dfc713d9d2c688a91aad0f411bab4 - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Thu Apr 30 17:54:36 2020 +0200 Subject: skiller-simulator: remove default skill runtime src/plugins/skiller-simulator/exec_thread.cpp | 14 +++----------- src/plugins/skiller-simulator/exec_thread.h | 1 - 2 files changed, 3 insertions(+), 12 deletions(-) _Diff for modified files_: diff --git a/src/plugins/skiller-simulator/exec_thread.cpp b/src/plugins/skiller-simulator/exec_thread.cpp index ef29421ad..4ac6377b7 100644 --- a/src/plugins/skiller-simulator/exec_thread.cpp +++ b/src/plugins/skiller-simulator/exec_thread.cpp @@ -41,9 +41,7 @@ SkillerSimulatorExecutionThread::SkillerSimulatorExecutionThread() void SkillerSimulatorExecutionThread::init() { - skiller_if_ = blackboard->open_for_writing<SkillerInterface>("Skiller"); - default_skill_runtime_ = - config->get_float_or_default("/plugins/skiller-simulator/execution-times/default", 1); + skiller_if_ = blackboard->open_for_writing<SkillerInterface>("Skiller"); skill_starttime_ = Time(); } @@ -175,18 +173,12 @@ float SkillerSimulatorExecutionThread::get_skill_runtime(const std::string &skill) const { auto provider = execution_time_estimator_manager_->get_provider(skill); - if (provider) { - return (*provider)->get_execution_time(skill); - } else { - return default_skill_runtime_; - } + return provider->get_execution_time(skill); } void SkillerSimulatorExecutionThread::execute_skill(const std::string &skill) { auto provider = execution_time_estimator_manager_->get_provider(skill); - if (provider) { - (*provider)->execute(skill); - } + return provider->execute(skill); } diff --git a/src/plugins/skiller-simulator/exec_thread.h b/src/plugins/skiller-simulator/exec_thread.h index 0aaa8fbd7..c30784615 100644 --- a/src/plugins/skiller-simulator/exec_thread.h +++ b/src/plugins/skiller-simulator/exec_thread.h @@ -56,7 +56,6 @@ private: float get_skill_runtime(const std::string &skill) const; void execute_skill(const std::string &skill); fawkes::SkillerInterface *skiller_if_; - float default_skill_runtime_; fawkes::Time skill_starttime_; }; - *commit* cf7193eac383384fab0150cc3e7b98c7283f8fa7 - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Thu Apr 30 17:59:00 2020 +0200 Subject: execution-time-estimator: provide the default from the config estimator .../execution-time-estimator/estimators/config_estimator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 ec861eb48..3d0abebf7 100644 --- a/src/plugins/execution-time-estimator/estimators/config_estimator.cpp +++ b/src/plugins/execution-time-estimator/estimators/config_estimator.cpp @@ -40,12 +40,14 @@ ConfigExecutionTimeEstimator::ConfigExecutionTimeEstimator(Configuration *config bool ConfigExecutionTimeEstimator::can_execute(const Skill &skill) const { - return config_->exists(cfg_prefix_ + skill.skill_name); + return config_->exists(cfg_prefix_ + skill.skill_name) + || config_->exists(cfg_prefix_ + std::string{"default"}); } float ConfigExecutionTimeEstimator::get_execution_time(const Skill &skill) const { - return config_->get_float(cfg_prefix_ + skill.skill_name); + return config_->get_float_or_default((cfg_prefix_ + skill.skill_name).c_str(), + config_->get_float(cfg_prefix_ + std::string{"default"})); } } // namespace fawkes - *commit* 8a91719135bc95cdf870476c245a69843e2fb5ed - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Thu Apr 30 18:05:08 2020 +0200 Subject: execution-time-estimator: adapt config prefix of config estimator src/plugins/execution-time-estimator/estimators/config_estimator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) _Diff for modified files_: diff --git a/src/plugins/execution-time-estimator/estimators/config_estimator.h b/src/plugins/execution-time-estimator/estimators/config_estimator.h index cb9000e42..b310e1b11 100644 --- a/src/plugins/execution-time-estimator/estimators/config_estimator.h +++ b/src/plugins/execution-time-estimator/estimators/config_estimator.h @@ -33,7 +33,7 @@ public: private: Configuration *const config_; - constexpr static char cfg_prefix_[] = "/plugins/skiller-simulator/execution-times/"; + constexpr static char cfg_prefix_[] = "/plugins/execution-time-estimator/static/"; }; } // namespace fawkes - *commit* 0f46eeeb469a68e0033be13ae31518130d934c70 - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Thu Apr 30 18:11:02 2020 +0200 Subject: execution-time-estimator-navgraph: adapt config prefix .../execution-time-estimator-navgraph/navgraph_estimator.cpp | 8 +++++--- .../execution-time-estimator-navgraph/navgraph_estimator.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) _Diff for modified files_: diff --git a/src/plugins/execution-time-estimator-navgraph/navgraph_estimator.cpp b/src/plugins/execution-time-estimator-navgraph/navgraph_estimator.cpp index 1963a8ddf..4fca9dd6f 100644 --- a/src/plugins/execution-time-estimator-navgraph/navgraph_estimator.cpp +++ b/src/plugins/execution-time-estimator-navgraph/navgraph_estimator.cpp @@ -22,6 +22,8 @@ namespace fawkes { +constexpr char NavGraphEstimator::cfg_prefix_[]; + /** @class NavGraphEstimator * Estimate the execution time for the skill goto by querying the distance from * the navgraph. @@ -36,9 +38,9 @@ NavGraphEstimator::NavGraphEstimator(LockPtr<NavGraph> navgraph, Configuration * { last_pose_x_ = config->get_float_or_default("plugins/amcl/init_pose_x", 0); last_pose_y_ = config->get_float_or_default("plugins/amcl/init_pose_y", 0); - speed_ = config->get_float_or_default("plugins/skiller-simulator/estimators/navgraph/speed", 0.5); - skills_ = config->get_strings_or_defaults("plugins/skiller-simulator/estimators/navgraph/skills", - {"goto"}); + speed_ = config->get_float_or_default((std::string{cfg_prefix_} + "speed").c_str(), 0.5); + skills_ = + config->get_strings_or_defaults((std::string{cfg_prefix_} + "skills").c_str(), {"goto"}); } bool diff --git a/src/plugins/execution-time-estimator-navgraph/navgraph_estimator.h b/src/plugins/execution-time-estimator-navgraph/navgraph_estimator.h index 103092c22..bb5369790 100644 --- a/src/plugins/execution-time-estimator-navgraph/navgraph_estimator.h +++ b/src/plugins/execution-time-estimator-navgraph/navgraph_estimator.h @@ -44,5 +44,6 @@ private: float last_pose_x_; float last_pose_y_; float speed_; + constexpr static char cfg_prefix_[] = "plugins/execution-time-estimator/navgraph"; }; } // namespace fawkes - *commit* 390263c33317b32f125bcf867f9e6285a0f8e14d - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Thu Apr 30 18:14:47 2020 +0200 Subject: config: adapt to changes in the execution-time-estimator cfg/conf.d/execution-time-estimator.yaml | 11 +++++++++++ cfg/conf.d/skiller-simulator.yaml | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) - *commit* d77c834f1265f8ab83d013a1d1421635f5c152fa - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Thu Apr 30 18:20:02 2020 +0200 Subject: execution-time-estimator-navgraph: rename all classes src/plugins/execution-time-estimator-navgraph/Makefile | 2 +- .../execution_time_estimator_navgraph_plugin.cpp | 10 +++++----- .../execution_time_estimator_navgraph_thread.cpp | 10 +++++----- .../execution_time_estimator_navgraph_thread.h | 12 ++++++------ 4 files changed, 17 insertions(+), 17 deletions(-) _Diff for modified files_: diff --git a/src/plugins/execution-time-estimator-navgraph/Makefile b/src/plugins/execution-time-estimator-navgraph/Makefile index 162652563..6d63b8e52 100644 --- a/src/plugins/execution-time-estimator-navgraph/Makefile +++ b/src/plugins/execution-time-estimator-navgraph/Makefile @@ -42,7 +42,7 @@ all: $(WARN_TARGETS) .PHONY: $(WARN_TARGETS) warning_cpp17: - $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting skiller simulator navgraph$(TNORMAL) (C++17 not supported)" + $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting execution time estimator navgraph plugin$(TNORMAL) (C++17 not supported)" endif include $(BUILDSYSDIR)/base.mk diff --git a/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_plugin.cpp b/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_plugin.cpp index 840d8f5ab..3400f9be8 100644 --- a/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_plugin.cpp +++ b/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_plugin.cpp @@ -22,21 +22,21 @@ #include <core/plugin.h> -/** @class SkillerSimulatorNavgraphPlugin +/** @class ExecutionTimeEstimatorNavgraphPlugin * Plugin to get estimates for skill execution times from the navgraph. */ -class SkillerSimulatorNavgraphPlugin : public fawkes::Plugin +class ExecutionTimeEstimatorNavgraphPlugin : public fawkes::Plugin { public: /** Constructor. * @param config The fawkes config to use */ - explicit SkillerSimulatorNavgraphPlugin(fawkes::Configuration *config) : Plugin(config) + explicit ExecutionTimeEstimatorNavgraphPlugin(fawkes::Configuration *config) : Plugin(config) { - thread_list.push_back(new SkillerSimulatorNavgraphEstimatorThread()); + thread_list.push_back(new ExecutionTimeEstimatorNavgraphThread()); } }; PLUGIN_DESCRIPTION("Estimate skill execution times with the navgraph") -EXPORT_PLUGIN(SkillerSimulatorNavgraphPlugin) +EXPORT_PLUGIN(ExecutionTimeEstimatorNavgraphPlugin) diff --git a/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_thread.cpp b/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_thread.cpp index 491af178d..07ea29e9e 100644 --- a/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_thread.cpp +++ b/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_thread.cpp @@ -24,19 +24,19 @@ #include <interfaces/Position3DInterface.h> -/** @class SkillerSimulatorNavgraphEstimatorThread +/** @class ExecutionTimeEstimatorNavgraphThread * Get estimates for skill execution times from the navgraph. */ /** Constructor. */ -SkillerSimulatorNavgraphEstimatorThread::SkillerSimulatorNavgraphEstimatorThread() -: Thread("SkillerSimulatorNavgraphEstimatorThread", Thread::OPMODE_WAITFORWAKEUP) +ExecutionTimeEstimatorNavgraphThread::ExecutionTimeEstimatorNavgraphThread() +: Thread("ExecutionTimeEstimatorNavgraphThread", Thread::OPMODE_WAITFORWAKEUP) { } /** Register the estimator. */ void -SkillerSimulatorNavgraphEstimatorThread::init() +ExecutionTimeEstimatorNavgraphThread::init() { estimator_ = std::make_shared<fawkes::NavGraphEstimator>(navgraph, config); execution_time_estimator_manager_->register_provider(estimator_); @@ -44,7 +44,7 @@ SkillerSimulatorNavgraphEstimatorThread::init() /** Unregister the estimator. */ void -SkillerSimulatorNavgraphEstimatorThread::finalize() +ExecutionTimeEstimatorNavgraphThread::finalize() { execution_time_estimator_manager_->unregister_provider(estimator_); } diff --git a/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_thread.h b/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_thread.h index 6e781902a..41ddcdb5f 100644 --- a/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_thread.h +++ b/src/plugins/execution-time-estimator-navgraph/execution_time_estimator_navgraph_thread.h @@ -27,14 +27,14 @@ #include <core/threading/thread.h> #include <navgraph/aspect/navgraph.h> -class SkillerSimulatorNavgraphEstimatorThread : public fawkes::Thread, - public fawkes::BlackBoardAspect, - public fawkes::ConfigurableAspect, - public fawkes::NavGraphAspect, - public fawkes::ExecutionTimeEstimatorsAspect +class ExecutionTimeEstimatorNavgraphThread : public fawkes::Thread, + public fawkes::BlackBoardAspect, + public fawkes::ConfigurableAspect, + public fawkes::NavGraphAspect, + public fawkes::ExecutionTimeEstimatorsAspect { public: - SkillerSimulatorNavgraphEstimatorThread(); + ExecutionTimeEstimatorNavgraphThread(); void init(); void finalize(); _______________________________________________ fawkes-commits mailing list fawkes-commits@lists.kbsg.rwth-aachen.de https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits