Changes have been pushed for the project "Fawkes Robotics Software Framework".
Gitweb: http://git.fawkesrobotics.org/fawkes.git Trac: http://trac.fawkesrobotics.org The branch, thofmann/syncpoint has been created at 98fc71803c7d0540613765f8a706fd93d3c3d11f (commit) http://git.fawkesrobotics.org/fawkes.git/thofmann/syncpoint - *Log* --------------------------------------------------------------- commit 98fc71803c7d0540613765f8a706fd93d3c3d11f Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Mon Feb 3 15:04:05 2014 +0100 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Mon Feb 3 15:45:23 2014 +0100 syncpoint: add SyncPoint library SyncPoints are used to synchronize threads dynamically to allow easy management of subsequent tasks. As an example, thread E generates data which is needed by thread W. Therefore, both threads share a SyncPoint. Thread W wait()s for the SyncPoint to be emitted. Once thread E is done, it emit()s the SyncPoint, which wakes up thread W. Currently, any thread which uses SyncPoints needs the SyncPointManager Aspect. Threads with this aspect have access to the syncpoint_manager. SyncPoints have to have absolute-path-style identifiers, e.g. '/some/syncpoint'. http://git.fawkesrobotics.org/fawkes.git/commit/98fc718 http://trac.fawkesrobotics.org/changeset/98fc718 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *Summary* ----------------------------------------------------------- - *Diffs* ------------------------------------------------------------- - *commit* 98fc71803c7d0540613765f8a706fd93d3c3d11f - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Mon Feb 3 15:04:05 2014 +0100 Subject: syncpoint: add SyncPoint library src/libs/Makefile | 3 +- src/libs/aspect/Makefile | 2 +- src/libs/aspect/inifins/syncpoint_manager.cpp | 70 +++++++++ .../inifins/syncpoint_manager.h} | 30 ++-- src/libs/aspect/manager.cpp | 7 +- src/libs/aspect/manager.h | 4 +- src/libs/aspect/syncpoint_manager.cpp | 62 ++++++++ .../syncpoint_manager.h} | 30 ++-- src/libs/baseapp/Makefile | 2 +- src/libs/baseapp/run.cpp | 7 +- .../rrd/aspect => libs/syncpoint}/Makefile | 28 ++-- src/libs/syncpoint/exceptions.h | 132 ++++++++++++++++ src/libs/syncpoint/syncpoint.cpp | 109 ++++++++++++++ src/libs/syncpoint/syncpoint.h | 66 ++++++++ src/libs/syncpoint/syncpoint_manager.cpp | 119 +++++++++++++++ .../fam_thread.h => syncpoint/syncpoint_manager.h} | 47 ++++--- .../{interfaces/qa => syncpoint/tests}/Makefile | 18 +- src/libs/syncpoint/tests/test_syncpoint.cpp | 157 ++++++++++++++++++++ 18 files changed, 818 insertions(+), 75 deletions(-) _Diff for modified files_: diff --git a/src/libs/Makefile b/src/libs/Makefile index a4ca6a6..c8bed9e 100644 --- a/src/libs/Makefile +++ b/src/libs/Makefile @@ -20,7 +20,7 @@ include $(BUILDSYSDIR)/fvconf.mk SUBDIRS = core utils interface netcomm blackboard interfaces config logging tf \ plugin lua aspect geometry webview worldinfo_utils gui_utils baseapp \ fvutils fvcams fvmodels fvfilters fvclassifiers fvstereo fvwidgets \ - eclipse_externals protobuf_comm protobuf_clips pcl_utils + protobuf_comm protobuf_clips pcl_utils syncpoint ifeq ($(HAVE_SIFT),1) SUBDIRS += extlib/sift @@ -66,6 +66,7 @@ fvclassifiers: $(CLASSIFIERS_DEPS) endif protobuf_clips: core protobuf_comm pcl_utils: core tf +syncpoint: core include $(BUILDSYSDIR)/rules.mk include $(LIBSRCDIR)/extlibs.mk diff --git a/src/libs/aspect/Makefile b/src/libs/aspect/Makefile index 3bf9541..da5c69d 100644 --- a/src/libs/aspect/Makefile +++ b/src/libs/aspect/Makefile @@ -20,7 +20,7 @@ include $(BUILDCONFDIR)/tf/tf.mk include $(BUILDSYSDIR)/pcl.mk LIBS_libfawkesaspects = fawkescore fawkesutils fawkesblackboard fawkesnetcomm \ - fawkesconfig fawkesplugin fawkeslogging + fawkesconfig fawkesplugin fawkeslogging fawkessyncpoint ifneq ($(HAVE_WEBVIEW),1) OBJS_FILTER_OUT += $(subst $(SRCDIR)/,,$(wildcard $(SRCDIR)/webview.cpp $(SRCDIR)/inifins/webview.cpp)) diff --git a/src/libs/aspect/manager.cpp b/src/libs/aspect/manager.cpp index 5278a31..25f2b1b 100644 --- a/src/libs/aspect/manager.cpp +++ b/src/libs/aspect/manager.cpp @@ -37,6 +37,7 @@ #include <aspect/inifins/time_source.h> #include <aspect/inifins/vision_master.h> #include <aspect/inifins/vision.h> +#include <aspect/inifins/syncpoint_manager.h> #ifdef HAVE_WEBVIEW # include <aspect/inifins/webview.h> #endif @@ -221,6 +222,7 @@ AspectManager::prepare_finalize(Thread *thread) * @param service_browser service browser for NetworkAspect * @param pmanager plugin manager for PluginDirectorAspect * @param tf_listener transformer for TransformAspect + * @param syncpoint_manager manager for SyncPointManagerAspect */ void AspectManager::register_default_inifins(BlackBoard *blackboard, @@ -236,7 +238,8 @@ AspectManager::register_default_inifins(BlackBoard *blackboard, ServicePublisher *service_publisher, ServiceBrowser *service_browser, PluginManager *pmanager, - tf::Transformer *tf_listener) + tf::Transformer *tf_listener, + SyncPointManager *syncpoint_manager) { if (! __default_inifins.empty()) return; @@ -258,6 +261,7 @@ AspectManager::register_default_inifins(BlackBoard *blackboard, TimeSourceAspectIniFin *ts_aif = new TimeSourceAspectIniFin(clock); VisionMasterAspectIniFin *vm_aif = new VisionMasterAspectIniFin(); VisionAspectIniFin *vis_aif = new VisionAspectIniFin(vm_aif); + SyncPointManagerAspectIniFin *spm_aif = new SyncPointManagerAspectIniFin(syncpoint_manager); #ifdef HAVE_WEBVIEW WebviewAspectIniFin *web_aif = new WebviewAspectIniFin(); #endif @@ -284,6 +288,7 @@ AspectManager::register_default_inifins(BlackBoard *blackboard, __default_inifins[ts_aif->get_aspect_name()] = ts_aif; __default_inifins[vm_aif->get_aspect_name()] = vm_aif; __default_inifins[vis_aif->get_aspect_name()] = vis_aif; + __default_inifins[spm_aif->get_aspect_name()] = spm_aif; #ifdef HAVE_WEBVIEW __default_inifins[web_aif->get_aspect_name()] = web_aif; #endif diff --git a/src/libs/aspect/manager.h b/src/libs/aspect/manager.h index 561c5ba..39a57c4 100644 --- a/src/libs/aspect/manager.h +++ b/src/libs/aspect/manager.h @@ -51,6 +51,7 @@ class LoggerEmployer; class BlockedTimingExecutor; class MainLoopEmployer; class AspectIniFin; +class SyncPointManager; namespace tf { class Transformer; @@ -83,7 +84,8 @@ class AspectManager : public ThreadInitializer, public ThreadFinalizer ServicePublisher *service_publisher, ServiceBrowser *service_browser, PluginManager *pmanager, - tf::Transformer *tf_listener); + tf::Transformer *tf_listener, + SyncPointManager *syncpoint_manager); private: std::map<std::string, AspectIniFin *> __inifins; diff --git a/src/libs/baseapp/Makefile b/src/libs/baseapp/Makefile index 7e25e2f..fcf9ae6 100644 --- a/src/libs/baseapp/Makefile +++ b/src/libs/baseapp/Makefile @@ -22,7 +22,7 @@ LDFLAGS += $(LDFLAGS_LIBDAEMON) $(LDFLAGS_TF) LIBS_libfawkesbaseapp = stdc++ fawkescore fawkesutils fawkesconfig \ fawkesblackboard fawkesplugin fawkesnetcomm \ - fawkesaspects fawkeslogging + fawkesaspects fawkeslogging fawkessyncpoint ifeq ($(HAVE_TF),1) LIBS_libfawkesbaseapp += fawkestf diff --git a/src/libs/baseapp/run.cpp b/src/libs/baseapp/run.cpp index b0d92a3..dd6f6de 100644 --- a/src/libs/baseapp/run.cpp +++ b/src/libs/baseapp/run.cpp @@ -44,6 +44,7 @@ #include <plugin/manager.h> #include <plugin/net/handler.h> #include <aspect/manager.h> +#include <syncpoint/syncpoint_manager.h> #ifdef HAVE_TF # include <tf/transform_listener.h> #endif @@ -82,6 +83,7 @@ Clock * clock = NULL; SharedMemoryRegistry * shm_registry; InitOptions * init_options = NULL; tf::Transformer * tf_listener = NULL; +SyncPointManager * syncpoint_manager = NULL; // this is NOT shared to the outside FawkesMainThread::Runner * runner = NULL; @@ -328,6 +330,8 @@ init(InitOptions options, int & retval) aspect_manager = new AspectManager(); thread_manager = new ThreadManager(aspect_manager, aspect_manager); + syncpoint_manager = new SyncPointManager(); + plugin_manager = new PluginManager(thread_manager, config, "/fawkes/meta_plugins/", options.plugin_module_flags(), @@ -367,7 +371,8 @@ init(InitOptions options, int & retval) network_manager->nnresolver(), network_manager->service_publisher(), network_manager->service_browser(), - plugin_manager, tf_listener); + plugin_manager, tf_listener, + syncpoint_manager); retval = 0; return true; -- Fawkes Robotics Framework http://www.fawkesrobotics.org _______________________________________________ fawkes-commits mailing list fawkes-commits@lists.kbsg.rwth-aachen.de https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits