[Fawkes Git] branch/timn/ros-webview-fawkes_msgs: created (0.5.0-3082-gbf9d5b3)

Tim Niemueller niemueller at kbsg.rwth-aachen.de
Mon Sep 5 14:56: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/ros-webview-fawkes_msgs has been created
        at  bf9d5b332ac92881dfec35e22e849667638aea8a (commit)

http://git.fawkesrobotics.org/fawkes.git/timn/ros-webview-fawkes_msgs

- *Log* ---------------------------------------------------------------
commit bf9d5b332ac92881dfec35e22e849667638aea8a
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Fri May 27 15:00:53 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Fri May 27 15:00:53 2016 +0200

    ros-webview: adapt to webview-related messages in fawkes_msgs
    
    The webview_msgs package has been subsumed by the fawkes_msgs package.

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

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


- *Summary* -----------------------------------------------------------


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

- *commit* bf9d5b332ac92881dfec35e22e849667638aea8a - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Fri May 27 15:00:53 2016 +0200
Subject: ros-webview: adapt to webview-related messages in fawkes_msgs

 src/plugins/ros/Makefile            |   13 +++++------
 src/plugins/ros/webview_reqproc.cpp |   12 +++++-----
 src/plugins/ros/webview_thread.cpp  |   36 +++++++++++++++-------------------
 src/plugins/ros/webview_thread.h    |   20 +++++++++---------
 4 files changed, 38 insertions(+), 43 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/ros/Makefile b/src/plugins/ros/Makefile
index cd4c6ca..f09817b 100644
--- a/src/plugins/ros/Makefile
+++ b/src/plugins/ros/Makefile
@@ -106,14 +106,14 @@ ifeq ($(HAVE_ROS),1)
   PLUGINS_all = $(PLUGINDIR)/ros.so \
 		$(PLUGINDIR)/ros-talkerpub.so
 
-  ifeq ($(call ros-have-pkg,webview_msgs),1)
-    CFLAGS_webview_thread += $(call ros-pkg-cflags,webview_msgs) $(CFLAGS)
+  ifeq ($(call ros-have-pkg,fawkes_msgs),1)
+    CFLAGS_webview_thread += $(call ros-pkg-cflags,fawkes_msgs) $(CFLAGS)
     CFLAGS_webview_plugin = $(CFLAGS_webview_thread)
     CFLAGS_webview_reqproc = $(CFLAGS_webview_thread)
-    LDFLAGS_ros_webview += $(LDFLAGS) $(call ros-pkg-lflags,webview_msgs)
+    LDFLAGS_ros_webview += $(LDFLAGS) $(call ros-pkg-lflags,fawkes_msgs)
     PLUGINS_all += $(PLUGINDIR)/ros-webview.so
   else
-    WARN_TARGETS += warning_webview_msgs
+    WARN_TARGETS += warning_fawkes_msgs
   endif
 
   ifeq ($(call ros-have-pkg,tf),1)
@@ -284,11 +284,9 @@ endif
 ifeq ($(OBJSSUBMAKE),1)
 all: $(WARN_TARGETS)
 
-.PHONY: warning_ros warning_webview_msgs warning_fawkestf warning_rostf warning_pcl warning_rospcl warning_tf2_msgs
+.PHONY: warning_ros warning_fawkestf warning_rostf warning_pcl warning_rospcl warning_tf2_msgs
 warning_ros:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting ROS Plugins$(TNORMAL) (ROS not found)"
-warning_webview_msgs:
-	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting ROS Webview Plugin$(TNORMAL) (ROS package webview_msgs not found)"
 warning_fawkestf:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting ROS tf plugin$(TNORMAL) (fawkestf not available)"
 warning_rostf:
@@ -322,6 +320,7 @@ warning_rosgraph_msgs:
 warning_fawkes_msgs:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting ROS skiller plugin$(TNORMAL) (ROS package fawkes_msgs not found)"
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting ROS Position 3D Plugin$(TNORMAL) (ROS package fawkes_msgs not found)"
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting ROS Webview Plugin$(TNORMAL) (ROS package fawkes_msgs not found)"
 warning_tinyxml:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting ROS images plugin$(TNORMAL) (tinyxml[-devel] not installed)"
 endif
