[Fawkes Git] branch/timn/navgraph-rospub: created (0.5.0-3083-g5971132)

Tim Niemueller niemueller at kbsg.rwth-aachen.de
Thu Jun 9 14:39:00 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/navgraph-rospub has been created
        at  597113280001a367f8c37ed2bbeaf6a31bade944 (commit)

http://git.fawkesrobotics.org/fawkes.git/timn/navgraph-rospub

- *Log* ---------------------------------------------------------------
commit 0077f5559dd4586de654b551a1678f4b2c725f48
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Wed Jun 8 22:37:11 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Wed Jun 8 22:37:11 2016 +0200

    navgraph: add support for publishing navgraph data via ROS
    
    In addition to the visualization messages this publishes the navgraph as
    usable data structures. Requires the latest version of fawkes_msgs.

http://git.fawkesrobotics.org/fawkes.git/commit/0077f55
http://trac.fawkesrobotics.org/changeset/0077f55

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 597113280001a367f8c37ed2bbeaf6a31bade944
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Wed Jun 8 22:43:35 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Wed Jun 8 22:43:35 2016 +0200

    navgraph: enable navgraph ROS publishing by default if available

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

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


- *Summary* -----------------------------------------------------------
 cfg/conf.d/navgraph.yaml |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


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

- *commit* 0077f5559dd4586de654b551a1678f4b2c725f48 - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Wed Jun 8 22:37:11 2016 +0200
Subject: navgraph: add support for publishing navgraph data via ROS

 src/plugins/navgraph/Makefile                      |   36 ++++--
 src/plugins/navgraph/navgraph_plugin.cpp           |   12 ++
 src/plugins/navgraph/rospub_thread.cpp             |  129 ++++++++++++++++++++
 .../rospub_thread.h}                               |   41 ++++---
 4 files changed, 192 insertions(+), 26 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/navgraph/Makefile b/src/plugins/navgraph/Makefile
index 9fc68f1..e6fab06 100644
--- a/src/plugins/navgraph/Makefile
+++ b/src/plugins/navgraph/Makefile
@@ -40,27 +40,39 @@ ifeq ($(HAVE_CPP11)$(HAVE_TF)$(HAVE_NAVGRAPH),111)
 
   SUBDIRS = static-constraints
 
-  ifeq ($(ENABLE_VISUALIZATION),1)
-    ifeq ($(HAVE_ROS),1)
+  ifeq ($(HAVE_ROS),1)
+
+    LIBS_navgraph += fawkesrosaspect
+    CFLAGS += $(CFLAGS_ROS)
+
+    ifeq ($(ENABLE_VISUALIZATION),1)
       ifeq ($(call ros-have-pkg,visualization_msgs),1)
-        CFLAGS  += -DHAVE_VISUALIZATION $(CFLAGS_ROS)
-	CFLAGS_visualization_thread = $(CFLAGS) $(CFLAGS_TF) \
-				      $(call ros-pkg-cflags,visualization_msgs)
+        CFLAGS  += -DHAVE_VISUALIZATION
+        CFLAGS_visualization_thread = $(CFLAGS) $(CFLAGS_TF) \
+				                              $(call ros-pkg-cflags,visualization_msgs)
         LDFLAGS += $(LDFLAGS_ROS) $(call ros-pkg-lflags,visualization_msgs)
 
-        LIBS_navgraph += fawkesrosaspect
-
         OBJS_navgraph += visualization_thread.o
+      else
+        ENABLE_VISUALIZATION = 0
+        WARN_TARGETS += warning_visualization_msgs
+      endif
+    endif
+
+    ifeq ($(call ros-have-pkg,fawkes_msgs),1)
+      CFLAGS  += -DHAVE_FAWKES_MSGS
+      CFLAGS_rospub_thread = $(CFLAGS)  \
+			                       $(call ros-pkg-cflags,fawkes_msgs)
+      LDFLAGS += $(LDFLAGS_ROS) $(call ros-pkg-lflags,fawkes_msgs)
+
+      OBJS_navgraph += rospub_thread.o
     else
-      ENABLE_VISUALIZATION = 0
-      WARN_TARGETS += warning_visualization_msgs
+      WARN_TARGETS += warning_fawkes_msgs
     endif
   else
     ENABLE_VISUALIZATION = 0
     WARN_TARGETS += warning_ros
   endif
-endif
-
 else
   ifneq ($(HAVE_CPP11),1)
     WARN_TARGETS = warning_cpp11
@@ -87,6 +99,8 @@ warning_ros:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Disabling visual debugging$(TNORMAL) (ROS not available)"
 warning_visualization_msgs:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Disabling visual debugging$(TNORMAL) (ROS package visualization_msgs not available)"
+warning_fawkes_msgs:
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Disabling non-visual ROS navgraph publishing$(TNORMAL) (ROS package fawkes_msgs not available)"
 endif
 
 include $(BUILDSYSDIR)/base.mk
diff --git a/src/plugins/navgraph/navgraph_plugin.cpp b/src/plugins/navgraph/navgraph_plugin.cpp
index 59262eb..5ca64ea 100644
--- a/src/plugins/navgraph/navgraph_plugin.cpp
+++ b/src/plugins/navgraph/navgraph_plugin.cpp
@@ -26,6 +26,9 @@
 #ifdef HAVE_VISUALIZATION
 #  include "visualization_thread.h"
 #endif
+#ifdef HAVE_FAWKES_MSGS
+#  include "rospub_thread.h"
+#endif
 
 using namespace fawkes;
 
@@ -56,6 +59,15 @@ class NavGraphPlugin : public fawkes::Plugin
 #else
     thread_list.push_back(new NavGraphThread());
 #endif
+#ifdef HAVE_FAWKES_MSGS
+    bool use_rospub = false;
+    try {
+	    use_rospub = config->get_bool("/navgraph/ros-publishing/enable");
+    } catch (Exception &e) {} // ignored, use default
+    if (use_rospub) {
+	    thread_list.push_back(new NavGraphROSPubThread());
+    }
+#endif
   }
 };
 

- *commit* 597113280001a367f8c37ed2bbeaf6a31bade944 - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Wed Jun 8 22:43:35 2016 +0200
Subject: navgraph: enable navgraph ROS publishing by default if available

 cfg/conf.d/navgraph.yaml |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/cfg/conf.d/navgraph.yaml b/cfg/conf.d/navgraph.yaml
index ad3d947..87c2af4 100644
--- a/cfg/conf.d/navgraph.yaml
+++ b/cfg/conf.d/navgraph.yaml
@@ -116,3 +116,7 @@ navgraph:
   interactive:
     out-file: navgraph-interactive-saved.yaml
 
+  # Publishing of usable data structures to ROS
+  ros-publishing:
+    enable: true
+




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


More information about the fawkes-commits mailing list