[Fawkes Git] branch/timn/libbaseapp-modularization: created (0.5.0-3083-gfe5fa0b)

Tim Niemueller niemueller at kbsg.rwth-aachen.de
Tue May 24 11:37:05 CEST 2016


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, timn/libbaseapp-modularization has been created
        at  fe5fa0b7b9b17ef3b29db9ae1c69f6d813f2ecad (commit)

http://git.fawkesrobotics.org/fawkes.git/timn/libbaseapp-modularization

- *Log* ---------------------------------------------------------------
commit 3807c36db502f099f7598e8b73ff52c388be9d75
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue May 24 11:32:59 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue May 24 11:32:59 2016 +0200

    aspect: support uninitialized blackboard aspect
    
    If no blackboard is set, simply error out.

http://git.fawkesrobotics.org/fawkes.git/commit/3807c36
http://trac.fawkesrobotics.org/changeset/3807c36

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit fe5fa0b7b9b17ef3b29db9ae1c69f6d813f2ecad
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue May 24 11:34:10 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue May 24 11:34:10 2016 +0200

    baseapp: make parts optional
    
    This modularization allows to use the library with fewer features if
    need be.

http://git.fawkesrobotics.org/fawkes.git/commit/fe5fa0b
http://trac.fawkesrobotics.org/changeset/fe5fa0b

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


- *Summary* -----------------------------------------------------------
 src/libs/baseapp/Makefile |   46 +++++++++++++++++++++++++++++++++++++++++---
 src/libs/baseapp/run.cpp  |   11 +++++++++-
 2 files changed, 52 insertions(+), 5 deletions(-)


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

- *commit* 3807c36db502f099f7598e8b73ff52c388be9d75 - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue May 24 11:32:59 2016 +0200
Subject: aspect: support uninitialized blackboard aspect

 src/libs/aspect/inifins/blackboard.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/aspect/inifins/blackboard.cpp b/src/libs/aspect/inifins/blackboard.cpp
index 460c6b0..a344861 100644
--- a/src/libs/aspect/inifins/blackboard.cpp
+++ b/src/libs/aspect/inifins/blackboard.cpp
@@ -56,6 +56,11 @@ BlackBoardAspectIniFin::init(Thread *thread)
 					  "has not. ", thread->name());
   }
 
+  if (! __blackboard) {
+	  throw CannotInitializeThreadException("Thread '%s' needs BlackBoardAspect, "
+	                                        "but not blackboard available");
+  }
+
   BlackBoard *bb;
   if (blackboard_thread->blackboard_owner_name_) {
     bb = new BlackBoardWithOwnership(__blackboard,

- *commit* fe5fa0b7b9b17ef3b29db9ae1c69f6d813f2ecad - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue May 24 11:34:10 2016 +0200
Subject: baseapp: make parts optional

 src/libs/baseapp/Makefile |   46 +++++++++++++++++++++++++++++++++++++++++---
 src/libs/baseapp/run.cpp  |   11 +++++++++-
 2 files changed, 52 insertions(+), 5 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/baseapp/Makefile b/src/libs/baseapp/Makefile
index 3eeadf2..f69de19 100644
--- a/src/libs/baseapp/Makefile
+++ b/src/libs/baseapp/Makefile
@@ -15,15 +15,19 @@
 
 BASEDIR = ../../..
 include $(BASEDIR)/etc/buildsys/config.mk
-include $(BUILDCONFDIR)/tf/tf.mk
-include $(BUILDCONFDIR)/logging/logging.mk
+ifneq ($(wildcard $(BUILDCONFDIR)/tf/tf.mk),)
+  include $(BUILDCONFDIR)/tf/tf.mk
+endif
+ifneq ($(wildcard $(BUILDCONFDIR)/logging/logging.mk),)
+  include $(BUILDCONFDIR)/logging/logging.mk
+endif
 include $(BUILDSYSDIR)/boost.mk
 
 CFLAGS  += $(CFLAGS_LIBDAEMON) $(CFLAGS_TF)
 LDFLAGS += $(LDFLAGS_LIBDAEMON) $(LDFLAGS_TF)
 
 LIBS_libfawkesbaseapp = stdc++ pthread fawkescore fawkesutils fawkesconfig \
-			fawkesblackboard fawkesplugin fawkesnetcomm \
+			fawkesplugin \
 			fawkesaspects fawkeslogging
 
 REQ_BOOST_LIBS = system
@@ -35,6 +39,32 @@ else
   WARN_TARGETS += warning_tf
 endif
 
+ifneq ($(wildcard $(SRCDIR)/../blackboard/blackboard.h),)
+  CFLAGS += -DHAVE_BLACKBOARD
+  LIBS_libfawkesbaseapp += fawkesblackboard
+else
+  WARN_TARGETS += warning_blackboard
+endif
+
+ifneq ($(wildcard $(SRCDIR)/../netcomm/fawkes/network_manager.h),)
+  CFLAGS += -DHAVE_NETWORK_MANAGER
+  LIBS_libfawkesbaseapp += fawkesnetcomm
+else
+  WARN_TARGETS += warning_netcomm
+endif
+
+ifneq ($(wildcard $(SRCDIR)/../config/net_handler.h),)
+  CFLAGS += -DHAVE_CONFIG_NETWORK_HANDLER
+else
+  WARN_TARGETS += warning_config_net_handler
+endif
+
+ifneq ($(wildcard $(SRCDIR)/../plugin/net/handler.h),)
+  CFLAGS += -DHAVE_PLUGIN_NETWORK_HANDLER
+else
+  WARN_TARGETS += warning_plugin_net_handler
+endif
+
 ifeq ($(HAVE_CPP11)$(HAVE_BOOST_LIBS),11)
   CFLAGS  += -DHAVE_BOOST -DHAVE_CPP11 $(CFLAGS_CPP11) $(call boost-libs-cflags,$(REQ_BOOST_LIBS))
   LDFLAGS += $(call boost-libs-ldflags,$(REQ_BOOST_LIBS))
@@ -55,13 +85,21 @@ ifeq ($(OBJSSUBMAKE),1)
   ifneq ($(WARN_TARGETS),)
 all: $(WARN_TARGETS)
   endif
-.PHONY: warning_libdaemon warning_tf
+.PHONY: warning_libdaemon warning_tf warning_blackboard warning_netcomm warning_config_net_handler warning_plugin_net_handler
 warning_libdaemon:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)Building without daemonizing support$(TNORMAL) (libdaemon[-devel] not installed)"
 warning_tf:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)Building without TF support$(TNORMAL) (tf framework not available)"
 warning_fd_redirect:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)Building stdout/stderr redirect logger support$(TNORMAL) (feature not available in logging lib)"