diff --git a/src/plugins/ros/webview_reqproc.cpp b/src/plugins/ros/webview_reqproc.cpp
index 099ef7e..4034e39 100644
--- a/src/plugins/ros/webview_reqproc.cpp
+++ b/src/plugins/ros/webview_reqproc.cpp
@@ -24,7 +24,7 @@
 #include <core/exception.h>
 #include <logging/logger.h>
 #include <webview/error_reply.h>
-#include <webview_msgs/ProcessRequest.h>
+#include <fawkes_msgs/WebviewProcessRequest.h>
 
 using namespace fawkes;
 
@@ -45,15 +45,15 @@ using namespace fawkes;
  * @param srv_name the ROS service name to query for requests
  */
 ROSWebviewRequestProcessor::ROSWebviewRequestProcessor(LockPtr<ros::NodeHandle> nh,
-						       Logger *logger,
-						       std::string &baseurl,
-						       std::string &srv_name)
+                                                       Logger *logger,
+                                                       std::string &baseurl,
+                                                       std::string &srv_name)
 {
   __baseurl  = baseurl;
   __srv_name = srv_name;
   __logcomp  = std::string("ROSWebviewRP[") + srv_name + "]";
 
-  __srv_client = nh->serviceClient<webview_msgs::ProcessRequest>(srv_name);
+  __srv_client = nh->serviceClient<fawkes_msgs::WebviewProcessRequest>(srv_name);
 }
 
 /** Destructor. */
@@ -67,7 +67,7 @@ ROSWebviewRequestProcessor::process_request(const fawkes::WebRequest *request)
 {
   //logger->log_debug(__logcomp.c_str(), "Processing %s", url);
 
-  webview_msgs::ProcessRequest srv;
+  fawkes_msgs::WebviewProcessRequest srv;
   srv.request.url = request->url();
   //srv.request.method = method;
   //srv.request.version = version;
diff --git a/src/plugins/ros/webview_thread.cpp b/src/plugins/ros/webview_thread.cpp
index f178cb1..a8d5c0f 100644
--- a/src/plugins/ros/webview_thread.cpp
+++ b/src/plugins/ros/webview_thread.cpp
@@ -52,23 +52,19 @@ ROSWebviewThread::~ROSWebviewThread()
 void
 ROSWebviewThread::init()
 {
-  __srv_register   =
-    rosnode->advertiseService("/webview/register",
-			      &ROSWebviewThread::srv_register_cb,
-			      this);
+	__srv_register   =
+		rosnode->advertiseService("/webview/register",
+		                          &ROSWebviewThread::srv_register_cb, this);
   __srv_unregister =
-    rosnode->advertiseService("/webview/unregister",
-			      &ROSWebviewThread::srv_unregister_cb,
-			      this);
+	  rosnode->advertiseService("/webview/unregister",
+	                            &ROSWebviewThread::srv_unregister_cb, this);
 
   __srv_add_nav   =
-    rosnode->advertiseService("/webview/add_nav_entry",
-			      &ROSWebviewThread::srv_add_nav_cb,
-			      this);
+	  rosnode->advertiseService("/webview/add_nav_entry",
+	                            &ROSWebviewThread::srv_add_nav_cb, this);
   __srv_remove_nav =
     rosnode->advertiseService("/webview/remove_nav_entry",
-			      &ROSWebviewThread::srv_remove_nav_cb,
-			      this);
+                              &ROSWebviewThread::srv_remove_nav_cb, this);
 }
 
 
@@ -103,8 +99,8 @@ ROSWebviewThread::loop()
 
 
 bool