+warning_blackboard:
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)Building without blackboard support$(TNORMAL) (blackboard not available)"
+warning_netcomm:
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)Building without Fawkes network support$(TNORMAL) (netcomm library not available)"
+warning_config_net_handler:
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)Building without config network support$(TNORMAL) (config network handler not available)"
+warning_plugin_net_handler:
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)Building without plugin network support$(TNORMAL) (plugin network handler not available)"
 endif
 
 include $(BUILDSYSDIR)/base.mk
diff --git a/src/libs/baseapp/run.cpp b/src/libs/baseapp/run.cpp
index 1a60d72..20284e0 100644
--- a/src/libs/baseapp/run.cpp
+++ b/src/libs/baseapp/run.cpp
@@ -313,6 +313,7 @@ init(InitOptions options, int & retval)
     net_tcp_port = 1910;
   }
 
+#ifdef HAVE_BLACKBOARD
   // *** Setup blackboard
   std::string bb_magic_token = "";
   unsigned int bb_size = 2097152;
@@ -345,6 +346,7 @@ init(InitOptions options, int & retval)
     lbb = new LocalBlackBoard(bb_size, bb_magic_token.c_str());
   }
   blackboard = lbb;
+#endif
 
 #ifdef HAVE_TF
   tf_transformer     = new tf::Transformer();
@@ -358,15 +360,20 @@ init(InitOptions options, int & retval)
 					 "/fawkes/meta_plugins/",
 					 options.plugin_module_flags(),
 					 options.init_plugin_cache());
+#ifdef HAVE_NETWORK_MANAGER
   network_manager    = new FawkesNetworkManager(thread_manager,
 						net_tcp_port,
 						net_service_name.c_str());
+#  ifdef HAVE_CONFIG_NETWORK_HANDLER
   nethandler_config  = new ConfigNetworkHandler(config,
 						network_manager->hub());
-
+#  endif
+#  ifdef HAVE_PLUGIN_NETWORK_HANDLER
   nethandler_plugin  = new PluginNetworkHandler(plugin_manager,
 						network_manager->hub());
   nethandler_plugin->start();
+#  endif
+#endif
 
   network_logger = new NetworkLogger(network_manager->hub(),
 				     logger->loglevel());
@@ -375,7 +382,9 @@ init(InitOptions options, int & retval)
   clock = Clock::instance();
   start_time = new Time(clock);
 
+#if defined(HAVE_NETWORK_MANAGER) && defined(HAVE_BLACKBOARD)
   lbb->start_nethandler(network_manager->hub());
+#endif
 
 
   // *** Create main thread, but do not start, yet




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list