-ROSWebviewThread::srv_register_cb(webview_msgs::UrlRegistration::Request  &req,
-				  webview_msgs::UrlRegistration::Response &resp)
+ROSWebviewThread::srv_register_cb(fawkes_msgs::WebviewUrlRegistration::Request  &req,
+                                  fawkes_msgs::WebviewUrlRegistration::Response &resp)
 {
   if (__procs.find(req.url_prefix) != __procs.end()) {
     resp.success = false;
@@ -133,8 +129,8 @@ ROSWebviewThread::srv_register_cb(webview_msgs::UrlRegistration::Request  &req,
 }
 
 bool
-ROSWebviewThread::srv_unregister_cb(webview_msgs::UrlRegistration::Request  &req,
-				    webview_msgs::UrlRegistration::Response &resp)
+ROSWebviewThread::srv_unregister_cb(fawkes_msgs::WebviewUrlRegistration::Request  &req,
+                                    fawkes_msgs::WebviewUrlRegistration::Response &resp)
 {
   logger->log_debug(name(), "%s unregisters for %s", req.service_name.c_str(),
 		    req.url_prefix.c_str());
@@ -158,8 +154,8 @@ ROSWebviewThread::srv_unregister_cb(webview_msgs::UrlRegistration::Request  &req
 }
 
 bool
-ROSWebviewThread::srv_add_nav_cb(webview_msgs::NavRegistration::Request  &req,
-				 webview_msgs::NavRegistration::Response &resp)
+ROSWebviewThread::srv_add_nav_cb(fawkes_msgs::WebviewNavRegistration::Request  &req,
+                                 fawkes_msgs::WebviewNavRegistration::Response &resp)
 {
   try {
     webview_nav_manager->add_nav_entry(req.url, req.name);
@@ -174,8 +170,8 @@ ROSWebviewThread::srv_add_nav_cb(webview_msgs::NavRegistration::Request  &req,
 }
 
 bool
-ROSWebviewThread::srv_remove_nav_cb(webview_msgs::NavRegistration::Request  &req,
-				    webview_msgs::NavRegistration::Response &resp)
+ROSWebviewThread::srv_remove_nav_cb(fawkes_msgs::WebviewNavRegistration::Request  &req,
+                                    fawkes_msgs::WebviewNavRegistration::Response &resp)
 {
   webview_nav_manager->remove_nav_entry(req.url);
   __nav_entries.erase(req.url);
diff --git a/src/plugins/ros/webview_thread.h b/src/plugins/ros/webview_thread.h
index c1b0b1b..968e9c7 100644
--- a/src/plugins/ros/webview_thread.h
+++ b/src/plugins/ros/webview_thread.h
@@ -32,8 +32,8 @@
 #include <plugins/ros/aspect/ros.h>
 
 #include <ros/service_server.h>
-#include <webview_msgs/UrlRegistration.h>
-#include <webview_msgs/NavRegistration.h>
+#include <fawkes_msgs/WebviewUrlRegistration.h>
+#include <fawkes_msgs/WebviewNavRegistration.h>
 
 #include <map>
 #include <string>
@@ -57,17 +57,17 @@ class ROSWebviewThread
   virtual void finalize();
 
  private:
-  bool srv_register_cb(webview_msgs::UrlRegistration::Request  &req,
-		       webview_msgs::UrlRegistration::Response &resp);
+  bool srv_register_cb(fawkes_msgs::WebviewUrlRegistration::Request  &req,
+                       fawkes_msgs::WebviewUrlRegistration::Response &resp);
 
-  bool srv_unregister_cb(webview_msgs::UrlRegistration::Request  &req,
-			 webview_msgs::UrlRegistration::Response &resp);
+  bool srv_unregister_cb(fawkes_msgs::WebviewUrlRegistration::Request  &req,
+                         fawkes_msgs::WebviewUrlRegistration::Response &resp);
 
-  bool srv_add_nav_cb(webview_msgs::NavRegistration::Request  &req,
-		      webview_msgs::NavRegistration::Response &resp);
+  bool srv_add_nav_cb(fawkes_msgs::WebviewNavRegistration::Request  &req,
+                      fawkes_msgs::WebviewNavRegistration::Response &resp);
 
-  bool srv_remove_nav_cb(webview_msgs::NavRegistration::Request  &req,
-			 webview_msgs::NavRegistration::Response &resp);
+  bool srv_remove_nav_cb(fawkes_msgs::WebviewNavRegistration::Request  &req,
+                         fawkes_msgs::WebviewNavRegistration::Response &resp);
 
  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
  protected: virtual void run() { Thread::run(); }




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


More information about the fawkes-commits mailing list