{"id":2648,"date":"2021-01-08T12:51:32","date_gmt":"2021-01-08T03:51:32","guid":{"rendered":"https:\/\/www.kdel.org\/wp\/?p=2648"},"modified":"2022-05-20T16:16:17","modified_gmt":"2022-05-20T07:16:17","slug":"2648","status":"publish","type":"post","link":"https:\/\/www.kdel.org\/wp\/?p=2648","title":{"rendered":"fawkes-robotino-2016\u306egazebo9\u4ee5\u964d\u3078\u306e\u5bfe\u5fdc"},"content":{"rendered":"<p><a href=\"https:\/\/www.kdel.org\/wp\/?p=1524\">Ubuntu 18.04\u3078\u306efawkes-robotino \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u8a66\u884c\u932f\u8aa4\u7248\uff09<\/a>\u306b\u3066\uff0c<\/p>\n<blockquote><p>gazebo \u95a2\u4fc2\u306fgazebo5\u304b\u3089gazebo9\u307e\u3067\u4e0a\u304c\u3063\u3066\u3044\u3066\uff0cgazebo::physics:World \u306eGetName \u306a\u3069\u306a\u3069\u304c\u306a\u304f\u306a\u3063\u3066\u3044\u308b\u305f\u3081\uff0c\u5bfe\u5fdc\u304c\u9762\u5012\u306a\u306e\u3067\u3044\u3063\u305f\u3093\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30ea\u30b9\u30c8\u304b\u3089\u524a\u9664\u3057\u307e\u3057\u305f\uff0e<\/p><\/blockquote>\n<p>\u3068\u3042\u308a\u307e\u3057\u305f\u304c\uff0c\u305d\u306e\u90e8\u5206\u306e\u7b54\u3048\u5408\u308f\u305b\u3067\u3059(2016\u30682019\u306ediff)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/aspect\/gazebo.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/aspect\/gazebo.cpp\r\n68c64,65\r\n&lt; GazeboAspect::init_GazeboAspect(gazebo::transport::NodePtr gazebonode , gazebo::transport::NodePtr gazebo_world_node)\r\n---\r\n&gt; GazeboAspect::init_GazeboAspect(gazebo::transport::NodePtr gazebonode,\r\n&gt;                                 gazebo::transport::NodePtr gazebo_world_node)\r\n70,71c67,68\r\n&lt;   this-&gt;gazebonode = gazebonode;\r\n&lt;   this-&gt;gazebo_world_node = gazebo_world_node;\r\n---\r\n&gt; \tthis-&gt;gazebonode        = gazebonode;\r\n&gt; \tthis-&gt;gazebo_world_node = gazebo_world_node;\r\n80c77\r\n&lt;   gazebonode.reset();\r\n---\r\n&gt; \tgazebonode.reset();\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/aspect\/gazebo.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/aspect\/gazebo.h\r\n24,25c24,25\r\n&lt; #ifndef __PLUGINS_GAZEBO_ASPECT_GAZEBO_H_\r\n&lt; #define __PLUGINS_GAZEBO_ASPECT_GAZEBO_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZEBO_ASPECT_GAZEBO_H_\r\n&gt; #define _PLUGINS_GAZEBO_ASPECT_GAZEBO_H_\r\n33,35c33,34\r\n&lt; #if 0 \/* just to make Emacs auto-indent happy *\/\r\n&lt; }\r\n&lt; #endif\r\n---\r\n&gt; \r\n&gt; class GazeboAspectIniFin;\r\n39c38\r\n&lt;   friend class GazeboAspectIniFin;\r\n---\r\n&gt; \tfriend GazeboAspectIniFin;\r\n41,48c40,47\r\n&lt;  public:\r\n&lt;   GazeboAspect();\r\n&lt;   virtual ~GazeboAspect();\r\n&lt; \r\n&lt;  protected:\r\n&lt;   \/\/\/ Gazebo Node for communication with a robot\r\n&lt;   gazebo::transport::NodePtr gazebonode;\r\n&lt;   \/**\r\n---\r\n&gt; public:\r\n&gt; \tGazeboAspect();\r\n&gt; \tvirtual ~GazeboAspect();\r\n&gt; \r\n&gt; protected:\r\n&gt; \t\/\/\/ Gazebo Node for communication with a robot\r\n&gt; \tgazebo::transport::NodePtr gazebonode;\r\n&gt; \t\/**\r\n52c51\r\n&lt;   gazebo::transport::NodePtr gazebo_world_node;\r\n---\r\n&gt; \tgazebo::transport::NodePtr gazebo_world_node;\r\n54,56c53,56\r\n&lt;  private:\r\n&lt;   void init_GazeboAspect(gazebo::transport::NodePtr gazebonode, gazebo::transport::NodePtr gazebo_world_node);\r\n&lt;   void finalize_GazeboAspect();\r\n---\r\n&gt; private:\r\n&gt; \tvoid init_GazeboAspect(gazebo::transport::NodePtr gazebonode,\r\n&gt; \t                       gazebo::transport::NodePtr gazebo_world_node);\r\n&gt; \tvoid finalize_GazeboAspect();\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/aspect\/gazebo_inifin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/aspect\/gazebo_inifin.cpp\r\n24d23\r\n&lt; #include &lt;plugins\/gazebo\/aspect\/gazebo_inifin.h&gt;\r\n25a25,26\r\n&gt; #include &lt;plugins\/gazebo\/aspect\/gazebo_inifin.h&gt;\r\n&gt; \r\n29,31d29\r\n&lt; #if 0 \/* just to make Emacs auto-indent happy *\/\r\n&lt; }\r\n&lt; #endif\r\n41,42c39\r\n&lt; GazeboAspectIniFin::GazeboAspectIniFin()\r\n&lt;   : AspectIniFin(&quot;GazeboAspect&quot;)\r\n---\r\n&gt; GazeboAspectIniFin::GazeboAspectIniFin() : AspectIniFin(&quot;GazeboAspect&quot;)\r\n52,61c49,59\r\n&lt;   GazeboAspect *gazebo_thread;\r\n&lt;   gazebo_thread = dynamic_cast&lt;GazeboAspect *&gt;(thread);\r\n&lt;   if (gazebo_thread == NULL) {\r\n&lt;     throw CannotInitializeThreadException(&quot;Thread '%s' claims to have the &quot;\r\n&lt; \t\t\t\t\t  &quot;GazeboAspect, but RTTI says it &quot;\r\n&lt; \t\t\t\t\t  &quot;has not. &quot;, thread-&gt;name());\r\n&lt;   }\r\n&lt;   if (! __gazebonode) {\r\n&lt;     throw CannotInitializeThreadException(&quot;Gazebo node handle has not been set.&quot;);\r\n&lt;   }\r\n---\r\n&gt; \tGazeboAspect *gazebo_thread;\r\n&gt; \tgazebo_thread = dynamic_cast&lt;GazeboAspect *&gt;(thread);\r\n&gt; \tif (gazebo_thread == NULL) {\r\n&gt; \t\tthrow CannotInitializeThreadException(&quot;Thread '%s' claims to have the &quot;\r\n&gt; \t\t                                      &quot;GazeboAspect, but RTTI says it &quot;\r\n&gt; \t\t                                      &quot;has not. &quot;,\r\n&gt; \t\t                                      thread-&gt;name());\r\n&gt; \t}\r\n&gt; \tif (!gazebonode_) {\r\n&gt; \t\tthrow CannotInitializeThreadException(&quot;Gazebo node handle has not been set.&quot;);\r\n&gt; \t}\r\n63c61\r\n&lt;   gazebo_thread-&gt;init_GazeboAspect(__gazebonode, __gazebo_world_node);\r\n---\r\n&gt; \tgazebo_thread-&gt;init_GazeboAspect(gazebonode_, gazebo_world_node_);\r\n72,79c70,78\r\n&lt;   GazeboAspect *gazebo_thread;\r\n&lt;   gazebo_thread = dynamic_cast&lt;GazeboAspect *&gt;(thread);\r\n&lt;   if (gazebo_thread == NULL) {\r\n&lt;     throw CannotFinalizeThreadException(&quot;Thread '%s' claims to have the &quot;\r\n&lt; \t\t\t\t\t&quot;GazeboAspect, but RTTI says it &quot;\r\n&lt; \t\t\t\t\t&quot;has not. &quot;, thread-&gt;name());\r\n&lt;   }\r\n&lt;   gazebo_thread-&gt;finalize_GazeboAspect();\r\n---\r\n&gt; \tGazeboAspect *gazebo_thread;\r\n&gt; \tgazebo_thread = dynamic_cast&lt;GazeboAspect *&gt;(thread);\r\n&gt; \tif (gazebo_thread == NULL) {\r\n&gt; \t\tthrow CannotFinalizeThreadException(&quot;Thread '%s' claims to have the &quot;\r\n&gt; \t\t                                    &quot;GazeboAspect, but RTTI says it &quot;\r\n&gt; \t\t                                    &quot;has not. &quot;,\r\n&gt; \t\t                                    thread-&gt;name());\r\n&gt; \t}\r\n&gt; \tgazebo_thread-&gt;finalize_GazeboAspect();\r\n82d80\r\n&lt; \r\n90c88\r\n&lt;   __gazebonode = gazebonode;\r\n---\r\n&gt; \tgazebonode_ = gazebonode;\r\n99c97\r\n&lt;   __gazebo_world_node = gazebo_world_node;\r\n---\r\n&gt; \tgazebo_world_node_ = gazebo_world_node;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/aspect\/gazebo_inifin.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/aspect\/gazebo_inifin.h\r\n24,25c24,25\r\n&lt; #ifndef __PLUGINS_GAZEBO_ASPECT_GAZEBO_INIFIN_H_\r\n&lt; #define __PLUGINS_GAZEBO_ASPECT_GAZEBO_INIFIN_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZEBO_ASPECT_GAZEBO_INIFIN_H_\r\n&gt; #define _PLUGINS_GAZEBO_ASPECT_GAZEBO_INIFIN_H_\r\n34,36d33\r\n&lt; #if 0 \/* just to make Emacs auto-indent happy *\/\r\n&lt; }\r\n&lt; #endif\r\n40,41c37,38\r\n&lt;  public:\r\n&lt;   GazeboAspectIniFin();\r\n---\r\n&gt; public:\r\n&gt; \tGazeboAspectIniFin();\r\n43,52c40,41\r\n&lt;   virtual void init(Thread *thread);\r\n&lt;   virtual void finalize(Thread *thread);\r\n&lt; \r\n&lt;   \/\/setters for the node_thread\r\n&lt;   void set_gazebonode(gazebo::transport::NodePtr gazebonode);\r\n&lt;   void set_gazebo_world_node(gazebo::transport::NodePtr gazebo_world_node);\r\n&lt; \r\n&lt;  private:\r\n&lt;   gazebo::transport::NodePtr __gazebonode;\r\n&lt;   gazebo::transport::NodePtr __gazebo_world_node;\r\n---\r\n&gt; \tvirtual void init(Thread *thread);\r\n&gt; \tvirtual void finalize(Thread *thread);\r\n53a43,49\r\n&gt; \t\/\/setters for the node_thread\r\n&gt; \tvoid set_gazebonode(gazebo::transport::NodePtr gazebonode);\r\n&gt; \tvoid set_gazebo_world_node(gazebo::transport::NodePtr gazebo_world_node);\r\n&gt; \r\n&gt; private:\r\n&gt; \tgazebo::transport::NodePtr gazebonode_;\r\n&gt; \tgazebo::transport::NodePtr gazebo_world_node_;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/aspect\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/aspect\/Makefile\r\n30c30,31\r\n&lt; OBJS_all    = $(OBJS_libfawkesgazeboaspect)\r\n---\r\n&gt; OBJS_all = $(OBJS_libfawkesgazeboaspect)\r\n&gt; LIBS_all = $(LIBDIR)\/libfawkesgazeboaspect.so\r\n33c34\r\n&lt;   LIBS_all = $(LIBDIR)\/libfawkesgazeboaspect.so\r\n---\r\n&gt;   LIBS_build = $(LIBS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazebo.mk fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazebo.mk\r\n15a16,17\r\n&gt; include $(BUILDSYSDIR)\/boost.mk\r\n&gt; \r\n25a28\r\n&gt;   HAVE_GAZEBO_96 = $(if $(shell $(PKGCONFIG) --atleast-version=9.6.0 'gazebo'; echo $${?\/1\/}),1,0)\r\n29c32,35\r\n&lt;   CFLAGS_GAZEBO  = -DHAVE_GAZEBO $(shell $(PKGCONFIG) --cflags 'gazebo')\r\n---\r\n&gt;   # Gazebo 8 declared several symbols as deprecated but still uses them.\r\n&gt;   # Disable the deprecated declarations warning until this is fixed.\r\n&gt;   CFLAGS_GAZEBO  = -DHAVE_GAZEBO $(shell $(PKGCONFIG) --cflags 'gazebo') \\\r\n&gt;                    -Wno-deprecated-declarations\r\n30a37,40\r\n&gt; \r\n&gt;   ifeq ($(HAVE_GAZEBO_96)$(boost-have-lib system),11)\r\n&gt;     LDFLAGS_GAZEBO += $(boost-lib-ldflags system)\r\n&gt;   endif\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazebo_plugin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazebo_plugin.cpp\r\n26d25\r\n&lt; #include &lt;gazebo\/transport\/TransportIface.hh&gt;\r\n28a28,29\r\n&gt; #include &lt;gazebo\/transport\/TransportIface.hh&gt;\r\n&gt; \r\n41,42c42\r\n&lt; GazeboPlugin::GazeboPlugin(Configuration *config)\r\n&lt;   : Plugin(config)\r\n---\r\n&gt; GazeboPlugin::GazeboPlugin(Configuration *config) : Plugin(config)\r\n44c44\r\n&lt;   thread_list.push_back(new GazeboNodeThread());\r\n---\r\n&gt; \tthread_list.push_back(new GazeboNodeThread());\r\n46d45\r\n&lt; \r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazebo_plugin.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazebo_plugin.h\r\n23,24c23,24\r\n&lt; #ifndef __PLUGINS_GAZEBO_GAZEBO_PLUGIN_H_\r\n&lt; #define __PLUGINS_GAZEBO_GAZEBO_PLUGIN_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZEBO_GAZEBO_PLUGIN_H_\r\n&gt; #define _PLUGINS_GAZEBO_GAZEBO_PLUGIN_H_\r\n30,31c30,31\r\n&lt;  public:\r\n&lt;   GazeboPlugin(fawkes::Configuration *config);\r\n---\r\n&gt; public:\r\n&gt; \texplicit GazeboPlugin(fawkes::Configuration *config);\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-comm\/gazsim_comm_plugin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-comm\/gazsim_comm_plugin.cpp\r\n25a26\r\n&gt; \r\n35,36c36,37\r\n&lt;  public:\r\n&lt;   \/** Constructor.\r\n---\r\n&gt; public:\r\n&gt; \t\/** Constructor.\r\n39,42c40,43\r\n&lt;   GazsimCommPlugin(Configuration *config) : Plugin(config)\r\n&lt;   {\r\n&lt;     thread_list.push_back(new GazsimCommThread());\r\n&lt;   }\r\n---\r\n&gt; \texplicit GazsimCommPlugin(Configuration *config) : Plugin(config)\r\n&gt; \t{\r\n&gt; \t\tthread_list.push_back(new GazsimCommThread());\r\n&gt; \t}\r\n44d44\r\n&lt; \r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-comm\/gazsim_comm_thread.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-comm\/gazsim_comm_thread.cpp\r\n24a25,26\r\n&gt; #include &quot;gazsim_comm_thread.h&quot;\r\n&gt; \r\n26d27\r\n&lt; #include &lt;protobuf_comm\/peer.h&gt;\r\n28,29c29,30\r\n&lt; #include &lt;stdlib.h&gt;\r\n&lt; #include &quot;gazsim_comm_thread.h&quot;\r\n---\r\n&gt; #include &lt;protobuf_comm\/peer.h&gt;\r\n&gt; \r\n30a32\r\n&gt; #include &lt;stdlib.h&gt;\r\n41,42c43,44\r\n&lt;   : Thread(&quot;GazsimCommThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&lt;     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_WORLDSTATE)\r\n---\r\n&gt; : Thread(&quot;GazsimCommThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&gt;   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_WORLDSTATE)\r\n50d51\r\n&lt; \r\n54,55c55,56\r\n&lt;   \/\/logger-&gt;log_info(name(), &quot;GazsimComm initializing&quot;);\r\n&lt;   initialized_ = false;\r\n---\r\n&gt; \t\/\/logger-&gt;log_info(name(), &quot;GazsimComm initializing&quot;);\r\n&gt; \tinitialized_ = false;\r\n57,128c58,136\r\n&lt;   \/\/read config values\r\n&lt;   proto_dirs_ = config-&gt;get_strings(&quot;\/gazsim\/proto-dirs&quot;);\r\n&lt;   package_loss_ = config-&gt;get_float(&quot;\/gazsim\/comm\/package-loss&quot;);\r\n&lt;   addresses_ = config-&gt;get_strings(&quot;\/gazsim\/comm\/addresses&quot;);\r\n&lt;   send_ports_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/send-ports&quot;);\r\n&lt;   recv_ports_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/recv-ports&quot;);\r\n&lt;   use_crypto1_ = config-&gt;get_bool(&quot;\/gazsim\/comm\/use-crypto1&quot;);\r\n&lt;   use_crypto2_ = config-&gt;get_bool(&quot;\/gazsim\/comm\/use-crypto1&quot;);\r\n&lt;   send_ports_crypto1_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/send-ports-crypto1&quot;);\r\n&lt;   recv_ports_crypto1_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/recv-ports-crypto1&quot;);\r\n&lt;   send_ports_crypto2_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/send-ports-crypto2&quot;);\r\n&lt;   recv_ports_crypto2_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/recv-ports-crypto2&quot;);\r\n&lt;   if(addresses_.size() != send_ports_.size() || addresses_.size() != recv_ports_.size()\r\n&lt;      || ( use_crypto1_ &amp;&amp; addresses_.size() != send_ports_crypto1_.size())\r\n&lt;      || ( use_crypto1_ &amp;&amp; addresses_.size() != recv_ports_crypto1_.size())\r\n&lt;      || ( use_crypto2_ &amp;&amp; addresses_.size() != send_ports_crypto2_.size())\r\n&lt;      || ( use_crypto2_ &amp;&amp; addresses_.size() != recv_ports_crypto2_.size()))\r\n&lt;   {\r\n&lt;     logger-&gt;log_warn(name(), &quot;\/gazsim\/comm\/ has an invalid configuration!&quot;);\r\n&lt;   }\r\n&lt; \r\n&lt; \r\n&lt; \r\n&lt;   \/\/resolve proto paths\r\n&lt;   try {\r\n&lt;     proto_dirs_ = config-&gt;get_strings(&quot;\/clips-protobuf\/proto-dirs&quot;);\r\n&lt;     for (size_t i = 0; i &lt; proto_dirs_.size(); ++i) {\r\n&lt;       std::string::size_type pos;\r\n&lt;       if ((pos = proto_dirs_&#x5B;i].find(&quot;@BASEDIR@&quot;)) != std::string::npos) {\r\n&lt; \tproto_dirs_&#x5B;i].replace(pos, 9, BASEDIR);\r\n&lt;       }\r\n&lt;       if ((pos = proto_dirs_&#x5B;i].find(&quot;@FAWKES_BASEDIR@&quot;)) != std::string::npos) {\r\n&lt; \tproto_dirs_&#x5B;i].replace(pos, 16, FAWKES_BASEDIR);\r\n&lt;       }\r\n&lt;       if ((pos = proto_dirs_&#x5B;i].find(&quot;@RESDIR@&quot;)) != std::string::npos) {\r\n&lt; \tproto_dirs_&#x5B;i].replace(pos, 8, RESDIR);\r\n&lt;       }\r\n&lt;       if ((pos = proto_dirs_&#x5B;i].find(&quot;@CONFDIR@&quot;)) != std::string::npos) {\r\n&lt; \tproto_dirs_&#x5B;i].replace(pos, 9, CONFDIR);\r\n&lt;       }\r\n&lt;       if (proto_dirs_&#x5B;i]&#x5B;proto_dirs_.size()-1] != '\/') {\r\n&lt; \tproto_dirs_&#x5B;i] += &quot;\/&quot;;\r\n&lt;       }\r\n&lt;     }\r\n&lt;   } catch (Exception &amp;e) {\r\n&lt;     logger-&gt;log_warn(name(), &quot;Failed to load proto paths from config, exception follows&quot;);\r\n&lt;     logger-&gt;log_warn(name(), e);\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/create peer connections \r\n&lt;   peers_.resize(addresses_.size());\r\n&lt;   peers_crypto1_.resize(addresses_.size());\r\n&lt;   peers_crypto2_.resize(addresses_.size());\r\n&lt;   for(unsigned int i = 0; i &lt; addresses_.size(); i++)\r\n&lt;   {\r\n&lt;     peers_&#x5B;i] = new ProtobufBroadcastPeer(addresses_&#x5B;i], send_ports_&#x5B;i],\r\n&lt; \t\t\t\t\t  recv_ports_&#x5B;i], proto_dirs_);\r\n&lt;     peers_&#x5B;i]-&gt;signal_received_raw().connect(boost::bind(&amp;GazsimCommThread::receive_raw_msg, this, _1, _2, _3, _4));\r\n&lt;     if(use_crypto1_)\r\n&lt;     {\r\n&lt;       peers_crypto1_&#x5B;i] = new ProtobufBroadcastPeer(addresses_&#x5B;i], send_ports_crypto1_&#x5B;i],\r\n&lt; \t\t\t\t\t  recv_ports_crypto1_&#x5B;i], proto_dirs_);\r\n&lt;       peers_crypto1_&#x5B;i]-&gt;signal_received_raw().connect(boost::bind(&amp;GazsimCommThread::receive_raw_msg, this, _1, _2, _3, _4));\r\n&lt;     }\r\n&lt;     if(use_crypto2_)\r\n&lt;     {\r\n&lt;       peers_crypto2_&#x5B;i] = new ProtobufBroadcastPeer(addresses_&#x5B;i], send_ports_crypto2_&#x5B;i],\r\n&lt; \t\t\t\t\t\t    recv_ports_crypto2_&#x5B;i], proto_dirs_);\r\n&lt;       peers_crypto2_&#x5B;i]-&gt;signal_received_raw().connect(boost::bind(&amp;GazsimCommThread::receive_raw_msg, this, _1, _2, _3, _4));\r\n&lt;     }\r\n&lt;   }\r\n&lt;   initialized_ = true;\r\n---\r\n&gt; \t\/\/read config values\r\n&gt; \tproto_dirs_         = config-&gt;get_strings(&quot;\/gazsim\/proto-dirs&quot;);\r\n&gt; \tpackage_loss_       = config-&gt;get_float(&quot;\/gazsim\/comm\/package-loss&quot;);\r\n&gt; \taddresses_          = config-&gt;get_strings(&quot;\/gazsim\/comm\/addresses&quot;);\r\n&gt; \tsend_ports_         = config-&gt;get_uints(&quot;\/gazsim\/comm\/send-ports&quot;);\r\n&gt; \trecv_ports_         = config-&gt;get_uints(&quot;\/gazsim\/comm\/recv-ports&quot;);\r\n&gt; \tuse_crypto1_        = config-&gt;get_bool(&quot;\/gazsim\/comm\/use-crypto1&quot;);\r\n&gt; \tuse_crypto2_        = config-&gt;get_bool(&quot;\/gazsim\/comm\/use-crypto1&quot;);\r\n&gt; \tsend_ports_crypto1_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/send-ports-crypto1&quot;);\r\n&gt; \trecv_ports_crypto1_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/recv-ports-crypto1&quot;);\r\n&gt; \tsend_ports_crypto2_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/send-ports-crypto2&quot;);\r\n&gt; \trecv_ports_crypto2_ = config-&gt;get_uints(&quot;\/gazsim\/comm\/recv-ports-crypto2&quot;);\r\n&gt; \tif (addresses_.size() != send_ports_.size() || addresses_.size() != recv_ports_.size()\r\n&gt; \t    || (use_crypto1_ &amp;&amp; addresses_.size() != send_ports_crypto1_.size())\r\n&gt; \t    || (use_crypto1_ &amp;&amp; addresses_.size() != recv_ports_crypto1_.size())\r\n&gt; \t    || (use_crypto2_ &amp;&amp; addresses_.size() != send_ports_crypto2_.size())\r\n&gt; \t    || (use_crypto2_ &amp;&amp; addresses_.size() != recv_ports_crypto2_.size())) {\r\n&gt; \t\tlogger-&gt;log_warn(name(), &quot;\/gazsim\/comm\/ has an invalid configuration!&quot;);\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/resolve proto paths\r\n&gt; \ttry {\r\n&gt; \t\tproto_dirs_ = config-&gt;get_strings(&quot;\/clips-protobuf\/proto-dirs&quot;);\r\n&gt; \t\tfor (size_t i = 0; i &lt; proto_dirs_.size(); ++i) {\r\n&gt; \t\t\tstd::string::size_type pos;\r\n&gt; \t\t\tif ((pos = proto_dirs_&#x5B;i].find(&quot;@BASEDIR@&quot;)) != std::string::npos) {\r\n&gt; \t\t\t\tproto_dirs_&#x5B;i].replace(pos, 9, BASEDIR);\r\n&gt; \t\t\t}\r\n&gt; \t\t\tif ((pos = proto_dirs_&#x5B;i].find(&quot;@FAWKES_BASEDIR@&quot;)) != std::string::npos) {\r\n&gt; \t\t\t\tproto_dirs_&#x5B;i].replace(pos, 16, FAWKES_BASEDIR);\r\n&gt; \t\t\t}\r\n&gt; \t\t\tif ((pos = proto_dirs_&#x5B;i].find(&quot;@RESDIR@&quot;)) != std::string::npos) {\r\n&gt; \t\t\t\tproto_dirs_&#x5B;i].replace(pos, 8, RESDIR);\r\n&gt; \t\t\t}\r\n&gt; \t\t\tif ((pos = proto_dirs_&#x5B;i].find(&quot;@CONFDIR@&quot;)) != std::string::npos) {\r\n&gt; \t\t\t\tproto_dirs_&#x5B;i].replace(pos, 9, CONFDIR);\r\n&gt; \t\t\t}\r\n&gt; \t\t\tif (proto_dirs_&#x5B;i]&#x5B;proto_dirs_.size() - 1] != '\/') {\r\n&gt; \t\t\t\tproto_dirs_&#x5B;i] += &quot;\/&quot;;\r\n&gt; \t\t\t}\r\n&gt; \t\t}\r\n&gt; \t} catch (Exception &amp;e) {\r\n&gt; \t\tlogger-&gt;log_warn(name(), &quot;Failed to load proto paths from config, exception follows&quot;);\r\n&gt; \t\tlogger-&gt;log_warn(name(), e);\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/create peer connections\r\n&gt; \tpeers_.resize(addresses_.size());\r\n&gt; \tpeers_crypto1_.resize(addresses_.size());\r\n&gt; \tpeers_crypto2_.resize(addresses_.size());\r\n&gt; \tfor (unsigned int i = 0; i &lt; addresses_.size(); i++) {\r\n&gt; \t\tpeers_&#x5B;i] =\r\n&gt; \t\t  new ProtobufBroadcastPeer(addresses_&#x5B;i], send_ports_&#x5B;i], recv_ports_&#x5B;i], proto_dirs_);\r\n&gt; \t\tpeers_&#x5B;i]-&gt;signal_received_raw().connect(\r\n&gt; \t\t  boost::bind(&amp;GazsimCommThread::receive_raw_msg, this, _1, _2, _3, _4));\r\n&gt; \t\tpeers_&#x5B;i]-&gt;signal_send_error().connect(\r\n&gt; \t\t  boost::bind(&amp;GazsimCommThread::peer_send_error, this, addresses_&#x5B;i], send_ports_&#x5B;i], _1));\r\n&gt; \t\tif (use_crypto1_) {\r\n&gt; \t\t\tpeers_crypto1_&#x5B;i] = new ProtobufBroadcastPeer(addresses_&#x5B;i],\r\n&gt; \t\t\t                                              send_ports_crypto1_&#x5B;i],\r\n&gt; \t\t\t                                              recv_ports_crypto1_&#x5B;i],\r\n&gt; \t\t\t                                              proto_dirs_);\r\n&gt; \t\t\tpeers_crypto1_&#x5B;i]-&gt;signal_received_raw().connect(\r\n&gt; \t\t\t  boost::bind(&amp;GazsimCommThread::receive_raw_msg, this, _1, _2, _3, _4));\r\n&gt; \t\t\tpeers_crypto1_&#x5B;i]-&gt;signal_send_error().connect(boost::bind(\r\n&gt; \t\t\t  &amp;GazsimCommThread::peer_send_error, this, addresses_&#x5B;i], send_ports_crypto1_&#x5B;i], _1));\r\n&gt; \t\t}\r\n&gt; \t\tif (use_crypto2_) {\r\n&gt; \t\t\tpeers_crypto2_&#x5B;i] = new ProtobufBroadcastPeer(addresses_&#x5B;i],\r\n&gt; \t\t\t                                              send_ports_crypto2_&#x5B;i],\r\n&gt; \t\t\t                                              recv_ports_crypto2_&#x5B;i],\r\n&gt; \t\t\t                                              proto_dirs_);\r\n&gt; \t\t\tpeers_crypto2_&#x5B;i]-&gt;signal_received_raw().connect(\r\n&gt; \t\t\t  boost::bind(&amp;GazsimCommThread::receive_raw_msg, this, _1, _2, _3, _4));\r\n&gt; \t\t\tpeers_crypto2_&#x5B;i]-&gt;signal_send_error().connect(boost::bind(\r\n&gt; \t\t\t  &amp;GazsimCommThread::peer_send_error, this, addresses_&#x5B;i], send_ports_crypto2_&#x5B;i], _1));\r\n&gt; \t\t}\r\n&gt; \t}\r\n&gt; \tinitialized_ = true;\r\n131d138\r\n&lt; \r\n135,138c142,144\r\n&lt;   for(unsigned int i = 0; i &lt; peers_.size(); i++)\r\n&lt;   {\r\n&lt;     delete peers_&#x5B;i];\r\n&lt;   }\r\n---\r\n&gt; \tfor (unsigned int i = 0; i &lt; peers_.size(); i++) {\r\n&gt; \t\tdelete peers_&#x5B;i];\r\n&gt; \t}\r\n141d146\r\n&lt; \r\n148,183d152\r\n&lt;  * Receive and forward msg\r\n&lt;  * @param endpoint port msg received from\r\n&lt;  * @param component_id message_component_id\r\n&lt;  * @param msg_type msg_type\r\n&lt;  * @param msg Message\r\n&lt;  *\/\r\n&lt; void\r\n&lt; GazsimCommThread::receive_msg(boost::asio::ip::udp::endpoint &amp;endpoint,\r\n&lt; \t\t       uint16_t component_id, uint16_t msg_type,\r\n&lt; \t\t       std::shared_ptr&lt;google::protobuf::Message&gt; msg)\r\n&lt; {\r\n&lt;   \/\/logger-&gt;log_info(name(), &quot;Got Peer Message from port %d&quot;, endpoint.port());\r\n&lt;   unsigned int incoming_peer_port = endpoint.port(); \/\/this is suprisingly the send-port\r\n&lt;  \r\n&lt;   if(!initialized_)\r\n&lt;   {\r\n&lt;     return;\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/simulate package loss\r\n&lt;   double rnd = ((double) rand()) \/ ((double) RAND_MAX); \/\/0.0 &lt;= rnd &lt;= 1.0\r\n&lt;   if(rnd &lt; package_loss_)\r\n&lt;   {\r\n&lt;     return;\r\n&lt;   }\r\n&lt;   \/\/send message to all other peers\r\n&lt;   for(unsigned int i = 0; i &lt; peers_.size(); i++)\r\n&lt;   {\r\n&lt;     if(send_ports_&#x5B;i] != incoming_peer_port)\r\n&lt;     {\r\n&lt;       peers_&#x5B;i]-&gt;send(msg);\r\n&lt;     }\r\n&lt;   }\r\n&lt; }\r\n&lt; \r\n&lt; \/**\r\n192,193c161,209\r\n&lt; \t\t\t\t  protobuf_comm::frame_header_t &amp;header, void * data,\r\n&lt; \t\t\t\t  size_t length)\r\n---\r\n&gt;                                   protobuf_comm::frame_header_t &amp; header,\r\n&gt;                                   void *                          data,\r\n&gt;                                   size_t                          length)\r\n&gt; {\r\n&gt; \t\/\/logger-&gt;log_info(name(), &quot;Got raw Message from port %d&quot;, endpoint.port());\r\n&gt; \tunsigned int incoming_peer_port = endpoint.port(); \/\/this is suprisingly the send-port\r\n&gt; \r\n&gt; \tif (!initialized_) {\r\n&gt; \t\treturn;\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/simulate package loss\r\n&gt; \tdouble rnd = ((double)rand()) \/ ((double)RAND_MAX); \/\/0.0 &lt;= rnd &lt;= 1.0\r\n&gt; \tif (rnd &lt; package_loss_) {\r\n&gt; \t\treturn;\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/check which set of peers the message comes from\r\n&gt; \tstd::vector&lt;protobuf_comm::ProtobufBroadcastPeer *&gt; peers;\r\n&gt; \tstd::vector&lt;unsigned int&gt;                           send_ports;\r\n&gt; \tif (std::find(send_ports_.begin(), send_ports_.end(), incoming_peer_port) != send_ports_.end()) {\r\n&gt; \t\tpeers      = peers_;\r\n&gt; \t\tsend_ports = send_ports_;\r\n&gt; \t} else if (use_crypto1_\r\n&gt; \t           &amp;&amp; std::find(send_ports_crypto1_.begin(),\r\n&gt; \t                        send_ports_crypto1_.end(),\r\n&gt; \t                        incoming_peer_port)\r\n&gt; \t                != send_ports_crypto1_.end()) {\r\n&gt; \t\tpeers      = peers_crypto1_;\r\n&gt; \t\tsend_ports = send_ports_crypto1_;\r\n&gt; \t} else if (use_crypto2_\r\n&gt; \t           &amp;&amp; std::find(send_ports_crypto2_.begin(),\r\n&gt; \t                        send_ports_crypto2_.end(),\r\n&gt; \t                        incoming_peer_port)\r\n&gt; \t                != send_ports_crypto2_.end()) {\r\n&gt; \t\tpeers      = peers_crypto2_;\r\n&gt; \t\tsend_ports = send_ports_crypto2_;\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/send message to all other peers\r\n&gt; \tfor (unsigned int i = 0; i &lt; peers.size(); i++) {\r\n&gt; \t\tif (send_ports&#x5B;i] != incoming_peer_port) {\r\n&gt; \t\t\tpeers&#x5B;i]-&gt;send_raw(header, data, length);\r\n&gt; \t\t}\r\n&gt; \t}\r\n&gt; }\r\n&gt; \r\n&gt; void\r\n&gt; GazsimCommThread::peer_send_error(std::string address, unsigned int port, std::string err)\r\n195,236c211\r\n&lt;   \/\/logger-&gt;log_info(name(), &quot;Got raw Message from port %d&quot;, endpoint.port());\r\n&lt;   unsigned int incoming_peer_port = endpoint.port(); \/\/this is suprisingly the send-port\r\n&lt;  \r\n&lt;   if(!initialized_)\r\n&lt;   {\r\n&lt;     return;\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/simulate package loss\r\n&lt;   double rnd = ((double) rand()) \/ ((double) RAND_MAX); \/\/0.0 &lt;= rnd &lt;= 1.0\r\n&lt;   if(rnd &lt; package_loss_)\r\n&lt;   {\r\n&lt;     return;\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/check which set of peers the message comes from\r\n&lt;   std::vector&lt;protobuf_comm::ProtobufBroadcastPeer*&gt; peers;\r\n&lt;   std::vector&lt;unsigned int&gt; send_ports;\r\n&lt;   if(std::find(send_ports_.begin(), send_ports_.end(), incoming_peer_port) != send_ports_.end())\r\n&lt;   {\r\n&lt;     peers = peers_;\r\n&lt;     send_ports = send_ports_;\r\n&lt;   }\r\n&lt;   else if(use_crypto1_ &amp;&amp; std::find(send_ports_crypto1_.begin(), send_ports_crypto1_.end(), incoming_peer_port) != send_ports_crypto1_.end())\r\n&lt;   {\r\n&lt;     peers = peers_crypto1_;\r\n&lt;     send_ports = send_ports_crypto1_;\r\n&lt;   }  \r\n&lt;   else if(use_crypto2_ &amp;&amp; std::find(send_ports_crypto2_.begin(), send_ports_crypto2_.end(), incoming_peer_port) != send_ports_crypto1_.end())\r\n&lt;   {\r\n&lt;     peers = peers_crypto2_;\r\n&lt;     send_ports = send_ports_crypto2_;\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/send message to all other peers\r\n&lt;   for(unsigned int i = 0; i &lt; peers.size(); i++)\r\n&lt;   {\r\n&lt;     if(send_ports&#x5B;i] != incoming_peer_port)\r\n&lt;     {\r\n&lt;       peers&#x5B;i]-&gt;send_raw(header, data, length);\r\n&lt;     }\r\n&lt;   }\r\n---\r\n&gt; \tlogger-&gt;log_warn(name(), &quot;Peer send error for %s:%u: %s&quot;, address.c_str(), port, err.c_str());\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-comm\/gazsim_comm_thread.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-comm\/gazsim_comm_thread.h\r\n25,26c25,26\r\n&lt; #ifndef __PLUGINS_GAZSIM_COMM_COMM_THREAD_H_\r\n&lt; #define __PLUGINS_GAZSIM_COMM_COMM_THREAD_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZSIM_COMM_COMM_THREAD_H_\r\n&gt; #define _PLUGINS_GAZSIM_COMM_COMM_THREAD_H_\r\n28,30d27\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n&lt; #include &lt;aspect\/logging.h&gt;\r\n&lt; #include &lt;aspect\/configurable.h&gt;\r\n32c29,31\r\n&lt; #include &lt;boost\/asio.hpp&gt;\r\n---\r\n&gt; #include &lt;aspect\/configurable.h&gt;\r\n&gt; #include &lt;aspect\/logging.h&gt;\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n34d32\r\n&lt; #include &lt;protobuf_comm\/peer.h&gt;\r\n36c34\r\n&lt; #include &lt;list&gt;\r\n---\r\n&gt; #include &lt;protobuf_comm\/peer.h&gt;\r\n37a36,37\r\n&gt; #include &lt;boost\/asio.hpp&gt;\r\n&gt; #include &lt;list&gt;\r\n40c40\r\n&lt;   class ProtobufStreamClient;\r\n---\r\n&gt; class ProtobufStreamClient;\r\n43,47c43,46\r\n&lt; class GazsimCommThread\r\n&lt; : public fawkes::Thread,\r\n&lt;   public fawkes::BlockedTimingAspect,\r\n&lt;   public fawkes::ConfigurableAspect,\r\n&lt;   public fawkes::LoggingAspect\r\n---\r\n&gt; class GazsimCommThread : public fawkes::Thread,\r\n&gt;                          public fawkes::BlockedTimingAspect,\r\n&gt;                          public fawkes::ConfigurableAspect,\r\n&gt;                          public fawkes::LoggingAspect\r\n49,81c48,85\r\n&lt;  public:\r\n&lt;   GazsimCommThread();\r\n&lt;   ~GazsimCommThread();\r\n&lt; \r\n&lt;   virtual void init();\r\n&lt;   virtual void loop();\r\n&lt;   virtual void finalize();\r\n&lt; \r\n&lt;   void receive_msg(boost::asio::ip::udp::endpoint &amp;endpoint,\r\n&lt; \t\t       uint16_t component_id, uint16_t msg_type,\r\n&lt; \t\t       std::shared_ptr&lt;google::protobuf::Message&gt; msg);\r\n&lt;   void receive_raw_msg(boost::asio::ip::udp::endpoint &amp;endpoint,\r\n&lt; \t\t       protobuf_comm::frame_header_t &amp;header, void * data,\r\n&lt; \t\t       size_t length);\r\n&lt; \r\n&lt;  \/** Stub to see name in backtrace for easier debugging. @see Thread::run() *\/\r\n&lt;  protected: virtual void run() { Thread::run(); }\r\n&lt; \r\n&lt;  private:\r\n&lt;   std::vector&lt;protobuf_comm::ProtobufBroadcastPeer*&gt; peers_;\r\n&lt;   std::vector&lt;protobuf_comm::ProtobufBroadcastPeer*&gt; peers_crypto1_;\r\n&lt;   std::vector&lt;protobuf_comm::ProtobufBroadcastPeer*&gt; peers_crypto2_;\r\n&lt; \r\n&lt;   \/\/config values\r\n&lt;   std::vector&lt;std::string&gt; addresses_;\r\n&lt;   std::vector&lt;unsigned int&gt; send_ports_;\r\n&lt;   std::vector&lt;unsigned int&gt; recv_ports_;\r\n&lt;   std::vector&lt;unsigned int&gt; send_ports_crypto1_;\r\n&lt;   std::vector&lt;unsigned int&gt; recv_ports_crypto1_;\r\n&lt;   std::vector&lt;unsigned int&gt; send_ports_crypto2_;\r\n&lt;   std::vector&lt;unsigned int&gt; recv_ports_crypto2_;\r\n&lt;   \r\n&lt;   bool use_crypto1_, use_crypto2_;\r\n---\r\n&gt; public:\r\n&gt; \tGazsimCommThread();\r\n&gt; \t~GazsimCommThread();\r\n&gt; \r\n&gt; \tvirtual void init();\r\n&gt; \tvirtual void loop();\r\n&gt; \tvirtual void finalize();\r\n&gt; \r\n&gt; \t\/** Stub to see name in backtrace for easier debugging. @see Thread::run() *\/\r\n&gt; protected:\r\n&gt; \tvirtual void\r\n&gt; \trun()\r\n&gt; \t{\r\n&gt; \t\tThread::run();\r\n&gt; \t}\r\n&gt; \r\n&gt; private:\r\n&gt; \tvoid peer_send_error(std::string address, unsigned int port, std::string err);\r\n&gt; \tvoid receive_raw_msg(boost::asio::ip::udp::endpoint &amp;endpoint,\r\n&gt; \t                     protobuf_comm::frame_header_t &amp; header,\r\n&gt; \t                     void *                          data,\r\n&gt; \t                     size_t                          length);\r\n&gt; \r\n&gt; private:\r\n&gt; \tstd::vector&lt;protobuf_comm::ProtobufBroadcastPeer *&gt; peers_;\r\n&gt; \tstd::vector&lt;protobuf_comm::ProtobufBroadcastPeer *&gt; peers_crypto1_;\r\n&gt; \tstd::vector&lt;protobuf_comm::ProtobufBroadcastPeer *&gt; peers_crypto2_;\r\n&gt; \r\n&gt; \t\/\/config values\r\n&gt; \tstd::vector&lt;std::string&gt;  addresses_;\r\n&gt; \tstd::vector&lt;unsigned int&gt; send_ports_;\r\n&gt; \tstd::vector&lt;unsigned int&gt; recv_ports_;\r\n&gt; \tstd::vector&lt;unsigned int&gt; send_ports_crypto1_;\r\n&gt; \tstd::vector&lt;unsigned int&gt; recv_ports_crypto1_;\r\n&gt; \tstd::vector&lt;unsigned int&gt; send_ports_crypto2_;\r\n&gt; \tstd::vector&lt;unsigned int&gt; recv_ports_crypto2_;\r\n&gt; \r\n&gt; \tbool use_crypto1_, use_crypto2_;\r\n83,84c87,88\r\n&lt;   std::vector&lt;std::string&gt; proto_dirs_;\r\n&lt;   double package_loss_;\r\n---\r\n&gt; \tstd::vector&lt;std::string&gt; proto_dirs_;\r\n&gt; \tdouble                   package_loss_;\r\n86,87c90,91\r\n&lt;   \/\/helper variables\r\n&lt;   bool initialized_;\r\n---\r\n&gt; \t\/\/helper variables\r\n&gt; \tbool initialized_;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-comm\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-comm\/Makefile\r\n28c28,29\r\n&lt; LIBS_gazsim_comm = fawkescore fawkesutils fawkesaspects fawkes_protobuf_comm fawkesgazeboaspect gazsim_msgs \r\n---\r\n&gt; LIBS_gazsim_comm = fawkescore fawkesutils fawkesaspects fawkes_protobuf_comm \\\r\n&gt;                    fawkesgazeboaspect gazsim_msgs \r\n31c32,33\r\n&lt; OBJS_all = $(OBJS_gazsim_comm)\r\n---\r\n&gt; OBJS_all    = $(OBJS_gazsim_comm)\r\n&gt; PLUGINS_all = $(PLUGINDIR)\/gazsim-comm.so\r\n42c44\r\n&lt;   PLUGINS_all = $(PLUGINDIR)\/gazsim-comm.so\r\n---\r\n&gt;   PLUGINS_build = $(PLUGINS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-depthcam\/gazsim_depthcam_plugin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-depthcam\/gazsim_depthcam_plugin.cpp\r\n22,23d21\r\n&lt; #include &lt;core\/plugin.h&gt;\r\n&lt; \r\n25a24,25\r\n&gt; #include &lt;core\/plugin.h&gt;\r\n&gt; \r\n35,37c35,36\r\n&lt;  public:\r\n&lt; \r\n&lt;   \/** Constructor.\r\n---\r\n&gt; public:\r\n&gt; \t\/** Constructor.\r\n40,44c39,42\r\n&lt;   GazsimDepthcamPlugin(Configuration *config)\r\n&lt;     : Plugin(config)\r\n&lt;   {\r\n&lt;     thread_list.push_back(new DepthcamSimThread());\r\n&lt;   }\r\n---\r\n&gt; \texplicit GazsimDepthcamPlugin(Configuration *config) : Plugin(config)\r\n&gt; \t{\r\n&gt; \t\tthread_list.push_back(new DepthcamSimThread());\r\n&gt; \t}\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-depthcam\/gazsim_depthcam_thread.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-depthcam\/gazsim_depthcam_thread.cpp\r\n23a24\r\n&gt; #include &lt;aspect\/logging.h&gt;\r\n25,26d25\r\n&lt; #include &lt;stdio.h&gt;\r\n&lt; #include &lt;math.h&gt;\r\n29d27\r\n&lt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n30a29\r\n&gt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n32c31,32\r\n&lt; #include &lt;aspect\/logging.h&gt;\r\n---\r\n&gt; #include &lt;math.h&gt;\r\n&gt; #include &lt;stdio.h&gt;\r\n44,45c44,45\r\n&lt;   : Thread(&quot;DepthcamSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&lt;     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SENSOR_PROCESS)\r\n---\r\n&gt; : Thread(&quot;DepthcamSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&gt;   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SENSOR_PROCESS)\r\n49c49,50\r\n&lt; void DepthcamSimThread::init()\r\n---\r\n&gt; void\r\n&gt; DepthcamSimThread::init()\r\n51,66c52,68\r\n&lt;   logger-&gt;log_debug(name(), &quot;Initializing Simulation of the Depthcam&quot;);\r\n&lt;   topic_name_ = config-&gt;get_string(&quot;\/gazsim\/depthcam\/topic&quot;);\r\n&lt;   width_ = config-&gt;get_float(&quot;\/gazsim\/depthcam\/width&quot;);\r\n&lt;   height_ = config-&gt;get_float(&quot;\/gazsim\/depthcam\/height&quot;);\r\n&lt;   frame_ = config-&gt;get_string(&quot;\/gazsim\/depthcam\/frame&quot;);\r\n&lt;   pcl_id_ = config-&gt;get_string(&quot;\/gazsim\/depthcam\/pointcloud-id&quot;);\r\n&lt; \r\n&lt;   depthcam_sub_ = gazebo_world_node-&gt;Subscribe(topic_name_, &amp;DepthcamSimThread::on_depthcam_data_msg, this);\r\n&lt; \r\n&lt;   \/\/create pointcloud:\r\n&lt;   pcl_ = new pcl::PointCloud&lt;pcl::PointXYZ&gt;();\r\n&lt;   pcl_-&gt;is_dense = false;\r\n&lt;   pcl_-&gt;width    = width_;\r\n&lt;   pcl_-&gt;height   = height_;\r\n&lt;   pcl_-&gt;points.resize(width_ * height_);\r\n&lt;   pcl_-&gt;header.frame_id = frame_;\r\n---\r\n&gt; \tlogger-&gt;log_debug(name(), &quot;Initializing Simulation of the Depthcam&quot;);\r\n&gt; \ttopic_name_ = config-&gt;get_string(&quot;\/gazsim\/depthcam\/topic&quot;);\r\n&gt; \twidth_      = config-&gt;get_float(&quot;\/gazsim\/depthcam\/width&quot;);\r\n&gt; \theight_     = config-&gt;get_float(&quot;\/gazsim\/depthcam\/height&quot;);\r\n&gt; \tframe_      = config-&gt;get_string(&quot;\/gazsim\/depthcam\/frame&quot;);\r\n&gt; \tpcl_id_     = config-&gt;get_string(&quot;\/gazsim\/depthcam\/pointcloud-id&quot;);\r\n&gt; \r\n&gt; \tdepthcam_sub_ =\r\n&gt; \t  gazebo_world_node-&gt;Subscribe(topic_name_, &amp;DepthcamSimThread::on_depthcam_data_msg, this);\r\n&gt; \r\n&gt; \t\/\/create pointcloud:\r\n&gt; \tpcl_           = new pcl::PointCloud&lt;pcl::PointXYZ&gt;();\r\n&gt; \tpcl_-&gt;is_dense = false;\r\n&gt; \tpcl_-&gt;width    = width_;\r\n&gt; \tpcl_-&gt;height   = height_;\r\n&gt; \tpcl_-&gt;points.resize((size_t)width_ * (size_t)height_);\r\n&gt; \tpcl_-&gt;header.frame_id = frame_;\r\n68c70\r\n&lt;   pcl_manager-&gt;add_pointcloud(pcl_id_.c_str(), pcl_);\r\n---\r\n&gt; \tpcl_manager-&gt;add_pointcloud(pcl_id_.c_str(), pcl_);\r\n71c73,74\r\n&lt; void DepthcamSimThread::finalize()\r\n---\r\n&gt; void\r\n&gt; DepthcamSimThread::finalize()\r\n73c76\r\n&lt;   pcl_manager-&gt;remove_pointcloud(pcl_id_.c_str());\r\n---\r\n&gt; \tpcl_manager-&gt;remove_pointcloud(pcl_id_.c_str());\r\n76c79,80\r\n&lt; void DepthcamSimThread::loop()\r\n---\r\n&gt; void\r\n&gt; DepthcamSimThread::loop()\r\n78c82\r\n&lt;   \/\/The interesting stuff happens in the callback of the depthcam\r\n---\r\n&gt; \t\/\/The interesting stuff happens in the callback of the depthcam\r\n81,104c85,109\r\n&lt; void DepthcamSimThread::on_depthcam_data_msg(ConstPointCloudPtr &amp;msg)\r\n&lt; {  \r\n&lt;   \/\/ logger-&gt;log_info(name(), &quot;Got Point Cloud!&quot;);\r\n&lt; \r\n&lt;   \/\/only write when pcl is used\r\n&lt;   \/\/ if (pcl_.use_count() &gt; 1)\r\n&lt;   \/\/ {\r\n&lt;     fawkes::Time capture_time = clock-&gt;now();\r\n&lt; \r\n&lt;     pcl::PointCloud&lt;pcl::PointXYZ&gt; &amp;pcl = **pcl_;\r\n&lt;     pcl.header.seq += 1;\r\n&lt;     pcl_utils::set_time(pcl_, capture_time);\r\n&lt; \r\n&lt;     \/\/insert or update points in pointcloud\r\n&lt;     unsigned int idx = 0;\r\n&lt;     for (unsigned int h = 0; h &lt; height_; ++h) {\r\n&lt;       for (unsigned int w = 0; w &lt; width_; ++w, ++idx) {\r\n&lt;         \/\/ Fill in XYZ\r\n&lt;         pcl.points&#x5B;idx].x = msg-&gt;points(idx).z();\r\n&lt;         pcl.points&#x5B;idx].y = -msg-&gt;points(idx).x();\r\n&lt;         pcl.points&#x5B;idx].z = msg-&gt;points(idx).y();\r\n&lt;       }\r\n&lt;     }\r\n&lt;   \/\/ }\r\n---\r\n&gt; void\r\n&gt; DepthcamSimThread::on_depthcam_data_msg(ConstPointCloudPtr &amp;msg)\r\n&gt; {\r\n&gt; \t\/\/ logger-&gt;log_info(name(), &quot;Got Point Cloud!&quot;);\r\n&gt; \r\n&gt; \t\/\/only write when pcl is used\r\n&gt; \t\/\/ if (pcl_.use_count() &gt; 1)\r\n&gt; \t\/\/ {\r\n&gt; \tfawkes::Time capture_time = clock-&gt;now();\r\n&gt; \r\n&gt; \tpcl::PointCloud&lt;pcl::PointXYZ&gt; &amp;pcl = **pcl_;\r\n&gt; \tpcl.header.seq += 1;\r\n&gt; \tpcl_utils::set_time(pcl_, capture_time);\r\n&gt; \r\n&gt; \t\/\/insert or update points in pointcloud\r\n&gt; \tunsigned int idx = 0;\r\n&gt; \tfor (unsigned int h = 0; h &lt; height_; ++h) {\r\n&gt; \t\tfor (unsigned int w = 0; w &lt; width_; ++w, ++idx) {\r\n&gt; \t\t\t\/\/ Fill in XYZ\r\n&gt; \t\t\tpcl.points&#x5B;idx].x = msg-&gt;points(idx).z();\r\n&gt; \t\t\tpcl.points&#x5B;idx].y = -msg-&gt;points(idx).x();\r\n&gt; \t\t\tpcl.points&#x5B;idx].z = msg-&gt;points(idx).y();\r\n&gt; \t\t}\r\n&gt; \t}\r\n&gt; \t\/\/ }\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-depthcam\/gazsim_depthcam_thread.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-depthcam\/gazsim_depthcam_thread.h\r\n22,23c22,23\r\n&lt; #ifndef __PLUGINS_GAZSIM_DEPTHCAM_THREAD_H_\r\n&lt; #define __PLUGINS_GAZSIM_DEPTHCAM_THREAD_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZSIM_DEPTHCAM_THREAD_H_\r\n&gt; #define _PLUGINS_GAZSIM_DEPTHCAM_THREAD_H_\r\n25c25,26\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n---\r\n&gt; #include &lt;aspect\/blackboard.h&gt;\r\n&gt; #include &lt;aspect\/blocked_timing.h&gt;\r\n29,33d29\r\n&lt; #include &lt;aspect\/blackboard.h&gt;\r\n&lt; #include &lt;aspect\/blocked_timing.h&gt;\r\n&lt; #include &lt;plugins\/gazebo\/aspect\/gazebo.h&gt;\r\n&lt; #include &lt;string.h&gt;\r\n&lt; \r\n34a31\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n36a34\r\n&gt; #include &lt;plugins\/gazebo\/aspect\/gazebo.h&gt;\r\n37a36\r\n&gt; #include &lt;string.h&gt;\r\n40d38\r\n&lt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n41a40\r\n&gt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n44,52c43,50\r\n&lt; class DepthcamSimThread\r\n&lt; : public fawkes::Thread,\r\n&lt;   public fawkes::ClockAspect,\r\n&lt;   public fawkes::LoggingAspect,\r\n&lt;   public fawkes::ConfigurableAspect,\r\n&lt;   public fawkes::BlackBoardAspect,\r\n&lt;   public fawkes::BlockedTimingAspect,\r\n&lt;   public fawkes::GazeboAspect,\r\n&lt;   public fawkes::PointCloudAspect\r\n---\r\n&gt; class DepthcamSimThread : public fawkes::Thread,\r\n&gt;                           public fawkes::ClockAspect,\r\n&gt;                           public fawkes::LoggingAspect,\r\n&gt;                           public fawkes::ConfigurableAspect,\r\n&gt;                           public fawkes::BlackBoardAspect,\r\n&gt;                           public fawkes::BlockedTimingAspect,\r\n&gt;                           public fawkes::GazeboAspect,\r\n&gt;                           public fawkes::PointCloudAspect\r\n54,55c52,53\r\n&lt;  public:\r\n&lt;   DepthcamSimThread();\r\n---\r\n&gt; public:\r\n&gt; \tDepthcamSimThread();\r\n57,75c55,73\r\n&lt;   virtual void init();\r\n&lt;   virtual void loop();\r\n&lt;   virtual void finalize();\r\n&lt; \r\n&lt;  private:\r\n&lt;   gazebo::transport::SubscriberPtr depthcam_sub_;\r\n&lt; \r\n&lt;   \/\/handler function for incoming depthcam data messages\r\n&lt;   void on_depthcam_data_msg(ConstPointCloudPtr &amp;msg);\r\n&lt; \r\n&lt;   \/\/config values\r\n&lt;   \/\/topic name of the gazebo message publisher\r\n&lt;   std::string topic_name_;\r\n&lt;   unsigned int width_;\r\n&lt;   unsigned int height_;\r\n&lt;   \/\/id of the shared memory object\r\n&lt;   std::string shm_id_;\r\n&lt;   std::string frame_;\r\n&lt;   std::string pcl_id_;\r\n---\r\n&gt; \tvirtual void init();\r\n&gt; \tvirtual void loop();\r\n&gt; \tvirtual void finalize();\r\n&gt; \r\n&gt; private:\r\n&gt; \tgazebo::transport::SubscriberPtr depthcam_sub_;\r\n&gt; \r\n&gt; \t\/\/handler function for incoming depthcam data messages\r\n&gt; \tvoid on_depthcam_data_msg(ConstPointCloudPtr &amp;msg);\r\n&gt; \r\n&gt; \t\/\/config values\r\n&gt; \t\/\/topic name of the gazebo message publisher\r\n&gt; \tstd::string  topic_name_;\r\n&gt; \tunsigned int width_;\r\n&gt; \tunsigned int height_;\r\n&gt; \t\/\/id of the shared memory object\r\n&gt; \tstd::string shm_id_;\r\n&gt; \tstd::string frame_;\r\n&gt; \tstd::string pcl_id_;\r\n77c75\r\n&lt;   fawkes::RefPtr&lt;pcl::PointCloud&lt;pcl::PointXYZ&gt; &gt; pcl_;\r\n---\r\n&gt; \tfawkes::RefPtr&lt;pcl::PointCloud&lt;pcl::PointXYZ&gt;&gt; pcl_;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-depthcam\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-depthcam\/Makefile\r\n26,28c26,28\r\n&lt; LIBS_gazsim_depthcam = fawkescore fawkesutils fawkesaspects fvutils \\\r\n&lt; \t       fawkestf fawkesinterface fawkesblackboard \\\r\n&lt; \t       fawkesgazeboaspect\r\n---\r\n&gt; LIBS_gazsim_depthcam = m fawkescore fawkesutils fawkesaspects fvutils \\\r\n&gt;                        fawkestf fawkesinterface fawkesblackboard \\\r\n&gt;                        fawkesgazeboaspect\r\n31a32\r\n&gt; PLUGINS_all = $(PLUGINDIR)\/gazsim-depthcam.so\r\n37c38,39\r\n&lt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) $(LDFLAGS_PCL) -lm $(call boost-libs-ldflags,system) -lboost_system\r\n---\r\n&gt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) $(LDFLAGS_PCL) \\\r\n&gt;              $(call boost-libs-ldflags,system)\r\n39c41\r\n&lt;   PLUGINS_all = $(PLUGINDIR)\/gazsim-depthcam.so\r\n---\r\n&gt;   PLUGINS_build = $(PLUGINS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-laser\/gazsim_laser_plugin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-laser\/gazsim_laser_plugin.cpp\r\n21,22d20\r\n&lt; #include &lt;core\/plugin.h&gt;\r\n&lt; \r\n24a23,24\r\n&gt; #include &lt;core\/plugin.h&gt;\r\n&gt; \r\n34,36c34,35\r\n&lt;  public:\r\n&lt; \r\n&lt;   \/** Constructor.\r\n---\r\n&gt; public:\r\n&gt; \t\/** Constructor.\r\n39,43c38,41\r\n&lt;   GazsimLaserPlugin(Configuration *config)\r\n&lt;     : Plugin(config)\r\n&lt;   {\r\n&lt;     thread_list.push_back(new LaserSimThread());\r\n&lt;   }\r\n---\r\n&gt; \texplicit GazsimLaserPlugin(Configuration *config) : Plugin(config)\r\n&gt; \t{\r\n&gt; \t\tthread_list.push_back(new LaserSimThread());\r\n&gt; \t}\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-laser\/gazsim_laser_thread.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-laser\/gazsim_laser_thread.cpp\r\n24,25c24\r\n&lt; #include &lt;tf\/types.h&gt;\r\n&lt; #include &lt;utils\/math\/angle.h&gt;\r\n---\r\n&gt; #include &lt;aspect\/logging.h&gt;\r\n27d25\r\n&lt; \r\n28a27,28\r\n&gt; #include &lt;tf\/types.h&gt;\r\n&gt; #include &lt;utils\/math\/angle.h&gt;\r\n30c30,31\r\n&lt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n---\r\n&gt; #include &lt;cmath&gt;\r\n&gt; #include &lt;cstdio&gt;\r\n31a33\r\n&gt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n33,36d34\r\n&lt; #include &lt;aspect\/logging.h&gt;\r\n&lt; \r\n&lt; #include &lt;cstdio&gt;\r\n&lt; #include &lt;cmath&gt;\r\n48,49c46,47\r\n&lt;   : Thread(&quot;LaserSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&lt;     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SENSOR_PROCESS)\r\n---\r\n&gt; : Thread(&quot;LaserSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&gt;   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SENSOR_PROCESS)\r\n53c51,52\r\n&lt; void LaserSimThread::init()\r\n---\r\n&gt; void\r\n&gt; LaserSimThread::init()\r\n55c54\r\n&lt;   logger-&gt;log_debug(name(), &quot;Initializing Simulation of the Laser Sensor&quot;);\r\n---\r\n&gt; \tlogger-&gt;log_debug(name(), &quot;Initializing Simulation of the Laser Sensor&quot;);\r\n57,73c56,72\r\n&lt;   \/\/read config values\r\n&lt;   max_range_ = config-&gt;get_float(&quot;\/gazsim\/laser\/max_range&quot;);\r\n&lt;   laser_topic_ = config-&gt;get_string(&quot;\/gazsim\/topics\/laser&quot;);\r\n&lt;   interface_id_ = config-&gt;get_string(&quot;\/gazsim\/laser\/interface-id&quot;);\r\n&lt;   frame_id_ = config-&gt;get_string(&quot;\/gazsim\/laser\/frame-id&quot;);\r\n&lt; \r\n&lt;   \/\/open interface\r\n&lt;   laser_if_ = blackboard-&gt;open_for_writing&lt;Laser360Interface&gt;(interface_id_.c_str());\r\n&lt;   laser_if_-&gt;set_auto_timestamping(false);\r\n&lt; \r\n&lt;   \/\/subscribing to gazebo publisher\r\n&lt;   laser_sub_ = gazebonode-&gt;Subscribe(laser_topic_, &amp;LaserSimThread::on_laser_data_msg, this);\r\n&lt; \r\n&lt;   \/\/initialize laser data\r\n&lt;   laser_data_ = (float *)malloc(sizeof(float) * 360);\r\n&lt;   laser_time_ = new Time(clock);\r\n&lt;   new_data_ = false;\r\n---\r\n&gt; \t\/\/read config values\r\n&gt; \tmax_range_    = config-&gt;get_float(&quot;\/gazsim\/laser\/max_range&quot;);\r\n&gt; \tlaser_topic_  = config-&gt;get_string(&quot;\/gazsim\/topics\/laser&quot;);\r\n&gt; \tinterface_id_ = config-&gt;get_string(&quot;\/gazsim\/laser\/interface-id&quot;);\r\n&gt; \tframe_id_     = config-&gt;get_string(&quot;\/gazsim\/laser\/frame-id&quot;);\r\n&gt; \r\n&gt; \t\/\/open interface\r\n&gt; \tlaser_if_ = blackboard-&gt;open_for_writing&lt;Laser360Interface&gt;(interface_id_.c_str());\r\n&gt; \tlaser_if_-&gt;set_auto_timestamping(false);\r\n&gt; \r\n&gt; \t\/\/subscribing to gazebo publisher\r\n&gt; \tlaser_sub_ = gazebonode-&gt;Subscribe(laser_topic_, &amp;LaserSimThread::on_laser_data_msg, this);\r\n&gt; \r\n&gt; \t\/\/initialize laser data\r\n&gt; \tlaser_data_ = (float *)malloc(sizeof(float) * 360);\r\n&gt; \tlaser_time_ = new Time(clock);\r\n&gt; \tnew_data_   = false;\r\n75,76c74,75\r\n&lt;   \/\/set frame in the interface\r\n&lt;   laser_if_-&gt;set_frame(frame_id_.c_str());\r\n---\r\n&gt; \t\/\/set frame in the interface\r\n&gt; \tlaser_if_-&gt;set_frame(frame_id_.c_str());\r\n79c78,79\r\n&lt; void LaserSimThread::finalize()\r\n---\r\n&gt; void\r\n&gt; LaserSimThread::finalize()\r\n81,83c81,83\r\n&lt;   blackboard-&gt;close(laser_if_);\r\n&lt;   free(laser_data_);\r\n&lt;   delete laser_time_;\r\n---\r\n&gt; \tblackboard-&gt;close(laser_if_);\r\n&gt; \tfree(laser_data_);\r\n&gt; \tdelete laser_time_;\r\n86c86,87\r\n&lt; void LaserSimThread::loop()\r\n---\r\n&gt; void\r\n&gt; LaserSimThread::loop()\r\n88,93c89,93\r\n&lt;   if(new_data_)\r\n&lt;   {\r\n&lt;     \/\/write interface\r\n&lt;     laser_if_-&gt;set_distances(laser_data_);\r\n&lt;     laser_if_-&gt;set_timestamp(laser_time_);\r\n&lt;     laser_if_-&gt;write();\r\n---\r\n&gt; \tif (new_data_) {\r\n&gt; \t\t\/\/write interface\r\n&gt; \t\tlaser_if_-&gt;set_distances(laser_data_);\r\n&gt; \t\tlaser_if_-&gt;set_timestamp(laser_time_);\r\n&gt; \t\tlaser_if_-&gt;write();\r\n95,96c95,96\r\n&lt;     new_data_ = false;\r\n&lt;   }  \r\n---\r\n&gt; \t\tnew_data_ = false;\r\n&gt; \t}\r\n99c99,100\r\n&lt; void LaserSimThread::on_laser_data_msg(ConstLaserScanStampedPtr &amp;msg)\r\n---\r\n&gt; void\r\n&gt; LaserSimThread::on_laser_data_msg(ConstLaserScanStampedPtr &amp;msg)\r\n101c102,106\r\n&lt;   \/\/logger-&gt;log_info(name(), &quot;Got new Laser data.\\n&quot;);\r\n---\r\n&gt; \t\/\/logger-&gt;log_info(name(), &quot;Got new Laser data.\\n&quot;);\r\n&gt; \r\n&gt; \tMutexLocker lock(loop_mutex);\r\n&gt; \r\n&gt; \tconst gazebo::msgs::LaserScan &amp;scan = msg-&gt;scan();\r\n103c108,109\r\n&lt;   MutexLocker lock(loop_mutex);\r\n---\r\n&gt; \t\/\/calculate start angle\r\n&gt; \tint start_index = (scan.angle_min() + 2 * M_PI) \/ M_PI * 180;\r\n105c111\r\n&lt;   const gazebo::msgs::LaserScan &amp;scan = msg-&gt;scan();\r\n---\r\n&gt; \tint number_beams = scan.ranges_size();\r\n107,125c113\r\n&lt;   \/\/calculate start angle\r\n&lt;   int start_index = (scan.angle_min() + 2* M_PI) \/ M_PI * 180;\r\n&lt;   \r\n&lt;   int number_beams = scan.ranges_size();\r\n&lt; \r\n&lt;   *laser_time_ = clock-&gt;now();\r\n&lt;   \r\n&lt;   \/\/copy laser data\r\n&lt;   for(int i = 0; i &lt; number_beams; i++)\r\n&lt;   {\r\n&lt;     const float range = scan.ranges(i);\r\n&lt;     if(range &lt; max_range_)\r\n&lt;     {\r\n&lt;       laser_data_&#x5B;(start_index + i) % 360] = range; \r\n&lt;     }\r\n&lt;     else\r\n&lt;     {\r\n&lt;       laser_data_&#x5B;(start_index + i) % 360] = NAN;\r\n&lt;     }\r\n---\r\n&gt; \t*laser_time_ = clock-&gt;now();\r\n127,128c115,124\r\n&lt;   }\r\n&lt;   new_data_  = true;\r\n---\r\n&gt; \t\/\/copy laser data\r\n&gt; \tfor (int i = 0; i &lt; number_beams; i++) {\r\n&gt; \t\tconst float range = scan.ranges(i);\r\n&gt; \t\tif (range &lt; max_range_) {\r\n&gt; \t\t\tlaser_data_&#x5B;(start_index + i) % 360] = range;\r\n&gt; \t\t} else {\r\n&gt; \t\t\tlaser_data_&#x5B;(start_index + i) % 360] = NAN;\r\n&gt; \t\t}\r\n&gt; \t}\r\n&gt; \tnew_data_ = true;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-laser\/gazsim_laser_thread.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-laser\/gazsim_laser_thread.h\r\n21,22c21,22\r\n&lt; #ifndef __PLUGINS_GAZSIM_LASER_THREAD_H_\r\n&lt; #define __PLUGINS_GAZSIM_LASER_THREAD_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZSIM_LASER_THREAD_H_\r\n&gt; #define _PLUGINS_GAZSIM_LASER_THREAD_H_\r\n24c24,25\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n---\r\n&gt; #include &lt;aspect\/blackboard.h&gt;\r\n&gt; #include &lt;aspect\/blocked_timing.h&gt;\r\n28,29c29\r\n&lt; #include &lt;aspect\/blackboard.h&gt;\r\n&lt; #include &lt;aspect\/blocked_timing.h&gt;\r\n---\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n33d32\r\n&lt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n34a34\r\n&gt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n37d36\r\n&lt; \r\n39,50c38,48\r\n&lt;   class Laser360Interface;\r\n&lt;   class Time;\r\n&lt; }\r\n&lt; \r\n&lt; class LaserSimThread\r\n&lt; : public fawkes::Thread,\r\n&lt;   public fawkes::ClockAspect,\r\n&lt;   public fawkes::LoggingAspect,\r\n&lt;   public fawkes::ConfigurableAspect,\r\n&lt;   public fawkes::BlackBoardAspect,\r\n&lt;   public fawkes::BlockedTimingAspect,\r\n&lt;   public fawkes::GazeboAspect\r\n---\r\n&gt; class Laser360Interface;\r\n&gt; class Time;\r\n&gt; } \/\/ namespace fawkes\r\n&gt; \r\n&gt; class LaserSimThread : public fawkes::Thread,\r\n&gt;                        public fawkes::ClockAspect,\r\n&gt;                        public fawkes::LoggingAspect,\r\n&gt;                        public fawkes::ConfigurableAspect,\r\n&gt;                        public fawkes::BlackBoardAspect,\r\n&gt;                        public fawkes::BlockedTimingAspect,\r\n&gt;                        public fawkes::GazeboAspect\r\n52,53c50,51\r\n&lt;  public:\r\n&lt;   LaserSimThread();\r\n---\r\n&gt; public:\r\n&gt; \tLaserSimThread();\r\n55,57c53,55\r\n&lt;   virtual void init();\r\n&lt;   virtual void loop();\r\n&lt;   virtual void finalize();\r\n---\r\n&gt; \tvirtual void init();\r\n&gt; \tvirtual void loop();\r\n&gt; \tvirtual void finalize();\r\n59,62c57,60\r\n&lt;  private:\r\n&lt;   \/\/\/Subscriber to receive laser data from gazebo\r\n&lt;   gazebo::transport::SubscriberPtr laser_sub_;\r\n&lt;   std::string laser_topic_;\r\n---\r\n&gt; private:\r\n&gt; \t\/\/\/Subscriber to receive laser data from gazebo\r\n&gt; \tgazebo::transport::SubscriberPtr laser_sub_;\r\n&gt; \tstd::string                      laser_topic_;\r\n64,65c62,63\r\n&lt;   \/\/\/provided interface\r\n&lt;   fawkes::Laser360Interface *laser_if_;\r\n---\r\n&gt; \t\/\/\/provided interface\r\n&gt; \tfawkes::Laser360Interface *laser_if_;\r\n67,69c65,67\r\n&lt;   \/\/\/storage for laser data\r\n&lt;   float        *laser_data_;\r\n&lt;   fawkes::Time *laser_time_;\r\n---\r\n&gt; \t\/\/\/storage for laser data\r\n&gt; \tfloat *       laser_data_;\r\n&gt; \tfawkes::Time *laser_time_;\r\n71,72c69,70\r\n&lt;   \/\/\/is there new information to write in the interface?\r\n&lt;   bool new_data_;\r\n---\r\n&gt; \t\/\/\/is there new information to write in the interface?\r\n&gt; \tbool new_data_;\r\n74,75c72,73\r\n&lt;   \/\/\/handler function for incoming laser data messages\r\n&lt;   void on_laser_data_msg(ConstLaserScanStampedPtr &amp;msg);\r\n---\r\n&gt; \t\/\/\/handler function for incoming laser data messages\r\n&gt; \tvoid on_laser_data_msg(ConstLaserScanStampedPtr &amp;msg);\r\n77,78c75,76\r\n&lt;   \/\/\/maximal range of the laser sensor\r\n&lt;   float max_range_;  \r\n---\r\n&gt; \t\/\/\/maximal range of the laser sensor\r\n&gt; \tfloat max_range_;\r\n80,81c78,79\r\n&lt;   std::string interface_id_;\r\n&lt;   std::string frame_id_;\r\n---\r\n&gt; \tstd::string interface_id_;\r\n&gt; \tstd::string frame_id_;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-laser\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-laser\/Makefile\r\n31a32\r\n&gt; PLUGINS_all = $(PLUGINDIR)\/gazsim-laser.so\r\n39c40\r\n&lt;   PLUGINS_all = $(PLUGINDIR)\/gazsim-laser.so\r\n---\r\n&gt;   PLUGINS_build = $(PLUGINS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazebo-plugin\/gps.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazebo-plugin\/gps.cpp\r\n21,22d20\r\n&lt; #include &lt;math.h&gt;\r\n&lt; \r\n24a23,26\r\n&gt; #include &lt;utils\/misc\/gazebo_api_wrappers.h&gt;\r\n&gt; \r\n&gt; #include &lt;math.h&gt;\r\n&gt; \r\n37c39\r\n&lt;   printf(&quot;Destructing Gps Plugin!\\n&quot;);\r\n---\r\n&gt; \tprintf(&quot;Destructing Gps Plugin!\\n&quot;);\r\n43c45,46\r\n&lt; void Gps::Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/) \r\n---\r\n&gt; void\r\n&gt; Gps::Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/)\r\n45,46c48,49\r\n&lt;   \/\/ Store the pointer to the model\r\n&lt;   this-&gt;model_ = _parent;\r\n---\r\n&gt; \t\/\/ Store the pointer to the model\r\n&gt; \tthis-&gt;model_ = _parent;\r\n48,50c51,65\r\n&lt;   \/\/get the model-name\r\n&lt;   this-&gt;name_ = model_-&gt;GetName();\r\n&lt;   printf(&quot;Loading Gps Plugin of model %s\\n&quot;, name_.c_str());\r\n---\r\n&gt; \t\/\/get the model-name\r\n&gt; \tthis-&gt;name_ = model_-&gt;GetName();\r\n&gt; \tprintf(&quot;Loading Gps Plugin of model %s\\n&quot;, name_.c_str());\r\n&gt; \r\n&gt; \t\/\/ Listen to the update event. This event is broadcast every\r\n&gt; \t\/\/ simulation iteration.\r\n&gt; \tthis-&gt;update_connection_ =\r\n&gt; \t  event::Events::ConnectWorldUpdateBegin(boost::bind(&amp;Gps::OnUpdate, this, _1));\r\n&gt; \r\n&gt; \t\/\/Create the communication Node for communication with fawkes\r\n&gt; \tthis-&gt;node_ = transport::NodePtr(new transport::Node());\r\n&gt; \r\n&gt; \t\/\/set namespace to the model name &amp; init last sent time\r\n&gt; \tthis-&gt;node_-&gt;Init(model_-&gt;GetWorld()-&gt;GZWRAP_NAME() + &quot;\/&quot; + name_);\r\n&gt; \tlast_sent_time_ = model_-&gt;GetWorld()-&gt;GZWRAP_SIM_TIME().Double();\r\n52,65c67,68\r\n&lt;   \/\/ Listen to the update event. This event is broadcast every\r\n&lt;   \/\/ simulation iteration.\r\n&lt;   this-&gt;update_connection_ = event::Events::ConnectWorldUpdateBegin(boost::bind(&amp;Gps::OnUpdate, this, _1));\r\n&lt; \r\n&lt;   \/\/Create the communication Node for communication with fawkes\r\n&lt;   this-&gt;node_ = transport::NodePtr(new transport::Node());\r\n&lt;   \/\/the namespace is set to the model name!\r\n&lt;   this-&gt;node_-&gt;Init(model_-&gt;GetWorld()-&gt;GetName()+&quot;\/&quot;+name_);\r\n&lt; \r\n&lt;   \/\/init last sent time\r\n&lt;   last_sent_time_ = model_-&gt;GetWorld()-&gt;GetSimTime().Double();\r\n&lt; \r\n&lt;   \/\/create publisher\r\n&lt;   this-&gt;gps_pub_ = this-&gt;node_-&gt;Advertise&lt;msgs::Pose&gt;(&quot;~\/gazsim\/gps\/&quot;);\r\n---\r\n&gt; \t\/\/create publisher\r\n&gt; \tthis-&gt;gps_pub_ = this-&gt;node_-&gt;Advertise&lt;msgs::Pose&gt;(&quot;~\/gazsim\/gps\/&quot;);\r\n68d70\r\n&lt; \r\n71c73,74\r\n&lt; void Gps::OnUpdate(const common::UpdateInfo &amp; \/*_info*\/)\r\n---\r\n&gt; void\r\n&gt; Gps::OnUpdate(const common::UpdateInfo &amp; \/*_info*\/)\r\n73,79c76,82\r\n&lt;   \/\/Send position information to Fawkes\r\n&lt;   double time = model_-&gt;GetWorld()-&gt;GetSimTime().Double();\r\n&lt;   if(time - last_sent_time_ &gt; (1.0 \/ 10.0))\r\n&lt;   {\r\n&lt;     last_sent_time_ = time;\r\n&lt;     send_position();\r\n&lt;   }\r\n---\r\n&gt; \t\/\/Send position information to Fawkes\r\n&gt; \tdouble time = model_-&gt;GetWorld()-&gt;GZWRAP_SIM_TIME().Double();\r\n&gt; \r\n&gt; \tif (time - last_sent_time_ &gt; (1.0 \/ 10.0)) {\r\n&gt; \t\tlast_sent_time_ = time;\r\n&gt; \t\tsend_position();\r\n&gt; \t}\r\n84c87,88\r\n&lt; void Gps::Reset()\r\n---\r\n&gt; void\r\n&gt; Gps::Reset()\r\n91c95,96\r\n&lt; void Gps::send_position()\r\n---\r\n&gt; void\r\n&gt; Gps::send_position()\r\n93,107c98,111\r\n&lt;   if(gps_pub_-&gt;HasConnections())\r\n&lt;   {\r\n&lt;     \/\/build message\r\n&lt;     msgs::Pose posMsg;\r\n&lt;     posMsg.mutable_position()-&gt;set_x(this-&gt;model_-&gt;GetWorldPose().pos.x);\r\n&lt;     posMsg.mutable_position()-&gt;set_y(this-&gt;model_-&gt;GetWorldPose().pos.y);\r\n&lt;     posMsg.mutable_position()-&gt;set_z(this-&gt;model_-&gt;GetWorldPose().pos.z);\r\n&lt;     posMsg.mutable_orientation()-&gt;set_x(this-&gt;model_-&gt;GetWorldPose().rot.x);\r\n&lt;     posMsg.mutable_orientation()-&gt;set_y(this-&gt;model_-&gt;GetWorldPose().rot.y);\r\n&lt;     posMsg.mutable_orientation()-&gt;set_z(this-&gt;model_-&gt;GetWorldPose().rot.z);\r\n&lt;     posMsg.mutable_orientation()-&gt;set_w(this-&gt;model_-&gt;GetWorldPose().rot.w);\r\n&lt; \r\n&lt;     \/\/send\r\n&lt;     gps_pub_-&gt;Publish(posMsg);\r\n&lt;   }\r\n---\r\n&gt; \tif (gps_pub_-&gt;HasConnections()) {\r\n&gt; \t\t\/\/build message\r\n&gt; \t\tmsgs::Pose posMsg;\r\n&gt; \t\tposMsg.mutable_position()-&gt;set_x(this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_POS_X);\r\n&gt; \t\tposMsg.mutable_position()-&gt;set_y(this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_POS_Y);\r\n&gt; \t\tposMsg.mutable_position()-&gt;set_z(this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_POS_Z);\r\n&gt; \t\tposMsg.mutable_orientation()-&gt;set_x(this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_ROT_X);\r\n&gt; \t\tposMsg.mutable_orientation()-&gt;set_y(this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_ROT_Y);\r\n&gt; \t\tposMsg.mutable_orientation()-&gt;set_z(this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_ROT_Z);\r\n&gt; \t\tposMsg.mutable_orientation()-&gt;set_w(this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_ROT_W);\r\n&gt; \r\n&gt; \t\t\/\/send\r\n&gt; \t\tgps_pub_-&gt;Publish(posMsg);\r\n&gt; \t}\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazebo-plugin\/gps.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazebo-plugin\/gps.h\r\n21a22\r\n&gt; #include &lt;gazebo\/common\/common.hh&gt;\r\n24,25d24\r\n&lt; #include &lt;gazebo\/common\/common.hh&gt;\r\n&lt; #include &lt;stdio.h&gt;\r\n27a27\r\n&gt; #include &lt;stdio.h&gt;\r\n30,32c30,31\r\n&lt; namespace gazebo\r\n&lt; {\r\n&lt;   \/**\r\n---\r\n&gt; namespace gazebo {\r\n&gt; \/**\r\n36,67c35,66\r\n&lt;   class Gps : public ModelPlugin\r\n&lt;   {\r\n&lt;   public:\r\n&lt;     Gps();\r\n&lt;    ~Gps();\r\n&lt; \r\n&lt;     \/\/Overridden ModelPlugin-Functions\r\n&lt;     virtual void Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/);\r\n&lt;     virtual void OnUpdate(const common::UpdateInfo &amp;);\r\n&lt;     virtual void Reset();\r\n&lt; \r\n&lt;   private:\r\n&lt;     \/\/\/ Pointer to the gazbeo model\r\n&lt;     physics::ModelPtr model_;\r\n&lt;     \/\/\/ Pointer to the update event connection\r\n&lt;     event::ConnectionPtr update_connection_;\r\n&lt;     \/\/\/Node for communication to fawkes\r\n&lt;     transport::NodePtr node_;\r\n&lt;     \/\/\/name of the gps and the communication channel\r\n&lt;     std::string name_;\r\n&lt; \r\n&lt;     \/\/\/time variable to send in intervals\r\n&lt;     double last_sent_time_;\r\n&lt; \r\n&lt;     \/\/Gps Stuff:\r\n&lt;     \/\/\/Functions for sending information to fawkes:\r\n&lt;     void send_position();\r\n&lt; \r\n&lt;     \/\/\/Publisher for GyroAngle\r\n&lt;     transport::PublisherPtr gps_pub_;\r\n&lt;   };\r\n&lt; }\r\n---\r\n&gt; class Gps : public ModelPlugin\r\n&gt; {\r\n&gt; public:\r\n&gt; \tGps();\r\n&gt; \t~Gps();\r\n&gt; \r\n&gt; \t\/\/Overridden ModelPlugin-Functions\r\n&gt; \tvirtual void Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/);\r\n&gt; \tvirtual void OnUpdate(const common::UpdateInfo &amp;);\r\n&gt; \tvirtual void Reset();\r\n&gt; \r\n&gt; private:\r\n&gt; \t\/\/\/ Pointer to the gazbeo model\r\n&gt; \tphysics::ModelPtr model_;\r\n&gt; \t\/\/\/ Pointer to the update event connection\r\n&gt; \tevent::ConnectionPtr update_connection_;\r\n&gt; \t\/\/\/Node for communication to fawkes\r\n&gt; \ttransport::NodePtr node_;\r\n&gt; \t\/\/\/name of the gps and the communication channel\r\n&gt; \tstd::string name_;\r\n&gt; \r\n&gt; \t\/\/\/time variable to send in intervals\r\n&gt; \tdouble last_sent_time_;\r\n&gt; \r\n&gt; \t\/\/Gps Stuff:\r\n&gt; \t\/\/\/Functions for sending information to fawkes:\r\n&gt; \tvoid send_position();\r\n&gt; \r\n&gt; \t\/\/\/Publisher for GyroAngle\r\n&gt; \ttransport::PublisherPtr gps_pub_;\r\n&gt; };\r\n&gt; } \/\/ namespace gazebo\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazebo-plugin\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazebo-plugin\/Makefile\r\n26c26\r\n&lt; LIBS_gazebo_libgps = gazsim_msgs\r\n---\r\n&gt; LIBS_gazebo_libgps = m gazsim_msgs\r\n32c32,33\r\n&lt; OBJS_all    = $(OBJS_gazebo_libgps)\r\n---\r\n&gt; OBJS_all = $(OBJS_gazebo_libgps)\r\n&gt; LIBS_all = $(LIBDIR)\/gazebo\/libgps.so\r\n36c37,38\r\n&lt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) -lm $(call boost-libs-ldflags,system) -lboost_system\r\n---\r\n&gt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) \\\r\n&gt;              $(call boost-libs-ldflags,system)\r\n38c40\r\n&lt;   LIBS_all = $(LIBDIR)\/gazebo\/libgps.so\r\n---\r\n&gt;   LIBS_build = $(LIBS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazsim_localization_plugin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazsim_localization_plugin.cpp\r\n22,23d21\r\n&lt; #include &lt;core\/plugin.h&gt;\r\n&lt; \r\n25a24,25\r\n&gt; #include &lt;core\/plugin.h&gt;\r\n&gt; \r\n35,37c35,36\r\n&lt;  public:\r\n&lt; \r\n&lt;   \/** Constructor.\r\n---\r\n&gt; public:\r\n&gt; \t\/** Constructor.\r\n40,44c39,42\r\n&lt;   GazsimLocalizationPlugin(Configuration *config)\r\n&lt;     : Plugin(config)\r\n&lt;   {\r\n&lt;     thread_list.push_back(new LocalizationSimThread());\r\n&lt;   }\r\n---\r\n&gt; \texplicit GazsimLocalizationPlugin(Configuration *config) : Plugin(config)\r\n&gt; \t{\r\n&gt; \t\tthread_list.push_back(new LocalizationSimThread());\r\n&gt; \t}\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazsim_localization_thread.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazsim_localization_thread.cpp\r\n24,27c24\r\n&lt; #include &lt;tf\/types.h&gt;\r\n&lt; #include &lt;stdio.h&gt;\r\n&lt; #include &lt;math.h&gt;\r\n&lt; #include &lt;utils\/math\/angle.h&gt;\r\n---\r\n&gt; #include &lt;aspect\/logging.h&gt;\r\n29d25\r\n&lt; \r\n30a27,30\r\n&gt; #include &lt;tf\/transform_publisher.h&gt;\r\n&gt; #include &lt;tf\/types.h&gt;\r\n&gt; #include &lt;utils\/math\/angle.h&gt;\r\n&gt; #include &lt;utils\/time\/clock.h&gt;\r\n32d31\r\n&lt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n33a33\r\n&gt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n35,37c35,36\r\n&lt; #include &lt;aspect\/logging.h&gt;\r\n&lt; #include &lt;tf\/transform_publisher.h&gt;\r\n&lt; #include &lt;utils\/time\/clock.h&gt;\r\n---\r\n&gt; #include &lt;math.h&gt;\r\n&gt; #include &lt;stdio.h&gt;\r\n49,51c48,50\r\n&lt;   : Thread(&quot;LocalizationSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&lt;     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SENSOR_PROCESS),\r\n&lt;     TransformAspect(TransformAspect::BOTH, &quot;Pose&quot;)\r\n---\r\n&gt; : Thread(&quot;LocalizationSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&gt;   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SENSOR_PROCESS),\r\n&gt;   TransformAspect(TransformAspect::BOTH, &quot;Pose&quot;)\r\n55c54,55\r\n&lt; void LocalizationSimThread::init()\r\n---\r\n&gt; void\r\n&gt; LocalizationSimThread::init()\r\n57,60c57\r\n&lt;   logger-&gt;log_debug(name(), &quot;Initializing Simulation of the Localization&quot;);\r\n&lt; \r\n&lt;   \/\/open interface\r\n&lt;   localization_if_ = blackboard-&gt;open_for_writing&lt;Position3DInterface&gt;(&quot;Pose&quot;);\r\n---\r\n&gt; \tlogger-&gt;log_debug(name(), &quot;Initializing Simulation of the Localization&quot;);\r\n62,66c59,60\r\n&lt;   \/\/read cofig values\r\n&lt;   gps_topic_ = config-&gt;get_string(&quot;\/gazsim\/topics\/gps&quot;);\r\n&lt;   transform_tolerance_ = config-&gt;get_float(&quot;\/plugins\/amcl\/transform_tolerance&quot;);\r\n&lt;   global_frame_id_ = config-&gt;get_string(&quot;\/plugins\/amcl\/global_frame_id&quot;);\r\n&lt;   odom_frame_id_ = config-&gt;get_string(&quot;\/plugins\/amcl\/odom_frame_id&quot;);\r\n---\r\n&gt; \t\/\/open interface\r\n&gt; \tlocalization_if_ = blackboard-&gt;open_for_writing&lt;Position3DInterface&gt;(&quot;Pose&quot;);\r\n68,69c62,70\r\n&lt;   \/\/subscribing to gazebo publisher\r\n&lt;   localization_sub_ = gazebonode-&gt;Subscribe(gps_topic_, &amp;LocalizationSimThread::on_localization_msg, this);\r\n---\r\n&gt; \t\/\/read cofig values\r\n&gt; \tgps_topic_           = config-&gt;get_string(&quot;\/gazsim\/topics\/gps&quot;);\r\n&gt; \ttransform_tolerance_ = config-&gt;get_float(&quot;\/plugins\/amcl\/transform_tolerance&quot;);\r\n&gt; \tglobal_frame_id_     = config-&gt;get_string(&quot;\/plugins\/amcl\/global_frame_id&quot;);\r\n&gt; \todom_frame_id_       = config-&gt;get_string(&quot;\/plugins\/amcl\/odom_frame_id&quot;);\r\n&gt; \r\n&gt; \t\/\/subscribing to gazebo publisher\r\n&gt; \tlocalization_sub_ =\r\n&gt; \t  gazebonode-&gt;Subscribe(gps_topic_, &amp;LocalizationSimThread::on_localization_msg, this);\r\n71c72\r\n&lt;   new_data_ = false;\r\n---\r\n&gt; \tnew_data_ = false;\r\n74c75,76\r\n&lt; void LocalizationSimThread::finalize()\r\n---\r\n&gt; void\r\n&gt; LocalizationSimThread::finalize()\r\n76c78\r\n&lt;   blackboard-&gt;close(localization_if_);\r\n---\r\n&gt; \tblackboard-&gt;close(localization_if_);\r\n79c81,82\r\n&lt; void LocalizationSimThread::loop()\r\n---\r\n&gt; void\r\n&gt; LocalizationSimThread::loop()\r\n81,102c84,105\r\n&lt;   if(new_data_)\r\n&lt;   {\r\n&lt;     \/\/write interface\r\n&lt;     localization_if_-&gt;set_frame(global_frame_id_.c_str());\r\n&lt;     localization_if_-&gt;set_visibility_history(100);\r\n&lt;     localization_if_-&gt;set_translation(0, x_);\r\n&lt;     localization_if_-&gt;set_translation(1, y_);\r\n&lt;     localization_if_-&gt;set_translation(2, z_);\r\n&lt;     localization_if_-&gt;set_rotation(0, quat_x_);\r\n&lt;     localization_if_-&gt;set_rotation(1, quat_y_);\r\n&lt;     localization_if_-&gt;set_rotation(2, quat_z_);\r\n&lt;     localization_if_-&gt;set_rotation(3, quat_w_);\r\n&lt;     localization_if_-&gt;write();\r\n&lt; \r\n&lt;     \/\/publish transform (similar as in amcl_thread.cpp)\r\n&lt;     tf::Quaternion rotation = tf::Quaternion(quat_x_, quat_y_, quat_z_, quat_w_);\r\n&lt;     tf::Point position = tf::Point(x_, y_, z_);\r\n&lt;     tf::Transform latest_tf_ = tf::Transform(rotation,position);\r\n&lt;     Time transform_expiration =\r\n&lt;       (clock-&gt;now() + transform_tolerance_);\r\n&lt;     tf_publisher-&gt;send_transform(latest_tf_, transform_expiration,\r\n&lt; \t\t\t\t global_frame_id_, odom_frame_id_);\r\n---\r\n&gt; \tif (new_data_) {\r\n&gt; \t\t\/\/write interface\r\n&gt; \t\tlocalization_if_-&gt;set_frame(global_frame_id_.c_str());\r\n&gt; \t\tlocalization_if_-&gt;set_visibility_history(100);\r\n&gt; \t\tlocalization_if_-&gt;set_translation(0, x_);\r\n&gt; \t\tlocalization_if_-&gt;set_translation(1, y_);\r\n&gt; \t\tlocalization_if_-&gt;set_translation(2, z_);\r\n&gt; \t\tlocalization_if_-&gt;set_rotation(0, quat_x_);\r\n&gt; \t\tlocalization_if_-&gt;set_rotation(1, quat_y_);\r\n&gt; \t\tlocalization_if_-&gt;set_rotation(2, quat_z_);\r\n&gt; \t\tlocalization_if_-&gt;set_rotation(3, quat_w_);\r\n&gt; \t\tlocalization_if_-&gt;write();\r\n&gt; \r\n&gt; \t\t\/\/publish transform (similar as in amcl_thread.cpp)\r\n&gt; \t\ttf::Quaternion rotation             = tf::Quaternion(quat_x_, quat_y_, quat_z_, quat_w_);\r\n&gt; \t\ttf::Point      position             = tf::Point(x_, y_, z_);\r\n&gt; \t\ttf::Transform  latest_tf_           = tf::Transform(rotation, position);\r\n&gt; \t\tTime           transform_expiration = (clock-&gt;now() + transform_tolerance_);\r\n&gt; \t\ttf_publisher-&gt;send_transform(latest_tf_,\r\n&gt; \t\t                             transform_expiration,\r\n&gt; \t\t                             global_frame_id_,\r\n&gt; \t\t                             odom_frame_id_);\r\n104,105c107,108\r\n&lt;     new_data_ = false;\r\n&lt;   }\r\n---\r\n&gt; \t\tnew_data_ = false;\r\n&gt; \t}\r\n108c111,112\r\n&lt; void LocalizationSimThread::on_localization_msg(ConstPosePtr &amp;msg)\r\n---\r\n&gt; void\r\n&gt; LocalizationSimThread::on_localization_msg(ConstPosePtr &amp;msg)\r\n110,123c114,127\r\n&lt;   \/\/logger-&gt;log_info(name(), &quot;Got new Localization data.\\n&quot;);\r\n&lt;   \r\n&lt;   MutexLocker lock(loop_mutex);\r\n&lt; \r\n&lt;   \/\/read data from message\r\n&lt;   x_ = msg-&gt;position().x();\r\n&lt;   y_ = msg-&gt;position().y();\r\n&lt;   z_ = msg-&gt;position().z();\r\n&lt;   quat_x_ = msg-&gt;orientation().x();\r\n&lt;   quat_y_ = msg-&gt;orientation().y();\r\n&lt;   quat_z_ = msg-&gt;orientation().z();\r\n&lt;   quat_w_ = msg-&gt;orientation().w();\r\n&lt;   \r\n&lt;   new_data_ = true;\r\n---\r\n&gt; \t\/\/logger-&gt;log_info(name(), &quot;Got new Localization data.\\n&quot;);\r\n&gt; \r\n&gt; \tMutexLocker lock(loop_mutex);\r\n&gt; \r\n&gt; \t\/\/read data from message\r\n&gt; \tx_      = msg-&gt;position().x();\r\n&gt; \ty_      = msg-&gt;position().y();\r\n&gt; \tz_      = msg-&gt;position().z();\r\n&gt; \tquat_x_ = msg-&gt;orientation().x();\r\n&gt; \tquat_y_ = msg-&gt;orientation().y();\r\n&gt; \tquat_z_ = msg-&gt;orientation().z();\r\n&gt; \tquat_w_ = msg-&gt;orientation().w();\r\n&gt; \r\n&gt; \tnew_data_ = true;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazsim_localization_thread.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/gazsim_localization_thread.h\r\n22,23c22,23\r\n&lt; #ifndef __PLUGINS_GAZSIM_LOCALIZATION_THREAD_H_\r\n&lt; #define __PLUGINS_GAZSIM_LOCALIZATION_THREAD_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZSIM_LOCALIZATION_THREAD_H_\r\n&gt; #define _PLUGINS_GAZSIM_LOCALIZATION_THREAD_H_\r\n25c25,26\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n---\r\n&gt; #include &lt;aspect\/blackboard.h&gt;\r\n&gt; #include &lt;aspect\/blocked_timing.h&gt;\r\n29,30d29\r\n&lt; #include &lt;aspect\/blackboard.h&gt;\r\n&lt; #include &lt;aspect\/blocked_timing.h&gt;\r\n31a31\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n35d34\r\n&lt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n36a36\r\n&gt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n39d38\r\n&lt; \r\n41c40\r\n&lt;   class Position3DInterface;\r\n---\r\n&gt; class Position3DInterface;\r\n44,52c43,50\r\n&lt; class LocalizationSimThread\r\n&lt; : public fawkes::Thread,\r\n&lt;   public fawkes::ClockAspect,\r\n&lt;   public fawkes::LoggingAspect,\r\n&lt;   public fawkes::ConfigurableAspect,\r\n&lt;   public fawkes::BlackBoardAspect,\r\n&lt;   public fawkes::BlockedTimingAspect,\r\n&lt;   public fawkes::GazeboAspect,\r\n&lt;   public fawkes::TransformAspect\r\n---\r\n&gt; class LocalizationSimThread : public fawkes::Thread,\r\n&gt;                               public fawkes::ClockAspect,\r\n&gt;                               public fawkes::LoggingAspect,\r\n&gt;                               public fawkes::ConfigurableAspect,\r\n&gt;                               public fawkes::BlackBoardAspect,\r\n&gt;                               public fawkes::BlockedTimingAspect,\r\n&gt;                               public fawkes::GazeboAspect,\r\n&gt;                               public fawkes::TransformAspect\r\n54,55c52,53\r\n&lt;  public:\r\n&lt;   LocalizationSimThread();\r\n---\r\n&gt; public:\r\n&gt; \tLocalizationSimThread();\r\n57,89c55,87\r\n&lt;   virtual void init();\r\n&lt;   virtual void loop();\r\n&lt;   virtual void finalize();\r\n&lt; \r\n&lt;  private:\r\n&lt;   \/\/Subscriber to receive localization data from gazebo\r\n&lt;   gazebo::transport::SubscriberPtr localization_sub_;\r\n&lt;   std::string gps_topic_;\r\n&lt; \r\n&lt;   \/\/provided interface\r\n&lt;   fawkes::Position3DInterface *localization_if_;\r\n&lt; \r\n&lt;   \/\/handler function for incoming localization data messages\r\n&lt;   void on_localization_msg(ConstPosePtr &amp;msg);\r\n&lt; \r\n&lt;   \/\/is there new information to write in the interface?\r\n&lt;   bool new_data_;\r\n&lt; \r\n&lt;   \/\/localization data\r\n&lt;   double x_;\r\n&lt;   double y_;\r\n&lt;   double z_;\r\n&lt;   double quat_x_;\r\n&lt;   double quat_y_;\r\n&lt;   double quat_z_;\r\n&lt;   double quat_w_;\r\n&lt; \r\n&lt;   \/\/time the transform should be up to date\r\n&lt;   double transform_tolerance_;\r\n&lt; \r\n&lt;   \/\/frame ids for transform\r\n&lt;   std::string odom_frame_id_;\r\n&lt;   std::string global_frame_id_;\r\n---\r\n&gt; \tvirtual void init();\r\n&gt; \tvirtual void loop();\r\n&gt; \tvirtual void finalize();\r\n&gt; \r\n&gt; private:\r\n&gt; \t\/\/Subscriber to receive localization data from gazebo\r\n&gt; \tgazebo::transport::SubscriberPtr localization_sub_;\r\n&gt; \tstd::string                      gps_topic_;\r\n&gt; \r\n&gt; \t\/\/provided interface\r\n&gt; \tfawkes::Position3DInterface *localization_if_;\r\n&gt; \r\n&gt; \t\/\/handler function for incoming localization data messages\r\n&gt; \tvoid on_localization_msg(ConstPosePtr &amp;msg);\r\n&gt; \r\n&gt; \t\/\/is there new information to write in the interface?\r\n&gt; \tbool new_data_;\r\n&gt; \r\n&gt; \t\/\/localization data\r\n&gt; \tdouble x_;\r\n&gt; \tdouble y_;\r\n&gt; \tdouble z_;\r\n&gt; \tdouble quat_x_;\r\n&gt; \tdouble quat_y_;\r\n&gt; \tdouble quat_z_;\r\n&gt; \tdouble quat_w_;\r\n&gt; \r\n&gt; \t\/\/time the transform should be up to date\r\n&gt; \tdouble transform_tolerance_;\r\n&gt; \r\n&gt; \t\/\/frame ids for transform\r\n&gt; \tstd::string odom_frame_id_;\r\n&gt; \tstd::string global_frame_id_;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-localization\/Makefile\r\n33a34\r\n&gt; PLUGINS_all = $(PLUGINDIR)\/gazsim-localization.so\r\n41c42\r\n&lt;   PLUGINS_all = $(PLUGINDIR)\/gazsim-localization.so\r\n---\r\n&gt;   PLUGINS_build = $(PLUGINS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-gyro\/gyro.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-gyro\/gyro.cpp\r\n21,22d20\r\n&lt; #include &lt;math.h&gt;\r\n&lt; \r\n24a23,26\r\n&gt; #include &lt;utils\/misc\/gazebo_api_wrappers.h&gt;\r\n&gt; \r\n&gt; #include &lt;math.h&gt;\r\n&gt; \r\n30c32\r\n&lt; Gyro::Gyro()\r\n---\r\n&gt; Gyro::Gyro() : last_sent_time_(0.0), send_interval_(0.0)\r\n36c38\r\n&lt;   printf(&quot;Destructing Gyro Plugin!\\n&quot;);\r\n---\r\n&gt; \tprintf(&quot;Destructing Gyro Plugin!\\n&quot;);\r\n42c44,45\r\n&lt; void Gyro::Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/) \r\n---\r\n&gt; void\r\n&gt; Gyro::Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/)\r\n44,62c47,48\r\n&lt;   \/\/ Store the pointer to the model\r\n&lt;   this-&gt;model_ = _parent;\r\n&lt; \r\n&lt;   \/\/get the model-name\r\n&lt;   this-&gt;name_ = model_-&gt;GetName();\r\n&lt;   printf(&quot;Loading Gyro Plugin of model %s\\n&quot;, name_.c_str());\r\n&lt; \r\n&lt;   \/\/ Listen to the update event. This event is broadcast every\r\n&lt;   \/\/ simulation iteration.\r\n&lt;   this-&gt;update_connection_ = event::Events::ConnectWorldUpdateBegin(boost::bind(&amp;Gyro::OnUpdate, this, _1));\r\n&lt; \r\n&lt;   \/\/Create the communication Node for communication with fawkes\r\n&lt;   this-&gt;node_ = transport::NodePtr(new transport::Node());\r\n&lt;   \/\/the namespace is set to the model name!\r\n&lt;   this-&gt;node_-&gt;Init(model_-&gt;GetWorld()-&gt;GetName()+&quot;\/&quot;+name_);\r\n&lt; \r\n&lt; \r\n&lt;   \/\/create publisher\r\n&lt;   this-&gt;gyro_pub_ = this-&gt;node_-&gt;Advertise&lt;msgs::Vector3d&gt;(&quot;~\/RobotinoSim\/Gyro\/&quot;);\r\n---\r\n&gt; \t\/\/ Store the pointer to the model\r\n&gt; \tthis-&gt;model_ = _parent;\r\n64,66c50,69\r\n&lt;   \/\/init last sent time\r\n&lt;   last_sent_time_ = model_-&gt;GetWorld()-&gt;GetSimTime().Double();\r\n&lt;   this-&gt;send_interval_ = 0.05;\r\n---\r\n&gt; \t\/\/get the model-name\r\n&gt; \tthis-&gt;name_ = model_-&gt;GetName();\r\n&gt; \tprintf(&quot;Loading Gyro Plugin of model %s\\n&quot;, name_.c_str());\r\n&gt; \r\n&gt; \t\/\/ Listen to the update event. This event is broadcast every\r\n&gt; \t\/\/ simulation iteration.\r\n&gt; \tthis-&gt;update_connection_ =\r\n&gt; \t  event::Events::ConnectWorldUpdateBegin(boost::bind(&amp;Gyro::OnUpdate, this, _1));\r\n&gt; \r\n&gt; \t\/\/Create the communication Node for communication with fawkes\r\n&gt; \tthis-&gt;node_ = transport::NodePtr(new transport::Node());\r\n&gt; \t\/\/the namespace is set to the model name!\r\n&gt; \tthis-&gt;node_-&gt;Init(model_-&gt;GetWorld()-&gt;GZWRAP_NAME() + &quot;\/&quot; + name_);\r\n&gt; \r\n&gt; \t\/\/create publisher\r\n&gt; \tthis-&gt;gyro_pub_ = this-&gt;node_-&gt;Advertise&lt;msgs::Vector3d&gt;(&quot;~\/RobotinoSim\/Gyro\/&quot;);\r\n&gt; \r\n&gt; \t\/\/init last sent time\r\n&gt; \tlast_sent_time_      = model_-&gt;GetWorld()-&gt;GZWRAP_SIM_TIME().Double();\r\n&gt; \tthis-&gt;send_interval_ = 0.05;\r\n71c74,75\r\n&lt; void Gyro::OnUpdate(const common::UpdateInfo &amp; \/*_info*\/)\r\n---\r\n&gt; void\r\n&gt; Gyro::OnUpdate(const common::UpdateInfo &amp; \/*_info*\/)\r\n73,79c77,82\r\n&lt;   \/\/Send gyro information to Fawkes\r\n&lt;   double time = model_-&gt;GetWorld()-&gt;GetSimTime().Double();\r\n&lt;   if(time - last_sent_time_ &gt; send_interval_)\r\n&lt;   {\r\n&lt;     last_sent_time_ = time;\r\n&lt;     send_gyro();\r\n&lt;   }\r\n---\r\n&gt; \t\/\/Send gyro information to Fawkes\r\n&gt; \tdouble time = model_-&gt;GetWorld()-&gt;GZWRAP_SIM_TIME().Double();\r\n&gt; \tif (time - last_sent_time_ &gt; send_interval_) {\r\n&gt; \t\tlast_sent_time_ = time;\r\n&gt; \t\tsend_gyro();\r\n&gt; \t}\r\n84c87,88\r\n&lt; void Gyro::Reset()\r\n---\r\n&gt; void\r\n&gt; Gyro::Reset()\r\n88c92,93\r\n&lt; void Gyro::send_gyro()\r\n---\r\n&gt; void\r\n&gt; Gyro::send_gyro()\r\n90,105c95,109\r\n&lt;   if(gyro_pub_-&gt;HasConnections())\r\n&lt;   {\r\n&lt;     \/\/Read gyro from simulation\r\n&lt;     float roll = this-&gt;model_-&gt;GetWorldPose().rot.GetAsEuler().x;\r\n&lt;     float pitch = this-&gt;model_-&gt;GetWorldPose().rot.GetAsEuler().y;\r\n&lt;     float yaw = this-&gt;model_-&gt;GetWorldPose().rot.GetAsEuler().z;\r\n&lt; \r\n&lt;     \/\/build message\r\n&lt;     msgs::Vector3d gyroMsg;\r\n&lt;     gyroMsg.set_x(roll);\r\n&lt;     gyroMsg.set_y(pitch);\r\n&lt;     gyroMsg.set_z(yaw);\r\n&lt; \r\n&lt;     \/\/send\r\n&lt;     gyro_pub_-&gt;Publish(gyroMsg);\r\n&lt;   }\r\n---\r\n&gt; \tif (gyro_pub_-&gt;HasConnections()) {\r\n&gt; \t\t\/\/Read gyro from simulation\r\n&gt; \t\tfloat roll  = this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_ROT_EULER_X;\r\n&gt; \t\tfloat pitch = this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_ROT_EULER_Y;\r\n&gt; \t\tfloat yaw   = this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_ROT_EULER_Z;\r\n&gt; \r\n&gt; \t\t\/\/build message\r\n&gt; \t\tmsgs::Vector3d gyroMsg;\r\n&gt; \t\tgyroMsg.set_x(roll);\r\n&gt; \t\tgyroMsg.set_y(pitch);\r\n&gt; \t\tgyroMsg.set_z(yaw);\r\n&gt; \r\n&gt; \t\t\/\/send\r\n&gt; \t\tgyro_pub_-&gt;Publish(gyroMsg);\r\n&gt; \t}\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-gyro\/gyro.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-gyro\/gyro.h\r\n21a22\r\n&gt; #include &lt;gazebo\/common\/common.hh&gt;\r\n24,25d24\r\n&lt; #include &lt;gazebo\/common\/common.hh&gt;\r\n&lt; #include &lt;stdio.h&gt;\r\n27a27\r\n&gt; #include &lt;stdio.h&gt;\r\n30,32c30,31\r\n&lt; namespace gazebo\r\n&lt; {   \r\n&lt;   \/** @class Gyro\r\n---\r\n&gt; namespace gazebo {\r\n&gt; \/** @class Gyro\r\n36,74c35,72\r\n&lt;   class Gyro : public ModelPlugin\r\n&lt;   {\r\n&lt;   public:\r\n&lt;     \/\/\/Constructor\r\n&lt;     Gyro();\r\n&lt; \r\n&lt;     \/\/\/Destructor\r\n&lt;     ~Gyro();\r\n&lt; \r\n&lt;     \/\/Overridden ModelPlugin-Functions\r\n&lt;     virtual void Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/);\r\n&lt;     virtual void OnUpdate(const common::UpdateInfo &amp;);\r\n&lt;     virtual void Reset();\r\n&lt; \r\n&lt;   private:\r\n&lt;     \/\/\/ Pointer to the model\r\n&lt;     physics::ModelPtr model_;\r\n&lt;     \/\/\/ Pointer to the update event connection\r\n&lt;     event::ConnectionPtr update_connection_;\r\n&lt;     \/\/\/Node for communication to fawkes\r\n&lt;     transport::NodePtr node_;\r\n&lt;     \/\/\/name of the gyro and the communication channel\r\n&lt;     std::string name_;\r\n&lt; \r\n&lt;     \/\/\/time variable to send in intervals\r\n&lt;     double last_sent_time_;\r\n&lt; \r\n&lt;     \/\/\/time interval between to gyro msgs\r\n&lt;     double send_interval_;\r\n&lt; \r\n&lt; \r\n&lt;     \/\/Gyro Stuff:\r\n&lt;     \/\/\/Sending Gyro-angle to fawkes:\r\n&lt;     void send_gyro();\r\n&lt; \r\n&lt;     \/\/\/Publisher for GyroAngle\r\n&lt;     transport::PublisherPtr gyro_pub_;  \r\n&lt;   };\r\n&lt; }\r\n---\r\n&gt; class Gyro : public ModelPlugin\r\n&gt; {\r\n&gt; public:\r\n&gt; \t\/\/\/Constructor\r\n&gt; \tGyro();\r\n&gt; \r\n&gt; \t\/\/\/Destructor\r\n&gt; \t~Gyro();\r\n&gt; \r\n&gt; \t\/\/Overridden ModelPlugin-Functions\r\n&gt; \tvirtual void Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/);\r\n&gt; \tvirtual void OnUpdate(const common::UpdateInfo &amp;);\r\n&gt; \tvirtual void Reset();\r\n&gt; \r\n&gt; private:\r\n&gt; \t\/\/\/ Pointer to the model\r\n&gt; \tphysics::ModelPtr model_;\r\n&gt; \t\/\/\/ Pointer to the update event connection\r\n&gt; \tevent::ConnectionPtr update_connection_;\r\n&gt; \t\/\/\/Node for communication to fawkes\r\n&gt; \ttransport::NodePtr node_;\r\n&gt; \t\/\/\/name of the gyro and the communication channel\r\n&gt; \tstd::string name_;\r\n&gt; \r\n&gt; \t\/\/\/time variable to send in intervals\r\n&gt; \tdouble last_sent_time_;\r\n&gt; \r\n&gt; \t\/\/\/time interval between to gyro msgs\r\n&gt; \tdouble send_interval_;\r\n&gt; \r\n&gt; \t\/\/Gyro Stuff:\r\n&gt; \t\/\/\/Sending Gyro-angle to fawkes:\r\n&gt; \tvoid send_gyro();\r\n&gt; \r\n&gt; \t\/\/\/Publisher for GyroAngle\r\n&gt; \ttransport::PublisherPtr gyro_pub_;\r\n&gt; };\r\n&gt; } \/\/ namespace gazebo\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-gyro\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-gyro\/Makefile\r\n26c26\r\n&lt; LIBS_gazebo_libgyro = gazsim_msgs\r\n---\r\n&gt; LIBS_gazebo_libgyro = m gazsim_msgs\r\n32c32,33\r\n&lt; OBJS_all    = $(OBJS_gazebo_libgyro)\r\n---\r\n&gt; OBJS_all = $(OBJS_gazebo_libgyro)\r\n&gt; LIBS_all = $(LIBDIR)\/gazebo\/libgyro.so\r\n36c37,38\r\n&lt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) -lm $(call boost-libs-ldflags,system) -lboost_system\r\n---\r\n&gt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) \\\r\n&gt;              $(call boost-libs-ldflags,system)\r\n38c40\r\n&lt;   LIBS_all = $(LIBDIR)\/gazebo\/libgyro.so\r\n---\r\n&gt;   LIBS_build = $(LIBS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-motor\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-motor\/Makefile\r\n26c26\r\n&lt; LIBS_gazebo_libmotor = gazsim_msgs\r\n---\r\n&gt; LIBS_gazebo_libmotor = m gazsim_msgs\r\n32c32,33\r\n&lt; OBJS_all    = $(OBJS_gazebo_libmotor)\r\n---\r\n&gt; OBJS_all = $(OBJS_gazebo_libmotor)\r\n&gt; LIBS_all = $(LIBDIR)\/gazebo\/libmotor.so\r\n36c37,38\r\n&lt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) -lm $(call boost-libs-ldflags,system) -lboost_system\r\n---\r\n&gt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) \\\r\n&gt;              $(call boost-libs-ldflags,system)\r\n38c40\r\n&lt;   LIBS_all = $(LIBDIR)\/gazebo\/libmotor.so\r\n---\r\n&gt;   LIBS_build = $(LIBS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-motor\/motor.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-motor\/motor.cpp\r\n21,22d20\r\n&lt; #include &lt;math.h&gt;\r\n&lt; \r\n24a23,26\r\n&gt; #include &lt;utils\/misc\/gazebo_api_wrappers.h&gt;\r\n&gt; \r\n&gt; #include &lt;math.h&gt;\r\n&gt; \r\n30c32\r\n&lt; Motor::Motor()\r\n---\r\n&gt; Motor::Motor() : vx_(0), vy_(0), vomega_(0)\r\n36c38\r\n&lt;   printf(&quot;Destructing Motor Plugin!\\n&quot;);\r\n---\r\n&gt; \tprintf(&quot;Destructing Motor Plugin!\\n&quot;);\r\n42c44,45\r\n&lt; void Motor::Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/) \r\n---\r\n&gt; void\r\n&gt; Motor::Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/)\r\n44,49c47,48\r\n&lt;   \/\/ Store the pointer to the model\r\n&lt;   this-&gt;model_ = _parent;\r\n&lt; \r\n&lt;   \/\/get the model-name\r\n&lt;   this-&gt;name_ = model_-&gt;GetName();\r\n&lt;   printf(&quot;Loading Motor Plugin of model %s\\n&quot;, name_.c_str());\r\n---\r\n&gt; \t\/\/ Store the pointer to the model\r\n&gt; \tthis-&gt;model_ = _parent;\r\n51,67c50,72\r\n&lt;   \/\/ Listen to the update event. This event is broadcast every\r\n&lt;   \/\/ simulation iteration.\r\n&lt;   this-&gt;update_connection_ = event::Events::ConnectWorldUpdateBegin(boost::bind(&amp;Motor::OnUpdate, this, _1));\r\n&lt; \r\n&lt;   \/\/Create the communication Node for communication with fawkes\r\n&lt;   this-&gt;node_ = transport::NodePtr(new transport::Node());\r\n&lt;   \/\/the namespace is set to the model name!\r\n&lt;   this-&gt;node_-&gt;Init(model_-&gt;GetWorld()-&gt;GetName()+&quot;\/&quot;+name_);\r\n&lt; \r\n&lt; \r\n&lt;   \/\/initialize movement commands:\r\n&lt;   vx_ = 0.0;\r\n&lt;   vy_ = 0.0;\r\n&lt;   vomega_ = 0.0;\r\n&lt; \r\n&lt;   \/\/create subscriber\r\n&lt;   this-&gt;motor_move_sub_ = this-&gt;node_-&gt;Subscribe(std::string(&quot;~\/RobotinoSim\/MotorMove\/&quot;), &amp;Motor::on_motor_move_msg, this);\r\n---\r\n&gt; \t\/\/get the model-name\r\n&gt; \tthis-&gt;name_ = model_-&gt;GetName();\r\n&gt; \tprintf(&quot;Loading Motor Plugin of model %s\\n&quot;, name_.c_str());\r\n&gt; \r\n&gt; \t\/\/ Listen to the update event. This event is broadcast every\r\n&gt; \t\/\/ simulation iteration.\r\n&gt; \tthis-&gt;update_connection_ =\r\n&gt; \t  event::Events::ConnectWorldUpdateBegin(boost::bind(&amp;Motor::OnUpdate, this, _1));\r\n&gt; \r\n&gt; \t\/\/Create the communication Node for communication with fawkes\r\n&gt; \tthis-&gt;node_ = transport::NodePtr(new transport::Node());\r\n&gt; \t\/\/the namespace is set to the model name!\r\n&gt; \tthis-&gt;node_-&gt;Init(model_-&gt;GetWorld()-&gt;GZWRAP_NAME() + &quot;\/&quot; + name_);\r\n&gt; \r\n&gt; \t\/\/initialize movement commands:\r\n&gt; \tvx_     = 0.0;\r\n&gt; \tvy_     = 0.0;\r\n&gt; \tvomega_ = 0.0;\r\n&gt; \r\n&gt; \t\/\/create subscriber\r\n&gt; \tthis-&gt;motor_move_sub_ = this-&gt;node_-&gt;Subscribe(std::string(&quot;~\/RobotinoSim\/MotorMove\/&quot;),\r\n&gt; \t                                               &amp;Motor::on_motor_move_msg,\r\n&gt; \t                                               this);\r\n72c77,78\r\n&lt; void Motor::OnUpdate(const common::UpdateInfo &amp; \/*_info*\/)\r\n---\r\n&gt; void\r\n&gt; Motor::OnUpdate(const common::UpdateInfo &amp; \/*_info*\/)\r\n74,85c80,91\r\n&lt;   \/\/Apply movement command\r\n&lt;   float x,y;\r\n&lt;   float yaw = this-&gt;model_-&gt;GetWorldPose().rot.GetAsEuler().z;\r\n&lt;   \/\/foward part\r\n&lt;   x = cos(yaw) * vx_;\r\n&lt;   y = sin(yaw) * vx_;\r\n&lt;   \/\/sideways part\r\n&lt;   x += cos(yaw + 3.1415926f \/ 2) * vy_;\r\n&lt;   y += sin(yaw + 3.1415926f \/ 2) * vy_;\r\n&lt;   \/\/ Apply velocity to the model.\r\n&lt;   this-&gt;model_-&gt;SetLinearVel(math::Vector3(x, y, 0));\r\n&lt;   this-&gt;model_-&gt;SetAngularVel(math::Vector3(0, 0, vomega_));\r\n---\r\n&gt; \t\/\/Apply movement command\r\n&gt; \tfloat x, y;\r\n&gt; \tfloat yaw = this-&gt;model_-&gt;GZWRAP_WORLD_POSE().GZWRAP_ROT_EULER_Z;\r\n&gt; \t\/\/foward part\r\n&gt; \tx = cos(yaw) * vx_;\r\n&gt; \ty = sin(yaw) * vx_;\r\n&gt; \t\/\/sideways part\r\n&gt; \tx += cos(yaw + 3.1415926f \/ 2) * vy_;\r\n&gt; \ty += sin(yaw + 3.1415926f \/ 2) * vy_;\r\n&gt; \t\/\/ Apply velocity to the model.\r\n&gt; \tthis-&gt;model_-&gt;SetLinearVel(gzwrap::Vector3d(x, y, 0));\r\n&gt; \tthis-&gt;model_-&gt;SetAngularVel(gzwrap::Vector3d(0, 0, vomega_));\r\n90c96,97\r\n&lt; void Motor::Reset()\r\n---\r\n&gt; void\r\n&gt; Motor::Reset()\r\n96,97c103,105\r\n&lt;  *\/ \r\n&lt; void Motor::on_motor_move_msg(ConstVector3dPtr &amp;msg)\r\n---\r\n&gt;  *\/\r\n&gt; void\r\n&gt; Motor::on_motor_move_msg(ConstVector3dPtr &amp;msg)\r\n99,103c107,111\r\n&lt;   \/\/printf(&quot;Got MotorMove Msg!!! %f %f %f\\n&quot;, msg-&gt;x(), msg-&gt;y(), msg-&gt;z());\r\n&lt;   \/\/Transform relative motion into ablosulte motion\r\n&lt;   vx_ = msg-&gt;x();\r\n&lt;   vy_ = msg-&gt;y();\r\n&lt;   vomega_ = msg-&gt;z();\r\n---\r\n&gt; \t\/\/printf(&quot;Got MotorMove Msg!!! %f %f %f\\n&quot;, msg-&gt;x(), msg-&gt;y(), msg-&gt;z());\r\n&gt; \t\/\/Transform relative motion into ablosulte motion\r\n&gt; \tvx_     = msg-&gt;x();\r\n&gt; \tvy_     = msg-&gt;y();\r\n&gt; \tvomega_ = msg-&gt;z();\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-motor\/motor.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazebo-plugin-motor\/motor.h\r\n21a22\r\n&gt; #include &lt;gazebo\/common\/common.hh&gt;\r\n24,25d24\r\n&lt; #include &lt;gazebo\/common\/common.hh&gt;\r\n&lt; #include &lt;stdio.h&gt;\r\n27a27\r\n&gt; #include &lt;stdio.h&gt;\r\n30,32c30,31\r\n&lt; namespace gazebo\r\n&lt; {   \r\n&lt;   \/** @class Motor\r\n---\r\n&gt; namespace gazebo {\r\n&gt; \/** @class Motor\r\n36,73c35,70\r\n&lt;   class Motor : public ModelPlugin\r\n&lt;   {\r\n&lt;   public:\r\n&lt;     \/\/\/Constructor\r\n&lt;     Motor();\r\n&lt; \r\n&lt;     \/\/\/Destructor\r\n&lt;     ~Motor();\r\n&lt; \r\n&lt;     \/\/Overridden ModelPlugin-Functions\r\n&lt;     virtual void Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/);\r\n&lt;     virtual void OnUpdate(const common::UpdateInfo &amp;);\r\n&lt;     virtual void Reset();\r\n&lt; \r\n&lt;   private:\r\n&lt;     \/\/\/ Pointer to the Gazebo model\r\n&lt;     physics::ModelPtr model_;\r\n&lt;     \/\/\/ Pointer to the update event connection\r\n&lt;     event::ConnectionPtr update_connection_;\r\n&lt;     \/\/\/Node for communication to fawkes\r\n&lt;     transport::NodePtr node_;\r\n&lt;     \/\/\/name of the motor and the communication channel\r\n&lt;     std::string name_;\r\n&lt; \r\n&lt; \r\n&lt;     \/\/Motor Stuff:\r\n&lt;     void on_motor_move_msg(ConstVector3dPtr &amp;msg);\r\n&lt; \r\n&lt;     \/\/\/Suscriber for MotorMove Interfaces from Fawkes\r\n&lt;     transport::SubscriberPtr motor_move_sub_;\r\n&lt; \r\n&lt; \r\n&lt;     \/\/current movement commands:\r\n&lt;     float vx_;\r\n&lt;     float vy_;\r\n&lt;     float vomega_;  \r\n&lt;   };\r\n&lt; }\r\n---\r\n&gt; class Motor : public ModelPlugin\r\n&gt; {\r\n&gt; public:\r\n&gt; \t\/\/\/Constructor\r\n&gt; \tMotor();\r\n&gt; \r\n&gt; \t\/\/\/Destructor\r\n&gt; \t~Motor();\r\n&gt; \r\n&gt; \t\/\/Overridden ModelPlugin-Functions\r\n&gt; \tvirtual void Load(physics::ModelPtr _parent, sdf::ElementPtr \/*_sdf*\/);\r\n&gt; \tvirtual void OnUpdate(const common::UpdateInfo &amp;);\r\n&gt; \tvirtual void Reset();\r\n&gt; \r\n&gt; private:\r\n&gt; \t\/\/\/ Pointer to the Gazebo model\r\n&gt; \tphysics::ModelPtr model_;\r\n&gt; \t\/\/\/ Pointer to the update event connection\r\n&gt; \tevent::ConnectionPtr update_connection_;\r\n&gt; \t\/\/\/Node for communication to fawkes\r\n&gt; \ttransport::NodePtr node_;\r\n&gt; \t\/\/\/name of the motor and the communication channel\r\n&gt; \tstd::string name_;\r\n&gt; \r\n&gt; \t\/\/Motor Stuff:\r\n&gt; \tvoid on_motor_move_msg(ConstVector3dPtr &amp;msg);\r\n&gt; \r\n&gt; \t\/\/\/Suscriber for MotorMove Interfaces from Fawkes\r\n&gt; \ttransport::SubscriberPtr motor_move_sub_;\r\n&gt; \r\n&gt; \t\/\/current movement commands:\r\n&gt; \tfloat vx_;\r\n&gt; \tfloat vy_;\r\n&gt; \tfloat vomega_;\r\n&gt; };\r\n&gt; } \/\/ namespace gazebo\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazsim_robotino_plugin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazsim_robotino_plugin.cpp\r\n21,22d20\r\n&lt; #include &lt;core\/plugin.h&gt;\r\n&lt; \r\n24a23,24\r\n&gt; #include &lt;core\/plugin.h&gt;\r\n&gt; \r\n34,36c34,35\r\n&lt;  public:\r\n&lt; \r\n&lt;   \/** Constructor.\r\n---\r\n&gt; public:\r\n&gt; \t\/** Constructor.\r\n39,43c38,41\r\n&lt;   GazsimRobotinoPlugin(Configuration *config)\r\n&lt;     : Plugin(config)\r\n&lt;   {\r\n&lt;     thread_list.push_back(new RobotinoSimThread());\r\n&lt;   }\r\n---\r\n&gt; \texplicit GazsimRobotinoPlugin(Configuration *config) : Plugin(config)\r\n&gt; \t{\r\n&gt; \t\tthread_list.push_back(new RobotinoSimThread());\r\n&gt; \t}\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazsim_robotino_thread.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazsim_robotino_thread.cpp\r\n23,28d22\r\n&lt; #include &lt;tf\/types.h&gt;\r\n&lt; #include &lt;core\/threading\/mutex_locker.h&gt;\r\n&lt; \r\n&lt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n&lt; #include &lt;gazebo\/msgs\/msgs.hh&gt;\r\n&lt; #include &lt;gazebo\/transport\/transport.hh&gt;\r\n30c24,25\r\n&lt; \r\n---\r\n&gt; #include &lt;core\/threading\/mutex_locker.h&gt;\r\n&gt; #include &lt;interfaces\/IMUInterface.h&gt;\r\n34,35d28\r\n&lt; #include &lt;interfaces\/IMUInterface.h&gt;\r\n&lt; \r\n37c30\r\n&lt; #include &lt;utils\/time\/clock.h&gt;\r\n---\r\n&gt; #include &lt;tf\/types.h&gt;\r\n38a32\r\n&gt; #include &lt;utils\/time\/clock.h&gt;\r\n40a35,37\r\n&gt; #include &lt;gazebo\/msgs\/msgs.hh&gt;\r\n&gt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n&gt; #include &lt;gazebo\/transport\/transport.hh&gt;\r\n55,57c52,54\r\n&lt;   : Thread(&quot;RobotinoSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&lt;     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_WORLDSTATE), \/\/sonsor and act here\r\n&lt;     TransformAspect(TransformAspect::DEFER_PUBLISHER)\r\n---\r\n&gt; : Thread(&quot;RobotinoSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&gt;   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_WORLDSTATE), \/\/sonsor and act here\r\n&gt;   TransformAspect(TransformAspect::DEFER_PUBLISHER)\r\n64,146c61,62\r\n&lt;   \/\/get a connection to gazebo (copied from gazeboscene)\r\n&lt;   logger-&gt;log_debug(name(), &quot;Creating Gazebo publishers&quot;);\r\n&lt; \r\n&lt;   \/\/read config values\r\n&lt;   cfg_frame_odom_ = config-&gt;get_string(&quot;\/frames\/odom&quot;);\r\n&lt;   cfg_frame_base_ = config-&gt;get_string(&quot;\/frames\/base&quot;);\r\n&lt;   slippery_wheels_enabled_ = config-&gt;get_bool(&quot;gazsim\/robotino\/motor\/slippery-wheels-enabled&quot;);\r\n&lt;   slippery_wheels_threshold_ = config-&gt;get_float(&quot;gazsim\/robotino\/motor\/slippery-wheels-threshold&quot;);\r\n&lt;   moving_speed_factor_ = config-&gt;get_float(&quot;gazsim\/robotino\/motor\/moving-speed-factor&quot;);\r\n&lt;   rotation_speed_factor_ = config-&gt;get_float(&quot;gazsim\/robotino\/motor\/rotation-speed-factor&quot;);\r\n&lt;   gripper_laser_threshold_ = config-&gt;get_float(&quot;\/gazsim\/robotino\/gripper-laser-threshold&quot;);\r\n&lt;   gripper_laser_value_far_ = config-&gt;get_float(&quot;\/gazsim\/robotino\/gripper-laser-value-far&quot;);\r\n&lt;   gripper_laser_value_near_ = config-&gt;get_float(&quot;\/gazsim\/robotino\/gripper-laser-value-near&quot;);\r\n&lt;   have_gripper_sensors_ = config-&gt;exists(&quot;\/hardware\/robotino\/sensors\/right_ir_id&quot;)\r\n&lt;     &amp;&amp; config-&gt;exists(&quot;\/hardware\/robotino\/sensors\/left_ir_id&quot;);\r\n&lt;   if(have_gripper_sensors_)\r\n&lt;   {\r\n&lt;     gripper_laser_right_pos_ = config-&gt;get_int(&quot;\/hardware\/robotino\/sensors\/right_ir_id&quot;);\r\n&lt;     gripper_laser_left_pos_ = config-&gt;get_int(&quot;\/hardware\/robotino\/sensors\/left_ir_id&quot;);\r\n&lt;   }\r\n&lt;   gyro_buffer_size_ = config-&gt;get_int(&quot;\/gazsim\/robotino\/gyro-buffer-size&quot;);\r\n&lt;   gyro_delay_ = config-&gt;get_float(&quot;\/gazsim\/robotino\/gyro-delay&quot;);\r\n&lt;   infrared_sensor_index_ = config-&gt;get_int(&quot;\/gazsim\/robotino\/infrared-sensor-index&quot;);\r\n&lt; \r\n&lt;   tf_enable_publisher(cfg_frame_base_.c_str());\r\n&lt;  \r\n&lt;   \/\/Open interfaces\r\n&lt;   motor_if_  = blackboard-&gt;open_for_writing&lt;MotorInterface&gt;(&quot;Robotino&quot;);\r\n&lt;   switch_if_ = blackboard-&gt;open_for_writing&lt;fawkes::SwitchInterface&gt;(&quot;Robotino Motor&quot;);\r\n&lt;   sens_if_   = blackboard-&gt;open_for_writing&lt;RobotinoSensorInterface&gt;(&quot;Robotino&quot;);\r\n&lt;   imu_if_    = blackboard-&gt;open_for_writing&lt;IMUInterface&gt;(&quot;IMU Robotino&quot;);\r\n&lt; \r\n&lt;   \/\/Create suscribers\r\n&lt;   pos_sub_ = gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/gps&quot;), &amp;RobotinoSimThread::on_pos_msg, this);\r\n&lt;   gyro_sub_ = gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/gyro&quot;), &amp;RobotinoSimThread::on_gyro_msg, this);\r\n&lt;   infrared_puck_sensor_sub_ = gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/infrared-puck-sensor&quot;), &amp;RobotinoSimThread::on_infrared_puck_sensor_msg, this);\r\n&lt;   if(have_gripper_sensors_)\r\n&lt;   {\r\n&lt;     gripper_laser_left_sensor_sub_ = gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/gripper-laser-left&quot;), &amp;RobotinoSimThread::on_gripper_laser_left_sensor_msg, this);\r\n&lt;     gripper_laser_right_sensor_sub_ = gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/gripper-laser-right&quot;), &amp;RobotinoSimThread::on_gripper_laser_right_sensor_msg, this);\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/Create publishers\r\n&lt;   motor_move_pub_ = gazebonode-&gt;Advertise&lt;msgs::Vector3d&gt;(config-&gt;get_string(&quot;\/gazsim\/topics\/motor-move&quot;));\r\n&lt;   string_pub_ = gazebonode-&gt;Advertise&lt;msgs::Header&gt;(config-&gt;get_string(&quot;\/gazsim\/topics\/message&quot;));\r\n&lt; \r\n&lt;   \/\/enable motor by default\r\n&lt;   switch_if_-&gt;set_enabled(true);\r\n&lt;   switch_if_-&gt;write();\r\n&lt; \r\n&lt;   imu_if_-&gt;set_linear_acceleration(0, -1.);\r\n&lt;   \/\/imu_if_-&gt;set_angular_velocity_covariance(8, deg2rad(0.1));\r\n&lt;   \/\/ set as not available as we do not currently provide angular velocities.\r\n&lt;   imu_if_-&gt;set_angular_velocity_covariance(0, -1.);\r\n&lt;   imu_if_-&gt;write();\r\n&lt; \r\n&lt;   \/\/init motor variables\r\n&lt;   x_ = 0.0;\r\n&lt;   y_ = 0.0;\r\n&lt;   ori_ = 0.0;\r\n&lt;   vx_ = 0.0;\r\n&lt;   vy_ = 0.0;\r\n&lt;   vomega_ = 0.0;\r\n&lt;   des_vx_ = 0.0;\r\n&lt;   des_vy_ = 0.0;\r\n&lt;   des_vomega_ = 0.0;\r\n&lt;   x_offset_ = 0.0;\r\n&lt;   y_offset_ = 0.0;\r\n&lt;   ori_offset_ = 0.0;\r\n&lt;   path_length_ = 0.0;\r\n&lt; \r\n&lt;   gyro_buffer_index_new_ = 0;\r\n&lt;   gyro_buffer_index_delayed_ = 0;\r\n&lt;   gyro_timestamp_buffer_ = new fawkes::Time&#x5B;gyro_buffer_size_];\r\n&lt;   gyro_angle_buffer_ = new float&#x5B;gyro_buffer_size_];\r\n&lt; \r\n&lt;   new_data_ = false;\r\n&lt; \r\n&lt;   if(string_pub_-&gt;HasConnections())\r\n&lt;   {\r\n&lt;     msgs::Header helloMessage;\r\n&lt;     helloMessage.set_str_id(&quot;gazsim-robotino plugin connected&quot;);\r\n&lt;     string_pub_-&gt;Publish(helloMessage);\r\n---\r\n&gt; \t\/\/get a connection to gazebo (copied from gazeboscene)\r\n&gt; \tlogger-&gt;log_debug(name(), &quot;Creating Gazebo publishers&quot;);\r\n148c64,157\r\n&lt;   }\r\n---\r\n&gt; \t\/\/read config values\r\n&gt; \tcfg_frame_odom_            = config-&gt;get_string(&quot;\/frames\/odom&quot;);\r\n&gt; \tcfg_frame_base_            = config-&gt;get_string(&quot;\/frames\/base&quot;);\r\n&gt; \tcfg_frame_imu_             = config-&gt;get_string(&quot;\/gazsim\/robotino\/imu\/frame&quot;);\r\n&gt; \tslippery_wheels_enabled_   = config-&gt;get_bool(&quot;gazsim\/robotino\/motor\/slippery-wheels-enabled&quot;);\r\n&gt; \tslippery_wheels_threshold_ = config-&gt;get_float(&quot;gazsim\/robotino\/motor\/slippery-wheels-threshold&quot;);\r\n&gt; \tmoving_speed_factor_       = config-&gt;get_float(&quot;gazsim\/robotino\/motor\/moving-speed-factor&quot;);\r\n&gt; \trotation_speed_factor_     = config-&gt;get_float(&quot;gazsim\/robotino\/motor\/rotation-speed-factor&quot;);\r\n&gt; \tgripper_laser_threshold_   = config-&gt;get_float(&quot;\/gazsim\/robotino\/gripper-laser-threshold&quot;);\r\n&gt; \tgripper_laser_value_far_   = config-&gt;get_float(&quot;\/gazsim\/robotino\/gripper-laser-value-far&quot;);\r\n&gt; \tgripper_laser_value_near_  = config-&gt;get_float(&quot;\/gazsim\/robotino\/gripper-laser-value-near&quot;);\r\n&gt; \thave_gripper_sensors_      = config-&gt;exists(&quot;\/hardware\/robotino\/sensors\/right_ir_id&quot;)\r\n&gt; \t                        &amp;&amp; config-&gt;exists(&quot;\/hardware\/robotino\/sensors\/left_ir_id&quot;);\r\n&gt; \tif (have_gripper_sensors_) {\r\n&gt; \t\tgripper_laser_right_pos_ = config-&gt;get_int(&quot;\/hardware\/robotino\/sensors\/right_ir_id&quot;);\r\n&gt; \t\tgripper_laser_left_pos_  = config-&gt;get_int(&quot;\/hardware\/robotino\/sensors\/left_ir_id&quot;);\r\n&gt; \t}\r\n&gt; \tgyro_buffer_size_      = config-&gt;get_int(&quot;\/gazsim\/robotino\/gyro-buffer-size&quot;);\r\n&gt; \tgyro_delay_            = config-&gt;get_float(&quot;\/gazsim\/robotino\/gyro-delay&quot;);\r\n&gt; \tinfrared_sensor_index_ = config-&gt;get_int(&quot;\/gazsim\/robotino\/infrared-sensor-index&quot;);\r\n&gt; \r\n&gt; \ttf_enable_publisher(cfg_frame_base_.c_str());\r\n&gt; \r\n&gt; \t\/\/Open interfaces\r\n&gt; \tmotor_if_  = blackboard-&gt;open_for_writing&lt;MotorInterface&gt;(&quot;Robotino&quot;);\r\n&gt; \tswitch_if_ = blackboard-&gt;open_for_writing&lt;fawkes::SwitchInterface&gt;(&quot;Robotino Motor&quot;);\r\n&gt; \tsens_if_   = blackboard-&gt;open_for_writing&lt;RobotinoSensorInterface&gt;(&quot;Robotino&quot;);\r\n&gt; \timu_if_    = blackboard-&gt;open_for_writing&lt;IMUInterface&gt;(&quot;IMU Robotino&quot;);\r\n&gt; \r\n&gt; \t\/\/Create suscribers\r\n&gt; \tpos_sub_  = gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/gps&quot;),\r\n&gt;                                    &amp;RobotinoSimThread::on_pos_msg,\r\n&gt;                                    this);\r\n&gt; \tgyro_sub_ = gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/gyro&quot;),\r\n&gt; \t                                  &amp;RobotinoSimThread::on_gyro_msg,\r\n&gt; \t                                  this);\r\n&gt; \tinfrared_puck_sensor_sub_ =\r\n&gt; \t  gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/infrared-puck-sensor&quot;),\r\n&gt; \t                        &amp;RobotinoSimThread::on_infrared_puck_sensor_msg,\r\n&gt; \t                        this);\r\n&gt; \tif (have_gripper_sensors_) {\r\n&gt; \t\tgripper_laser_left_sensor_sub_ =\r\n&gt; \t\t  gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/gripper-laser-left&quot;),\r\n&gt; \t\t                        &amp;RobotinoSimThread::on_gripper_laser_left_sensor_msg,\r\n&gt; \t\t                        this);\r\n&gt; \t\tgripper_laser_right_sensor_sub_ =\r\n&gt; \t\t  gazebonode-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/gripper-laser-right&quot;),\r\n&gt; \t\t                        &amp;RobotinoSimThread::on_gripper_laser_right_sensor_msg,\r\n&gt; \t\t                        this);\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/Create publishers\r\n&gt; \tmotor_move_pub_ =\r\n&gt; \t  gazebonode-&gt;Advertise&lt;msgs::Vector3d&gt;(config-&gt;get_string(&quot;\/gazsim\/topics\/motor-move&quot;));\r\n&gt; \tstring_pub_ = gazebonode-&gt;Advertise&lt;msgs::Header&gt;(config-&gt;get_string(&quot;\/gazsim\/topics\/message&quot;));\r\n&gt; \r\n&gt; \t\/\/enable motor by default\r\n&gt; \tswitch_if_-&gt;set_enabled(true);\r\n&gt; \tswitch_if_-&gt;write();\r\n&gt; \r\n&gt; \timu_if_-&gt;set_frame(cfg_frame_imu_.c_str());\r\n&gt; \timu_if_-&gt;set_linear_acceleration(0, -1.);\r\n&gt; \t\/\/imu_if_-&gt;set_angular_velocity_covariance(8, deg2rad(0.1));\r\n&gt; \t\/\/ set as not available as we do not currently provide angular velocities.\r\n&gt; \timu_if_-&gt;set_angular_velocity_covariance(0, -1.);\r\n&gt; \timu_if_-&gt;write();\r\n&gt; \r\n&gt; \t\/\/init motor variables\r\n&gt; \tx_           = 0.0;\r\n&gt; \ty_           = 0.0;\r\n&gt; \tori_         = 0.0;\r\n&gt; \tvx_          = 0.0;\r\n&gt; \tvy_          = 0.0;\r\n&gt; \tvomega_      = 0.0;\r\n&gt; \tdes_vx_      = 0.0;\r\n&gt; \tdes_vy_      = 0.0;\r\n&gt; \tdes_vomega_  = 0.0;\r\n&gt; \tx_offset_    = 0.0;\r\n&gt; \ty_offset_    = 0.0;\r\n&gt; \tori_offset_  = 0.0;\r\n&gt; \tpath_length_ = 0.0;\r\n&gt; \r\n&gt; \tgyro_buffer_index_new_     = 0;\r\n&gt; \tgyro_buffer_index_delayed_ = 0;\r\n&gt; \tgyro_timestamp_buffer_     = new fawkes::Time&#x5B;gyro_buffer_size_];\r\n&gt; \tgyro_angle_buffer_         = new float&#x5B;gyro_buffer_size_];\r\n&gt; \r\n&gt; \tnew_data_ = false;\r\n&gt; \r\n&gt; \tif (string_pub_-&gt;HasConnections()) {\r\n&gt; \t\tmsgs::Header helloMessage;\r\n&gt; \t\thelloMessage.set_str_id(&quot;gazsim-robotino plugin connected&quot;);\r\n&gt; \t\tstring_pub_-&gt;Publish(helloMessage);\r\n&gt; \t}\r\n154,158c163,167\r\n&lt;   \/\/close interfaces\r\n&lt;   blackboard-&gt;close(imu_if_);\r\n&lt;   blackboard-&gt;close(sens_if_);\r\n&lt;   blackboard-&gt;close(motor_if_);\r\n&lt;   blackboard-&gt;close(switch_if_);\r\n---\r\n&gt; \t\/\/close interfaces\r\n&gt; \tblackboard-&gt;close(imu_if_);\r\n&gt; \tblackboard-&gt;close(sens_if_);\r\n&gt; \tblackboard-&gt;close(motor_if_);\r\n&gt; \tblackboard-&gt;close(switch_if_);\r\n160,161c169,170\r\n&lt;   delete &#x5B;] gyro_timestamp_buffer_;\r\n&lt;   delete &#x5B;] gyro_angle_buffer_;\r\n---\r\n&gt; \tdelete&#x5B;] gyro_timestamp_buffer_;\r\n&gt; \tdelete&#x5B;] gyro_angle_buffer_;\r\n167,168c176,227\r\n&lt;   \/\/work off all messages passed to the motor_interfaces\r\n&lt;   process_motor_messages();\r\n---\r\n&gt; \t\/\/work off all messages passed to the motor_interfaces\r\n&gt; \tprocess_motor_messages();\r\n&gt; \r\n&gt; \t\/\/update interfaces\r\n&gt; \tif (new_data_) {\r\n&gt; \t\tmotor_if_-&gt;set_odometry_position_x(x_);\r\n&gt; \t\tmotor_if_-&gt;set_odometry_position_y(y_);\r\n&gt; \t\tmotor_if_-&gt;set_odometry_orientation(ori_);\r\n&gt; \t\tmotor_if_-&gt;set_odometry_path_length(path_length_);\r\n&gt; \t\tmotor_if_-&gt;write();\r\n&gt; \r\n&gt; \t\tif (gyro_available_) {\r\n&gt; \t\t\t\/\/update gyro (with delay)\r\n&gt; \t\t\tfawkes::Time now(clock);\r\n&gt; \t\t\twhile ((now - gyro_timestamp_buffer_&#x5B;(gyro_buffer_index_delayed_ + 1) % gyro_buffer_size_])\r\n&gt; \t\t\t           .in_sec()\r\n&gt; \t\t\t         &gt;= gyro_delay_\r\n&gt; \t\t\t       &amp;&amp; gyro_buffer_index_delayed_ &lt; gyro_buffer_index_new_) {\r\n&gt; \t\t\t\tgyro_buffer_index_delayed_++;\r\n&gt; \t\t\t}\r\n&gt; \r\n&gt; \t\t\ttf::Quaternion q =\r\n&gt; \t\t\t  tf::create_quaternion_from_yaw(gyro_angle_buffer_&#x5B;gyro_buffer_index_delayed_]);\r\n&gt; \t\t\timu_if_-&gt;set_orientation(0, q.x());\r\n&gt; \t\t\timu_if_-&gt;set_orientation(1, q.y());\r\n&gt; \t\t\timu_if_-&gt;set_orientation(2, q.z());\r\n&gt; \t\t\timu_if_-&gt;set_orientation(3, q.w());\r\n&gt; \t\t\tfor (uint i = 0; i &lt; 9u; i += 4) {\r\n&gt; \t\t\t\timu_if_-&gt;set_orientation_covariance(i, 1e-3);\r\n&gt; \t\t\t\timu_if_-&gt;set_angular_velocity_covariance(i, 1e-3);\r\n&gt; \t\t\t\timu_if_-&gt;set_linear_acceleration_covariance(i, 1e-3);\r\n&gt; \t\t\t}\r\n&gt; \t\t} else {\r\n&gt; \t\t\timu_if_-&gt;set_angular_velocity(0, -1.);\r\n&gt; \t\t\timu_if_-&gt;set_orientation(0, -1.);\r\n&gt; \t\t\timu_if_-&gt;set_orientation(1, 0.);\r\n&gt; \t\t\timu_if_-&gt;set_orientation(2, 0.);\r\n&gt; \t\t\timu_if_-&gt;set_orientation(3, 0.);\r\n&gt; \t\t}\r\n&gt; \t\timu_if_-&gt;write();\r\n&gt; \r\n&gt; \t\tsens_if_-&gt;set_distance(infrared_sensor_index_, infrared_puck_sensor_dist_);\r\n&gt; \r\n&gt; \t\tif (have_gripper_sensors_) {\r\n&gt; \t\t\tsens_if_-&gt;set_analog_in(gripper_laser_left_pos_, analog_in_left_);\r\n&gt; \t\t\tsens_if_-&gt;set_analog_in(gripper_laser_right_pos_, analog_in_right_);\r\n&gt; \t\t}\r\n&gt; \t\tsens_if_-&gt;write();\r\n&gt; \r\n&gt; \t\tnew_data_ = false;\r\n&gt; \t}\r\n&gt; }\r\n170,292c229,236\r\n&lt;   \/\/update interfaces\r\n&lt;   if(new_data_)\r\n&lt;   {\r\n&lt;     motor_if_-&gt;set_odometry_position_x(x_);\r\n&lt;     motor_if_-&gt;set_odometry_position_y(y_);\r\n&lt;     motor_if_-&gt;set_odometry_orientation(ori_);\r\n&lt;     motor_if_-&gt;set_odometry_path_length(path_length_);\r\n&lt;     motor_if_-&gt;write();\r\n&lt; \r\n&lt;     if(gyro_available_)\r\n&lt;     {\r\n&lt;       \/\/update gyro (with delay)\r\n&lt;       fawkes::Time now(clock);\r\n&lt;       while ((now - gyro_timestamp_buffer_&#x5B;(gyro_buffer_index_delayed_ + 1) % gyro_buffer_size_]).in_sec() &gt;= gyro_delay_\r\n&lt; \t     &amp;&amp; gyro_buffer_index_delayed_ &lt; gyro_buffer_index_new_)\r\n&lt;       {\r\n&lt; \tgyro_buffer_index_delayed_++;\r\n&lt;       }\r\n&lt; \t  \r\n&lt;       tf::Quaternion q =\r\n&lt; \ttf::create_quaternion_from_yaw(gyro_angle_buffer_&#x5B;gyro_buffer_index_delayed_]);\r\n&lt;       imu_if_-&gt;set_orientation(0, q.x());\r\n&lt;       imu_if_-&gt;set_orientation(1, q.y());\r\n&lt;       imu_if_-&gt;set_orientation(2, q.z());\r\n&lt;       imu_if_-&gt;set_orientation(3, q.w());\r\n&lt;     } else {\r\n&lt;       imu_if_-&gt;set_angular_velocity(0, -1.);\r\n&lt;       imu_if_-&gt;set_orientation(0, -1.);\r\n&lt;       imu_if_-&gt;set_orientation(1,  0.);\r\n&lt;       imu_if_-&gt;set_orientation(2,  0.);\r\n&lt;       imu_if_-&gt;set_orientation(3,  0.);\r\n&lt;     }\r\n&lt;     imu_if_-&gt;write();\r\n&lt; \r\n&lt;     sens_if_-&gt;set_distance(infrared_sensor_index_, infrared_puck_sensor_dist_);\r\n&lt;     \r\n&lt;     if(have_gripper_sensors_)\r\n&lt;     {\r\n&lt;       sens_if_-&gt;set_analog_in(gripper_laser_left_pos_, analog_in_left_);\r\n&lt;       sens_if_-&gt;set_analog_in(gripper_laser_right_pos_, analog_in_right_);\r\n&lt;     }    \r\n&lt;     sens_if_-&gt;write();\r\n&lt; \r\n&lt;     new_data_ = false;\r\n&lt;   }\r\n&lt; }\r\n&lt; \r\n&lt; void RobotinoSimThread::send_transroot(double vx, double vy, double omega)\r\n&lt; {\r\n&lt;   msgs::Vector3d motorMove;\r\n&lt;   motorMove.set_x(vx_);\r\n&lt;   motorMove.set_y(vy_);\r\n&lt;   motorMove.set_z(vomega_);\r\n&lt;   motor_move_pub_-&gt;Publish(motorMove);\r\n&lt; }\r\n&lt; \r\n&lt; void RobotinoSimThread::process_motor_messages()\r\n&lt; {\r\n&lt;   \/\/check messages of the switch interface\r\n&lt;   while (!switch_if_-&gt;msgq_empty()) {\r\n&lt;     if (SwitchInterface::DisableSwitchMessage *msg =\r\n&lt; \tswitch_if_-&gt;msgq_first_safe(msg)) {\r\n&lt;       switch_if_-&gt;set_enabled(false);\r\n&lt;       \/\/pause movement\r\n&lt;       send_transroot(0, 0, 0);\r\n&lt;     } else if (SwitchInterface::EnableSwitchMessage *msg =\r\n&lt; \t       switch_if_-&gt;msgq_first_safe(msg)) {\r\n&lt;       switch_if_-&gt;set_enabled(true);\r\n&lt;       \/\/unpause movement\r\n&lt;       send_transroot(vx_, vy_, vomega_);\r\n&lt;     }\r\n&lt;     switch_if_-&gt;msgq_pop();\r\n&lt;     switch_if_-&gt;write();\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/do not do anything if the motor is disabled\r\n&lt;   if(!switch_if_-&gt;is_enabled())\r\n&lt;   {\r\n&lt;     return;\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/check messages of the motor interface\r\n&lt;   while(motor_move_pub_-&gt;HasConnections() &amp;&amp; !motor_if_-&gt;msgq_empty())\r\n&lt;   {\r\n&lt;     if (MotorInterface::TransRotMessage *msg =\r\n&lt; \tmotor_if_-&gt;msgq_first_safe(msg))\r\n&lt;     {\r\n&lt;       \/\/send command only if changed\r\n&lt;       if(vel_changed(msg-&gt;vx(), vx_, 0.01) || vel_changed(msg-&gt;vy(), vy_, 0.01) || vel_changed(msg-&gt;omega(), vomega_, 0.01))\r\n&lt;       {\r\n&lt; \tvx_ = msg-&gt;vx();\r\n&lt; \tvy_ = msg-&gt;vy();\r\n&lt; \tvomega_ = msg-&gt;omega();\r\n&lt; \tdes_vx_ = vx_;\r\n&lt; \tdes_vy_ = vy_;\r\n&lt; \tdes_vomega_ = vomega_;\r\n&lt; \t\r\n&lt; \t\/\/send message to gazebo (apply movement_factor to compensate friction)\r\n&lt; \tsend_transroot(vx_ * moving_speed_factor_, vy_ * moving_speed_factor_, vomega_ * rotation_speed_factor_);\r\n&lt; \r\n&lt; \t\/\/update interface\r\n&lt; \tmotor_if_-&gt;set_vx(vx_);\r\n&lt; \tmotor_if_-&gt;set_vy(vy_);\r\n&lt; \tmotor_if_-&gt;set_omega(vomega_);\r\n&lt; \tmotor_if_-&gt;set_des_vx(des_vx_);\r\n&lt; \tmotor_if_-&gt;set_des_vy(des_vy_);\r\n&lt; \tmotor_if_-&gt;set_des_omega(des_vomega_);\r\n&lt; \t\/\/update interface\r\n&lt; \tmotor_if_-&gt;write();\r\n&lt;       }    \r\n&lt;     }\r\n&lt;     else if (motor_if_-&gt;msgq_first_is&lt;MotorInterface::ResetOdometryMessage&gt;())\r\n&lt;       {\r\n&lt;         x_offset_ += x_;\r\n&lt; \ty_offset_ += y_;\r\n&lt;         ori_offset_ += ori_;\r\n&lt; \tx_ = 0.0;\r\n&lt; \ty_ = 0.0;\r\n&lt; \tori_ = 0.0;\r\n&lt; \tlast_vel_set_time_ = clock-&gt;now();\r\n&lt;       }\r\n&lt;     motor_if_-&gt;msgq_pop();\r\n&lt;   }\r\n---\r\n&gt; void\r\n&gt; RobotinoSimThread::send_transroot(double vx, double vy, double omega)\r\n&gt; {\r\n&gt; \tmsgs::Vector3d motorMove;\r\n&gt; \tmotorMove.set_x(vx_);\r\n&gt; \tmotorMove.set_y(vy_);\r\n&gt; \tmotorMove.set_z(vomega_);\r\n&gt; \tmotor_move_pub_-&gt;Publish(motorMove);\r\n295c239,240\r\n&lt; bool RobotinoSimThread::vel_changed(float before, float after, float relativeThreashold)\r\n---\r\n&gt; void\r\n&gt; RobotinoSimThread::process_motor_messages()\r\n297c242,300\r\n&lt;   return(before == 0.0 || after == 0.0 || fabs((before-after)\/before) &gt; relativeThreashold);\r\n---\r\n&gt; \t\/\/check messages of the switch interface\r\n&gt; \twhile (!switch_if_-&gt;msgq_empty()) {\r\n&gt; \t\tif (SwitchInterface::DisableSwitchMessage *msg = switch_if_-&gt;msgq_first_safe(msg)) {\r\n&gt; \t\t\tswitch_if_-&gt;set_enabled(false);\r\n&gt; \t\t\t\/\/pause movement\r\n&gt; \t\t\tsend_transroot(0, 0, 0);\r\n&gt; \t\t} else if (SwitchInterface::EnableSwitchMessage *msg = switch_if_-&gt;msgq_first_safe(msg)) {\r\n&gt; \t\t\tswitch_if_-&gt;set_enabled(true);\r\n&gt; \t\t\t\/\/unpause movement\r\n&gt; \t\t\tsend_transroot(vx_, vy_, vomega_);\r\n&gt; \t\t}\r\n&gt; \t\tswitch_if_-&gt;msgq_pop();\r\n&gt; \t\tswitch_if_-&gt;write();\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/do not do anything if the motor is disabled\r\n&gt; \tif (!switch_if_-&gt;is_enabled()) {\r\n&gt; \t\treturn;\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/check messages of the motor interface\r\n&gt; \twhile (motor_move_pub_-&gt;HasConnections() &amp;&amp; !motor_if_-&gt;msgq_empty()) {\r\n&gt; \t\tif (MotorInterface::TransRotMessage *msg = motor_if_-&gt;msgq_first_safe(msg)) {\r\n&gt; \t\t\t\/\/send command only if changed\r\n&gt; \t\t\tif (vel_changed(msg-&gt;vx(), vx_, 0.01) || vel_changed(msg-&gt;vy(), vy_, 0.01)\r\n&gt; \t\t\t    || vel_changed(msg-&gt;omega(), vomega_, 0.01)) {\r\n&gt; \t\t\t\tvx_         = msg-&gt;vx();\r\n&gt; \t\t\t\tvy_         = msg-&gt;vy();\r\n&gt; \t\t\t\tvomega_     = msg-&gt;omega();\r\n&gt; \t\t\t\tdes_vx_     = vx_;\r\n&gt; \t\t\t\tdes_vy_     = vy_;\r\n&gt; \t\t\t\tdes_vomega_ = vomega_;\r\n&gt; \r\n&gt; \t\t\t\t\/\/send message to gazebo (apply movement_factor to compensate friction)\r\n&gt; \t\t\t\tsend_transroot(vx_ * moving_speed_factor_,\r\n&gt; \t\t\t\t               vy_ * moving_speed_factor_,\r\n&gt; \t\t\t\t               vomega_ * rotation_speed_factor_);\r\n&gt; \r\n&gt; \t\t\t\t\/\/update interface\r\n&gt; \t\t\t\tmotor_if_-&gt;set_vx(vx_);\r\n&gt; \t\t\t\tmotor_if_-&gt;set_vy(vy_);\r\n&gt; \t\t\t\tmotor_if_-&gt;set_omega(vomega_);\r\n&gt; \t\t\t\tmotor_if_-&gt;set_des_vx(des_vx_);\r\n&gt; \t\t\t\tmotor_if_-&gt;set_des_vy(des_vy_);\r\n&gt; \t\t\t\tmotor_if_-&gt;set_des_omega(des_vomega_);\r\n&gt; \t\t\t\t\/\/update interface\r\n&gt; \t\t\t\tmotor_if_-&gt;write();\r\n&gt; \t\t\t}\r\n&gt; \t\t} else if (motor_if_-&gt;msgq_first_is&lt;MotorInterface::ResetOdometryMessage&gt;()) {\r\n&gt; \t\t\tx_offset_ += x_;\r\n&gt; \t\t\ty_offset_ += y_;\r\n&gt; \t\t\tori_offset_ += ori_;\r\n&gt; \t\t\tx_                 = 0.0;\r\n&gt; \t\t\ty_                 = 0.0;\r\n&gt; \t\t\tori_               = 0.0;\r\n&gt; \t\t\tlast_vel_set_time_ = clock-&gt;now();\r\n&gt; \t\t}\r\n&gt; \t\tmotor_if_-&gt;msgq_pop();\r\n&gt; \t}\r\n299a303,307\r\n&gt; bool\r\n&gt; RobotinoSimThread::vel_changed(float before, float after, float relativeThreashold)\r\n&gt; {\r\n&gt; \treturn (before == 0.0 || after == 0.0 || fabs((before - after) \/ before) &gt; relativeThreashold);\r\n&gt; }\r\n302c310,311\r\n&lt; void RobotinoSimThread::on_pos_msg(ConstPosePtr &amp;msg)\r\n---\r\n&gt; void\r\n&gt; RobotinoSimThread::on_pos_msg(ConstPosePtr &amp;msg)\r\n304c313\r\n&lt;   \/\/logger_-&gt;log_debug(name_, &quot;Got Position MSG from gazebo with ori: %f&quot;, msg-&gt;z());\r\n---\r\n&gt; \t\/\/logger_-&gt;log_debug(name_, &quot;Got Position MSG from gazebo with ori: %f&quot;, msg-&gt;z());\r\n306c315,403\r\n&lt;   MutexLocker lock(loop_mutex);\r\n---\r\n&gt; \tMutexLocker lock(loop_mutex);\r\n&gt; \r\n&gt; \t\/\/read out values + substract offset\r\n&gt; \tfloat new_x = msg-&gt;position().x() - x_offset_;\r\n&gt; \tfloat new_y = msg-&gt;position().y() - y_offset_;\r\n&gt; \t\/\/calculate ori from quaternion\r\n&gt; \tfloat new_ori = tf::get_yaw(tf::Quaternion(msg-&gt;orientation().x(),\r\n&gt; \t                                           msg-&gt;orientation().y(),\r\n&gt; \t                                           msg-&gt;orientation().z(),\r\n&gt; \t                                           msg-&gt;orientation().w()));\r\n&gt; \tnew_ori -= ori_offset_;\r\n&gt; \r\n&gt; \t\/\/estimate path-length\r\n&gt; \tfloat length_driven = sqrt((new_x - x_) * (new_x - x_) + (new_y - y_) * (new_y - y_));\r\n&gt; \r\n&gt; \tif (slippery_wheels_enabled_) {\r\n&gt; \t\t\/\/simulate slipping wheels when driving against an obstacle\r\n&gt; \t\tfawkes::Time new_time = clock-&gt;now();\r\n&gt; \t\tdouble       duration = new_time.in_sec() - last_pos_time_.in_sec();\r\n&gt; \t\t\/\/calculate duration since the velocity was last set to filter slipping while accelerating\r\n&gt; \t\tdouble velocity_set_duration = new_time.in_sec() - last_vel_set_time_.in_sec();\r\n&gt; \r\n&gt; \t\tlast_pos_time_ = new_time;\r\n&gt; \r\n&gt; \t\tdouble total_speed = sqrt(vx_ * vx_ + vy_ * vy_);\r\n&gt; \t\tif (length_driven &lt; total_speed * duration * slippery_wheels_threshold_\r\n&gt; \t\t    &amp;&amp; velocity_set_duration &gt; duration) {\r\n&gt; \t\t\tdouble speed_abs_x = vx_ * cos(ori_) - vy_ * sin(ori_);\r\n&gt; \t\t\tdouble speed_abs_y = vx_ * sin(ori_) + vy_ * cos(ori_);\r\n&gt; \t\t\tdouble slipped_x   = speed_abs_x * duration * slippery_wheels_threshold_;\r\n&gt; \t\t\tdouble slipped_y   = speed_abs_y * duration * slippery_wheels_threshold_;\r\n&gt; \t\t\t\/\/logger_-&gt;log_debug(name_, &quot;Wheels are slipping (%f, %f)&quot;, slipped_x, slipped_y);\r\n&gt; \t\t\tnew_x = x_ + slipped_x;\r\n&gt; \t\t\tnew_y = y_ + slipped_y;\r\n&gt; \t\t\t\/\/update the offset (otherwise the slippery error would be corrected in the next iteration)\r\n&gt; \t\t\tx_offset_ -= slipped_x;\r\n&gt; \t\t\ty_offset_ -= slipped_y;\r\n&gt; \r\n&gt; \t\t\tlength_driven = sqrt((new_x - x_) * (new_x - x_) + (new_y - y_) * (new_y - y_));\r\n&gt; \t\t}\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/update stored values\r\n&gt; \tx_   = new_x;\r\n&gt; \ty_   = new_y;\r\n&gt; \tori_ = new_ori;\r\n&gt; \tpath_length_ += length_driven;\r\n&gt; \tnew_data_ = true;\r\n&gt; \r\n&gt; \t\/\/publish transform (otherwise the transform can not convert \/base_link to \/odom)\r\n&gt; \tfawkes::Time  now(clock);\r\n&gt; \ttf::Transform t(tf::Quaternion(tf::Vector3(0, 0, 1), ori_), tf::Vector3(x_, y_, 0.0));\r\n&gt; \r\n&gt; \ttf_publisher-&gt;send_transform(t, now, cfg_frame_odom_, cfg_frame_base_);\r\n&gt; }\r\n&gt; void\r\n&gt; RobotinoSimThread::on_gyro_msg(ConstVector3dPtr &amp;msg)\r\n&gt; {\r\n&gt; \tMutexLocker lock(loop_mutex);\r\n&gt; \tgyro_buffer_index_new_                         = (gyro_buffer_index_new_ + 1) % gyro_buffer_size_;\r\n&gt; \tgyro_angle_buffer_&#x5B;gyro_buffer_index_new_]     = msg-&gt;z();\r\n&gt; \tgyro_timestamp_buffer_&#x5B;gyro_buffer_index_new_] = clock-&gt;now();\r\n&gt; \tgyro_available_                                = true;\r\n&gt; \tnew_data_                                      = true;\r\n&gt; }\r\n&gt; void\r\n&gt; RobotinoSimThread::on_infrared_puck_sensor_msg(ConstLaserScanStampedPtr &amp;msg)\r\n&gt; {\r\n&gt; \tMutexLocker lock(loop_mutex);\r\n&gt; \t\/\/make sure that the config values for fetch_puck are set right\r\n&gt; \tinfrared_puck_sensor_dist_ = msg-&gt;scan().ranges(0);\r\n&gt; \tnew_data_                  = true;\r\n&gt; }\r\n&gt; void\r\n&gt; RobotinoSimThread::on_gripper_laser_right_sensor_msg(ConstFloatPtr &amp;msg)\r\n&gt; {\r\n&gt; \tMutexLocker lock(loop_mutex);\r\n&gt; \r\n&gt; \tif (msg-&gt;value() &lt; gripper_laser_threshold_) {\r\n&gt; \t\tanalog_in_right_ = gripper_laser_value_near_;\r\n&gt; \t} else {\r\n&gt; \t\tanalog_in_right_ = gripper_laser_value_far_;\r\n&gt; \t}\r\n&gt; \tnew_data_ = true;\r\n&gt; }\r\n&gt; void\r\n&gt; RobotinoSimThread::on_gripper_laser_left_sensor_msg(ConstFloatPtr &amp;msg)\r\n&gt; {\r\n&gt; \tMutexLocker lock(loop_mutex);\r\n308,404c405,410\r\n&lt;   \/\/read out values + substract offset\r\n&lt;   float new_x = msg-&gt;position().x() - x_offset_;\r\n&lt;   float new_y = msg-&gt;position().y() - y_offset_;\r\n&lt;   \/\/calculate ori from quaternion\r\n&lt;   float new_ori = tf::get_yaw(tf::Quaternion(msg-&gt;orientation().x(), msg-&gt;orientation().y()\r\n&lt; \t\t\t\t\t  , msg-&gt;orientation().z(), msg-&gt;orientation().w()));\r\n&lt;   new_ori -= ori_offset_;\r\n&lt;   \r\n&lt;   \/\/estimate path-length\r\n&lt;   float length_driven = sqrt((new_x-x_) * (new_x-x_) + (new_y-y_) * (new_y-y_));\r\n&lt;   \r\n&lt;   if(slippery_wheels_enabled_)\r\n&lt;   {\r\n&lt;     \/\/simulate slipping wheels when driving against an obstacle\r\n&lt;     fawkes::Time new_time = clock-&gt;now();\r\n&lt;     double duration = new_time.in_sec() - last_pos_time_.in_sec();\r\n&lt;     \/\/calculate duration since the velocity was last set to filter slipping while accelerating\r\n&lt;     double velocity_set_duration = new_time.in_sec() - last_vel_set_time_.in_sec();\r\n&lt; \r\n&lt;     last_pos_time_ = new_time;\r\n&lt;     \r\n&lt; \r\n&lt;     double total_speed = sqrt(vx_ * vx_ + vy_ * vy_);\r\n&lt;     if(length_driven &lt; total_speed * duration * slippery_wheels_threshold_ &amp;&amp; velocity_set_duration &gt; duration)\r\n&lt;     {\r\n&lt;       double speed_abs_x = vx_ * cos(ori_) - vy_ * sin(ori_);\r\n&lt;       double speed_abs_y = vx_ * sin(ori_) + vy_ * cos(ori_);\r\n&lt;       double slipped_x = speed_abs_x * duration * slippery_wheels_threshold_;\r\n&lt;       double slipped_y = speed_abs_y * duration * slippery_wheels_threshold_;\r\n&lt;       \/\/logger_-&gt;log_debug(name_, &quot;Wheels are slipping (%f, %f)&quot;, slipped_x, slipped_y);\r\n&lt;       new_x = x_ + slipped_x;\r\n&lt;       new_y = y_ + slipped_y;\r\n&lt;       \/\/update the offset (otherwise the slippery error would be corrected in the next iteration)\r\n&lt;       x_offset_ -= slipped_x;\r\n&lt;       y_offset_ -= slipped_y;\t      \r\n&lt; \r\n&lt;       length_driven = sqrt((new_x-x_) * (new_x-x_) + (new_y-y_) * (new_y-y_));\r\n&lt;     }\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/update stored values\r\n&lt;   x_ = new_x;\r\n&lt;   y_ = new_y;\r\n&lt;   ori_ = new_ori;\r\n&lt;   path_length_ += length_driven;\r\n&lt;   new_data_ = true;\r\n&lt; \r\n&lt;   \/\/publish transform (otherwise the transform can not convert \/base_link to \/odom)\r\n&lt;   fawkes::Time now(clock);\r\n&lt;   tf::Transform t(tf::Quaternion(tf::Vector3(0,0,1),ori_),\r\n&lt; \t\t  tf::Vector3(x_, y_, 0.0));\r\n&lt; \r\n&lt;   tf_publisher-&gt;send_transform(t, now, cfg_frame_odom_, cfg_frame_base_);\r\n&lt; }\r\n&lt; void RobotinoSimThread::on_gyro_msg(ConstVector3dPtr &amp;msg)\r\n&lt; {\r\n&lt;   MutexLocker lock(loop_mutex);\r\n&lt;   gyro_buffer_index_new_ = (gyro_buffer_index_new_ + 1) % gyro_buffer_size_;\r\n&lt;   gyro_angle_buffer_&#x5B;gyro_buffer_index_new_] = msg-&gt;z();\r\n&lt;   gyro_timestamp_buffer_&#x5B;gyro_buffer_index_new_] = clock-&gt;now();\r\n&lt;   gyro_available_ = true;\r\n&lt;   new_data_ = true;\r\n&lt; }\r\n&lt; void RobotinoSimThread::on_infrared_puck_sensor_msg(ConstLaserScanStampedPtr &amp;msg)\r\n&lt; {\r\n&lt;   MutexLocker lock(loop_mutex);\r\n&lt;   \/\/make sure that the config values for fetch_puck are set right\r\n&lt;   infrared_puck_sensor_dist_ = msg-&gt;scan().ranges(0);\r\n&lt;   new_data_ = true;\r\n&lt; }\r\n&lt; void RobotinoSimThread::on_gripper_laser_right_sensor_msg(ConstFloatPtr &amp;msg)\r\n&lt; {\r\n&lt;   MutexLocker lock(loop_mutex);\r\n&lt; \r\n&lt;   if(msg-&gt;value() &lt; gripper_laser_threshold_)\r\n&lt;   {\r\n&lt;     analog_in_right_ = gripper_laser_value_near_;\r\n&lt;   }\r\n&lt;   else\r\n&lt;   {\r\n&lt;     analog_in_right_ = gripper_laser_value_far_;\r\n&lt;   }\r\n&lt;   new_data_ = true;\r\n&lt; }\r\n&lt; void RobotinoSimThread::on_gripper_laser_left_sensor_msg(ConstFloatPtr &amp;msg)\r\n&lt; {\r\n&lt;   MutexLocker lock(loop_mutex);\r\n&lt; \r\n&lt;   if(msg-&gt;value() &lt; gripper_laser_threshold_)\r\n&lt;   {\r\n&lt;     analog_in_left_ = gripper_laser_value_near_;\r\n&lt;   }\r\n&lt;   else\r\n&lt;   {\r\n&lt;     analog_in_left_ = gripper_laser_value_far_;\r\n&lt;   }\r\n&lt;   new_data_ = true;\r\n---\r\n&gt; \tif (msg-&gt;value() &lt; gripper_laser_threshold_) {\r\n&gt; \t\tanalog_in_left_ = gripper_laser_value_near_;\r\n&gt; \t} else {\r\n&gt; \t\tanalog_in_left_ = gripper_laser_value_far_;\r\n&gt; \t}\r\n&gt; \tnew_data_ = true;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazsim_robotino_thread.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/gazsim_robotino_thread.h\r\n23,24c23,24\r\n&lt; #ifndef __PLUGINS_GAZSIM_ROBOTINO_THREAD_H_\r\n&lt; #define __PLUGINS_GAZSIM_ROBOTINO_THREAD_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZSIM_ROBOTINO_THREAD_H_\r\n&gt; #define _PLUGINS_GAZSIM_ROBOTINO_THREAD_H_\r\n26c26\r\n&lt; #include &lt;list&gt;\r\n---\r\n&gt; #include &quot;..\/msgs\/Float.pb.h&quot;\r\n28c28,29\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n---\r\n&gt; #include &lt;aspect\/blackboard.h&gt;\r\n&gt; #include &lt;aspect\/blocked_timing.h&gt;\r\n32,34d32\r\n&lt; #include &lt;aspect\/blackboard.h&gt;\r\n&lt; #include &lt;aspect\/blocked_timing.h&gt;\r\n&lt; #include &lt;plugins\/gazebo\/aspect\/gazebo.h&gt;\r\n36c34,37\r\n&lt; #include &quot;..\/msgs\/Float.pb.h&quot;\r\n---\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n&gt; #include &lt;plugins\/gazebo\/aspect\/gazebo.h&gt;\r\n&gt; \r\n&gt; #include &lt;list&gt;\r\n39d39\r\n&lt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n40a41\r\n&gt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n43d43\r\n&lt; \r\n47,62c47,61\r\n&lt;   class BatteryInterface;\r\n&lt;   class IMUInterface;\r\n&lt;   class MotorInterface;\r\n&lt;   class RobotinoSensorInterface;\r\n&lt;   class SwitchInterface;\r\n&lt; }\r\n&lt; \r\n&lt; class RobotinoSimThread\r\n&lt; : public fawkes::Thread,\r\n&lt;   public fawkes::ClockAspect,\r\n&lt;   public fawkes::LoggingAspect,\r\n&lt;   public fawkes::ConfigurableAspect,\r\n&lt;   public fawkes::BlackBoardAspect,\r\n&lt;   public fawkes::BlockedTimingAspect,\r\n&lt;   public fawkes::TransformAspect,\r\n&lt;   public fawkes::GazeboAspect\r\n---\r\n&gt; class BatteryInterface;\r\n&gt; class IMUInterface;\r\n&gt; class MotorInterface;\r\n&gt; class RobotinoSensorInterface;\r\n&gt; class SwitchInterface;\r\n&gt; } \/\/ namespace fawkes\r\n&gt; \r\n&gt; class RobotinoSimThread : public fawkes::Thread,\r\n&gt;                           public fawkes::ClockAspect,\r\n&gt;                           public fawkes::LoggingAspect,\r\n&gt;                           public fawkes::ConfigurableAspect,\r\n&gt;                           public fawkes::BlackBoardAspect,\r\n&gt;                           public fawkes::BlockedTimingAspect,\r\n&gt;                           public fawkes::TransformAspect,\r\n&gt;                           public fawkes::GazeboAspect\r\n64,65c63,64\r\n&lt;  public:\r\n&lt;   RobotinoSimThread();\r\n---\r\n&gt; public:\r\n&gt; \tRobotinoSimThread();\r\n67,151c66,152\r\n&lt;   virtual void init();\r\n&lt;   virtual void loop();\r\n&lt;   virtual void finalize();\r\n&lt;  private:\r\n&lt;   \/\/Publisher to send messages to gazebo\r\n&lt;   gazebo::transport::PublisherPtr string_pub_;\r\n&lt;   gazebo::transport::PublisherPtr motor_move_pub_;\r\n&lt; \r\n&lt;   \/\/Suscribers to recieve messages from gazebo\r\n&lt;   gazebo::transport::SubscriberPtr gyro_sub_;\r\n&lt;   gazebo::transport::SubscriberPtr infrared_puck_sensor_sub_;\r\n&lt;   gazebo::transport::SubscriberPtr gripper_laser_left_sensor_sub_;\r\n&lt;   gazebo::transport::SubscriberPtr gripper_laser_right_sensor_sub_;\r\n&lt;   gazebo::transport::SubscriberPtr pos_sub_;\r\n&lt; \r\n&lt;   \/\/Handler functions for incoming messages\r\n&lt;   void on_gyro_msg(ConstVector3dPtr &amp;msg);\r\n&lt;   void on_infrared_puck_sensor_msg(ConstLaserScanStampedPtr &amp;msg);\r\n&lt;   void on_gripper_laser_left_sensor_msg(ConstFloatPtr &amp;msg);\r\n&lt;   void on_gripper_laser_right_sensor_msg(ConstFloatPtr &amp;msg);\r\n&lt;   void on_pos_msg(ConstPosePtr &amp;msg);\r\n&lt; \r\n&lt;   \/\/provided interfaces\r\n&lt;   fawkes::RobotinoSensorInterface *sens_if_;\r\n&lt;   fawkes::MotorInterface          *motor_if_;\r\n&lt;   fawkes::SwitchInterface         *switch_if_;\r\n&lt;   fawkes::IMUInterface            *imu_if_;\r\n&lt; \r\n&lt;   \/\/config values\r\n&lt;   std::string cfg_frame_odom_;\r\n&lt;   std::string cfg_frame_base_;\r\n&lt;   double gripper_laser_threshold_;\r\n&lt;   double gripper_laser_value_far_;\r\n&lt;   double gripper_laser_value_near_;\r\n&lt;   bool slippery_wheels_enabled_;\r\n&lt;   double slippery_wheels_threshold_;\r\n&lt;   double moving_speed_factor_;\r\n&lt;   double rotation_speed_factor_;\r\n&lt;   bool have_gripper_sensors_;\r\n&lt;   int gripper_laser_left_pos_;\r\n&lt;   int gripper_laser_right_pos_;\r\n&lt;   int infrared_sensor_index_;\r\n&lt; \r\n&lt;   \/\/Helper variables for motor:\r\n&lt; \r\n&lt;   \/\/current motorMovements\r\n&lt;   float vx_;\r\n&lt;   float vy_;\r\n&lt;   float vomega_;\r\n&lt;   float des_vx_;\r\n&lt;   float des_vy_;\r\n&lt;   float des_vomega_;\r\n&lt;   \/\/last received odom position\r\n&lt;   float x_;\r\n&lt;   float y_;\r\n&lt;   float ori_;\r\n&lt;   float path_length_;\r\n&lt;  \r\n&lt;   \/\/RobotinoSensorInterface values (stored here to write the interfaces only in the loop)\r\n&lt;   bool gyro_available_;\r\n&lt;   int gyro_buffer_size_;\r\n&lt;   int gyro_buffer_index_new_;\r\n&lt;   int gyro_buffer_index_delayed_;\r\n&lt;   fawkes::Time *gyro_timestamp_buffer_;\r\n&lt;   float *gyro_angle_buffer_;\r\n&lt;   float gyro_delay_;\r\n&lt;   float infrared_puck_sensor_dist_;\r\n&lt;   float analog_in_left_;\r\n&lt;   float analog_in_right_;\r\n&lt; \r\n&lt;   \/\/are there new values to write in the interfaces?\r\n&lt;   bool new_data_;\r\n&lt; \r\n&lt;   fawkes::Time last_pos_time_;\r\n&lt;   fawkes::Time last_vel_set_time_;\r\n&lt; \r\n&lt;   \/\/Odometry offset\r\n&lt;   float x_offset_;\r\n&lt;   float y_offset_;\r\n&lt;   float ori_offset_;\r\n&lt; \r\n&lt;   \/\/Helper functions:\r\n&lt;   void process_motor_messages();\r\n&lt;   void send_transroot(double vx, double vy, double omega);\r\n&lt;   bool vel_changed(float before, float after, float relativeThreashold);  \r\n---\r\n&gt; \tvirtual void init();\r\n&gt; \tvirtual void loop();\r\n&gt; \tvirtual void finalize();\r\n&gt; \r\n&gt; private:\r\n&gt; \t\/\/Publisher to send messages to gazebo\r\n&gt; \tgazebo::transport::PublisherPtr string_pub_;\r\n&gt; \tgazebo::transport::PublisherPtr motor_move_pub_;\r\n&gt; \r\n&gt; \t\/\/Suscribers to recieve messages from gazebo\r\n&gt; \tgazebo::transport::SubscriberPtr gyro_sub_;\r\n&gt; \tgazebo::transport::SubscriberPtr infrared_puck_sensor_sub_;\r\n&gt; \tgazebo::transport::SubscriberPtr gripper_laser_left_sensor_sub_;\r\n&gt; \tgazebo::transport::SubscriberPtr gripper_laser_right_sensor_sub_;\r\n&gt; \tgazebo::transport::SubscriberPtr pos_sub_;\r\n&gt; \r\n&gt; \t\/\/Handler functions for incoming messages\r\n&gt; \tvoid on_gyro_msg(ConstVector3dPtr &amp;msg);\r\n&gt; \tvoid on_infrared_puck_sensor_msg(ConstLaserScanStampedPtr &amp;msg);\r\n&gt; \tvoid on_gripper_laser_left_sensor_msg(ConstFloatPtr &amp;msg);\r\n&gt; \tvoid on_gripper_laser_right_sensor_msg(ConstFloatPtr &amp;msg);\r\n&gt; \tvoid on_pos_msg(ConstPosePtr &amp;msg);\r\n&gt; \r\n&gt; \t\/\/provided interfaces\r\n&gt; \tfawkes::RobotinoSensorInterface *sens_if_;\r\n&gt; \tfawkes::MotorInterface *         motor_if_;\r\n&gt; \tfawkes::SwitchInterface *        switch_if_;\r\n&gt; \tfawkes::IMUInterface *           imu_if_;\r\n&gt; \r\n&gt; \t\/\/config values\r\n&gt; \tstd::string cfg_frame_odom_;\r\n&gt; \tstd::string cfg_frame_base_;\r\n&gt; \tstd::string cfg_frame_imu_;\r\n&gt; \tdouble      gripper_laser_threshold_;\r\n&gt; \tdouble      gripper_laser_value_far_;\r\n&gt; \tdouble      gripper_laser_value_near_;\r\n&gt; \tbool        slippery_wheels_enabled_;\r\n&gt; \tdouble      slippery_wheels_threshold_;\r\n&gt; \tdouble      moving_speed_factor_;\r\n&gt; \tdouble      rotation_speed_factor_;\r\n&gt; \tbool        have_gripper_sensors_;\r\n&gt; \tint         gripper_laser_left_pos_;\r\n&gt; \tint         gripper_laser_right_pos_;\r\n&gt; \tint         infrared_sensor_index_;\r\n&gt; \r\n&gt; \t\/\/Helper variables for motor:\r\n&gt; \r\n&gt; \t\/\/current motorMovements\r\n&gt; \tfloat vx_;\r\n&gt; \tfloat vy_;\r\n&gt; \tfloat vomega_;\r\n&gt; \tfloat des_vx_;\r\n&gt; \tfloat des_vy_;\r\n&gt; \tfloat des_vomega_;\r\n&gt; \t\/\/last received odom position\r\n&gt; \tfloat x_;\r\n&gt; \tfloat y_;\r\n&gt; \tfloat ori_;\r\n&gt; \tfloat path_length_;\r\n&gt; \r\n&gt; \t\/\/RobotinoSensorInterface values (stored here to write the interfaces only in the loop)\r\n&gt; \tbool          gyro_available_;\r\n&gt; \tint           gyro_buffer_size_;\r\n&gt; \tint           gyro_buffer_index_new_;\r\n&gt; \tint           gyro_buffer_index_delayed_;\r\n&gt; \tfawkes::Time *gyro_timestamp_buffer_;\r\n&gt; \tfloat *       gyro_angle_buffer_;\r\n&gt; \tfloat         gyro_delay_;\r\n&gt; \tfloat         infrared_puck_sensor_dist_;\r\n&gt; \tfloat         analog_in_left_;\r\n&gt; \tfloat         analog_in_right_;\r\n&gt; \r\n&gt; \t\/\/are there new values to write in the interfaces?\r\n&gt; \tbool new_data_;\r\n&gt; \r\n&gt; \tfawkes::Time last_pos_time_;\r\n&gt; \tfawkes::Time last_vel_set_time_;\r\n&gt; \r\n&gt; \t\/\/Odometry offset\r\n&gt; \tfloat x_offset_;\r\n&gt; \tfloat y_offset_;\r\n&gt; \tfloat ori_offset_;\r\n&gt; \r\n&gt; \t\/\/Helper functions:\r\n&gt; \tvoid process_motor_messages();\r\n&gt; \tvoid send_transroot(double vx, double vy, double omega);\r\n&gt; \tbool vel_changed(float before, float after, float relativeThreashold);\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-robotino\/Makefile\r\n27,31c27,31\r\n&lt; LIBS_gazsim_robotino = fawkescore fawkesutils fawkesaspects fvutils \\\r\n&lt; \t\tfawkestf fawkesinterface fawkesblackboard \\\r\n&lt; \t\tBatteryInterface RobotinoSensorInterface MotorInterface \\\r\n&lt; \t\tPosition3DInterface IMUInterface SwitchInterface \\\r\n&lt; \t\tfawkesgazeboaspect gazsim_msgs \\\r\n---\r\n&gt; LIBS_gazsim_robotino = m fawkescore fawkesutils fawkesaspects fvutils \\\r\n&gt;                        fawkestf fawkesinterface fawkesblackboard \\\r\n&gt;                        BatteryInterface RobotinoSensorInterface MotorInterface \\\r\n&gt;                        Position3DInterface IMUInterface SwitchInterface \\\r\n&gt;                        fawkesgazeboaspect gazsim_msgs \\\r\n35a36\r\n&gt; PLUGINS_all = $(PLUGINDIR)\/gazsim-robotino.so\r\n43c44\r\n&lt;   PLUGINS_all = $(PLUGINDIR)\/gazsim-robotino.so\r\n---\r\n&gt;   PLUGINS_build = $(PLUGINS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_plugin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_plugin.cpp\r\n23a24\r\n&gt; \r\n33,34c34,35\r\n&lt;  public:\r\n&lt;   \/** Constructor.\r\n---\r\n&gt; public:\r\n&gt; \t\/** Constructor.\r\n37,40c38,41\r\n&lt;   GazsimTimesourcePlugin(Configuration *config) : Plugin(config)\r\n&lt;   {\r\n&lt;     thread_list.push_back(new GazsimTimesourceThread());\r\n&lt;   }\r\n---\r\n&gt; \texplicit GazsimTimesourcePlugin(Configuration *config) : Plugin(config)\r\n&gt; \t{\r\n&gt; \t\tthread_list.push_back(new GazsimTimesourceThread());\r\n&gt; \t}\r\n42d42\r\n&lt; \r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_source.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_source.cpp\r\n31c31\r\n&lt; GazsimTimesource::GazsimTimesource(Clock* clock)\r\n---\r\n&gt; GazsimTimesource::GazsimTimesource(Clock *clock)\r\n33c33\r\n&lt;   clock_ = clock;\r\n---\r\n&gt; \tclock_ = clock;\r\n35,38c35,38\r\n&lt;   last_sim_time_ = get_system_time();\r\n&lt;   last_real_time_factor_ = 1.0;\r\n&lt;   clock_-&gt;get_systime(&amp;last_sys_recv_time_);\r\n&lt;   \/\/registration will be done by plugin\r\n---\r\n&gt; \tlast_sim_time_         = get_system_time();\r\n&gt; \tlast_real_time_factor_ = 1.0;\r\n&gt; \tclock_-&gt;get_systime(&amp;last_sys_recv_time_);\r\n&gt; \t\/\/registration will be done by plugin\r\n43d42\r\n&lt; \r\n52c51\r\n&lt; GazsimTimesource::get_time(timeval* tv) const\r\n---\r\n&gt; GazsimTimesource::get_time(timeval *tv) const\r\n54,62c53,62\r\n&lt;   \/\/I do not use the Time - operator here because this would recursively call get_time\r\n&lt;   timeval now = get_system_time();\r\n&lt;   timeval interval = subtract(now, last_sys_recv_time_);  \r\n&lt; \r\n&lt;   \/\/doing this: timeval estimated_sim_interval = interval * last_real_time_factor_;\r\n&lt;   timeval estimated_sim_interval;\r\n&lt;   estimated_sim_interval.tv_usec = last_real_time_factor_ * (interval.tv_sec * 1000000  + interval.tv_usec);\r\n&lt;   estimated_sim_interval.tv_sec = estimated_sim_interval.tv_usec \/ 1000000;\r\n&lt;   estimated_sim_interval.tv_usec -= estimated_sim_interval.tv_sec * 1000000;\r\n---\r\n&gt; \t\/\/I do not use the Time - operator here because this would recursively call get_time\r\n&gt; \ttimeval now      = get_system_time();\r\n&gt; \ttimeval interval = subtract(now, last_sys_recv_time_);\r\n&gt; \r\n&gt; \t\/\/doing this: timeval estimated_sim_interval = interval * last_real_time_factor_;\r\n&gt; \ttimeval estimated_sim_interval;\r\n&gt; \testimated_sim_interval.tv_usec =\r\n&gt; \t  last_real_time_factor_ * (interval.tv_sec * 1000000 + interval.tv_usec);\r\n&gt; \testimated_sim_interval.tv_sec = estimated_sim_interval.tv_usec \/ 1000000;\r\n&gt; \testimated_sim_interval.tv_usec -= estimated_sim_interval.tv_sec * 1000000;\r\n64c64\r\n&lt;   timeval estimated_sim_now = add(last_sim_time_, estimated_sim_interval);\r\n---\r\n&gt; \ttimeval estimated_sim_now = add(last_sim_time_, estimated_sim_interval);\r\n66,67c66,67\r\n&lt;   \/\/return\r\n&lt;   *tv =  estimated_sim_now;\r\n---\r\n&gt; \t\/\/return\r\n&gt; \t*tv = estimated_sim_now;\r\n71c71\r\n&lt; GazsimTimesource::conv_to_realtime(const timeval* tv) const\r\n---\r\n&gt; GazsimTimesource::conv_to_realtime(const timeval *tv) const\r\n73c73\r\n&lt;   timeval interval = subtract(*tv, last_sim_time_);\r\n---\r\n&gt; \ttimeval interval = subtract(*tv, last_sim_time_);\r\n75,79c75,80\r\n&lt;   \/\/doing this: timeval est_real_interval = interval \/ last_real_time_factor_;\r\n&lt;   timeval est_real_interval;\r\n&lt;   est_real_interval.tv_usec = (interval.tv_sec * 1000000  + interval.tv_usec) \/ last_real_time_factor_;\r\n&lt;   est_real_interval.tv_sec = est_real_interval.tv_usec \/ 1000000;\r\n&lt;   est_real_interval.tv_usec -= est_real_interval.tv_sec * 1000000;\r\n---\r\n&gt; \t\/\/doing this: timeval est_real_interval = interval \/ last_real_time_factor_;\r\n&gt; \ttimeval est_real_interval;\r\n&gt; \test_real_interval.tv_usec =\r\n&gt; \t  (interval.tv_sec * 1000000 + interval.tv_usec) \/ last_real_time_factor_;\r\n&gt; \test_real_interval.tv_sec = est_real_interval.tv_usec \/ 1000000;\r\n&gt; \test_real_interval.tv_usec -= est_real_interval.tv_sec * 1000000;\r\n81,82c82,83\r\n&lt;   timeval result = add(last_sys_recv_time_, est_real_interval);\r\n&lt;   return result;\r\n---\r\n&gt; \ttimeval result = add(last_sys_recv_time_, est_real_interval);\r\n&gt; \treturn result;\r\n86c87\r\n&lt; GazsimTimesource::conv_native_to_exttime(const timeval* tv) const\r\n---\r\n&gt; GazsimTimesource::conv_native_to_exttime(const timeval *tv) const\r\n88,95c89,96\r\n&lt;   timeval t_offset    = subtract(*tv, last_native_sim_time_);\r\n&lt;   double  offset      = t_offset.tv_sec + t_offset.tv_usec \/ 1000000.f;\r\n&lt;   long    offset_sec  = ::ceil(offset);\r\n&lt;   long    offset_usec = ::round(offset - offset_sec) * 1000000;\r\n&lt; \r\n&lt;   timeval rv;\r\n&lt;   rv.tv_sec  = last_sim_time_.tv_sec  + offset_sec;\r\n&lt;   rv.tv_usec = last_sim_time_.tv_usec + offset_usec;\r\n---\r\n&gt; \ttimeval t_offset    = subtract(*tv, last_native_sim_time_);\r\n&gt; \tdouble  offset      = t_offset.tv_sec + t_offset.tv_usec \/ 1000000.f;\r\n&gt; \tlong    offset_sec  = ::ceil(offset);\r\n&gt; \tlong    offset_usec = ::round(offset - offset_sec) * 1000000;\r\n&gt; \r\n&gt; \ttimeval rv;\r\n&gt; \trv.tv_sec  = last_sim_time_.tv_sec + offset_sec;\r\n&gt; \trv.tv_usec = last_sim_time_.tv_usec + offset_usec;\r\n97c98\r\n&lt;   return rv;\r\n---\r\n&gt; \treturn rv;\r\n106,111c107,112\r\n&lt;   \/\/we do not want to correct time back\r\n&lt;   get_time(&amp;last_sim_time_);\r\n&lt;   last_real_time_factor_ = msg-&gt;real_time_factor();\r\n&lt;   clock_-&gt;get_systime(&amp;last_sys_recv_time_);\r\n&lt;   last_native_sim_time_.tv_sec  = msg-&gt;sim_time_sec();\r\n&lt;   last_native_sim_time_.tv_usec = msg-&gt;sim_time_nsec() \/ 1000;\r\n---\r\n&gt; \t\/\/we do not want to correct time back\r\n&gt; \tget_time(&amp;last_sim_time_);\r\n&gt; \tlast_real_time_factor_ = msg-&gt;real_time_factor();\r\n&gt; \tclock_-&gt;get_systime(&amp;last_sys_recv_time_);\r\n&gt; \tlast_native_sim_time_.tv_sec  = msg-&gt;sim_time_sec();\r\n&gt; \tlast_native_sim_time_.tv_usec = msg-&gt;sim_time_nsec() \/ 1000;\r\n117,119c118,120\r\n&lt;   timeval now_timeval;\r\n&lt;   gettimeofday(&amp;now_timeval,NULL);\r\n&lt;   return now_timeval;\r\n---\r\n&gt; \ttimeval now_timeval;\r\n&gt; \tgettimeofday(&amp;now_timeval, NULL);\r\n&gt; \treturn now_timeval;\r\n125,133c126,133\r\n&lt;   timeval res;\r\n&lt;   res.tv_sec = a.tv_sec + b.tv_sec;\r\n&lt;   res.tv_usec = a.tv_usec + b.tv_usec;\r\n&lt;   if(res.tv_usec &gt; 1000000)\r\n&lt;   {\r\n&lt;     res.tv_usec -= 1000000;\r\n&lt;     res.tv_sec++;\r\n&lt;   }\r\n&lt;   return res;\r\n---\r\n&gt; \ttimeval res;\r\n&gt; \tres.tv_sec  = a.tv_sec + b.tv_sec;\r\n&gt; \tres.tv_usec = a.tv_usec + b.tv_usec;\r\n&gt; \tif (res.tv_usec &gt; 1000000) {\r\n&gt; \t\tres.tv_usec -= 1000000;\r\n&gt; \t\tres.tv_sec++;\r\n&gt; \t}\r\n&gt; \treturn res;\r\n139,150c139,147\r\n&lt;   timeval res;\r\n&lt;   res.tv_sec = a.tv_sec - b.tv_sec;\r\n&lt;   if(a.tv_usec &gt;= b.tv_usec)\r\n&lt;   {\r\n&lt;     res.tv_usec = a.tv_usec - b.tv_usec;\r\n&lt;   }\r\n&lt;   else\r\n&lt;   {\r\n&lt;     res.tv_usec = 1000000 + a.tv_usec - b.tv_usec;\r\n&lt;     res.tv_sec--;\r\n&lt;   }\r\n&lt;   return res;\r\n---\r\n&gt; \ttimeval res;\r\n&gt; \tres.tv_sec = a.tv_sec - b.tv_sec;\r\n&gt; \tif (a.tv_usec &gt;= b.tv_usec) {\r\n&gt; \t\tres.tv_usec = a.tv_usec - b.tv_usec;\r\n&gt; \t} else {\r\n&gt; \t\tres.tv_usec = 1000000 + a.tv_usec - b.tv_usec;\r\n&gt; \t\tres.tv_sec--;\r\n&gt; \t}\r\n&gt; \treturn res;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_source.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_source.h\r\n23,26d22\r\n&lt; #include &lt;boost\/asio.hpp&gt;\r\n&lt; #include &lt;utils\/time\/timesource.h&gt;\r\n&lt; #include &lt;utils\/time\/clock.h&gt;\r\n&lt; \r\n29,30c25,26\r\n&lt; #ifndef __GAZEBO_TIMESOURCE_H_\r\n&lt; #define __GAZEBO_TIMESOURCE_H_\r\n---\r\n&gt; #include &lt;utils\/time\/clock.h&gt;\r\n&gt; #include &lt;utils\/time\/timesource.h&gt;\r\n31a28,31\r\n&gt; #include &lt;boost\/asio.hpp&gt;\r\n&gt; \r\n&gt; #ifndef _GAZEBO_TIMESOURCE_H_\r\n&gt; #\tdefine _GAZEBO_TIMESOURCE_H_\r\n35,37c35,36\r\n&lt; namespace fawkes\r\n&lt; {\r\n&lt;   \/** @class GazsimTimesource\r\n---\r\n&gt; namespace fawkes {\r\n&gt; \/** @class GazsimTimesource\r\n41,70c40,68\r\n&lt;   class GazsimTimesource : public TimeSource\r\n&lt;   {\r\n&lt;   public:\r\n&lt;     \/\/Constructor\r\n&lt;     GazsimTimesource(Clock* clock);\r\n&lt;     \/\/\/Destructor\r\n&lt;    ~GazsimTimesource();\r\n&lt; \r\n&lt;     virtual void get_time(timeval* tv) const;\r\n&lt;     virtual timeval conv_to_realtime(const timeval* tv) const;\r\n&lt;     virtual timeval conv_native_to_exttime(const timeval* tv) const;\r\n&lt; \r\n&lt;     \/\/\/ store data from gazebo time message\r\n&lt;     void on_time_sync_msg(ConstSimTimePtr &amp;msg);\r\n&lt; \r\n&lt;   private:\r\n&lt;     timeval get_system_time() const;\r\n&lt;     timeval add(timeval a, timeval b) const;\r\n&lt;     timeval subtract(timeval a, timeval b) const;\r\n&lt; \r\n&lt;   private:\r\n&lt;     Clock* clock_;\r\n&lt; \r\n&lt;     \/\/from last msg all in sec\r\n&lt;     timeval last_sim_time_;\r\n&lt;     timeval last_sys_recv_time_;\r\n&lt;     double  last_real_time_factor_;\r\n&lt;     timeval last_native_sim_time_;\r\n&lt; \r\n&lt;   };\r\n---\r\n&gt; class GazsimTimesource : public TimeSource\r\n&gt; {\r\n&gt; public:\r\n&gt; \t\/\/Constructor\r\n&gt; \tGazsimTimesource(Clock *clock);\r\n&gt; \t\/\/\/Destructor\r\n&gt; \t~GazsimTimesource();\r\n&gt; \r\n&gt; \tvirtual void    get_time(timeval *tv) const;\r\n&gt; \tvirtual timeval conv_to_realtime(const timeval *tv) const;\r\n&gt; \tvirtual timeval conv_native_to_exttime(const timeval *tv) const;\r\n&gt; \r\n&gt; \t\/\/\/ store data from gazebo time message\r\n&gt; \tvoid on_time_sync_msg(ConstSimTimePtr &amp;msg);\r\n&gt; \r\n&gt; private:\r\n&gt; \ttimeval get_system_time() const;\r\n&gt; \ttimeval add(timeval a, timeval b) const;\r\n&gt; \ttimeval subtract(timeval a, timeval b) const;\r\n&gt; \r\n&gt; private:\r\n&gt; \tClock *clock_;\r\n&gt; \r\n&gt; \t\/\/from last msg all in sec\r\n&gt; \ttimeval last_sim_time_;\r\n&gt; \ttimeval last_sys_recv_time_;\r\n&gt; \tdouble  last_real_time_factor_;\r\n&gt; \ttimeval last_native_sim_time_;\r\n&gt; };\r\n72c70\r\n&lt; }\r\n---\r\n&gt; } \/\/ namespace fawkes\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_thread.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_thread.cpp\r\n33,34c33,34\r\n&lt;   : Thread(&quot;GazsimTimesourceThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&lt;     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_WORLDSTATE)\r\n---\r\n&gt; : Thread(&quot;GazsimTimesourceThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&gt;   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_WORLDSTATE)\r\n42,43c42,43\r\n&lt; \r\n&lt; void GazsimTimesourceThread::init()\r\n---\r\n&gt; void\r\n&gt; GazsimTimesourceThread::init()\r\n45c45\r\n&lt;   logger-&gt;log_info(name(), &quot;GazsimTimesource initializing&quot;);\r\n---\r\n&gt; \tlogger-&gt;log_info(name(), &quot;GazsimTimesource initializing&quot;);\r\n47,48c47,50\r\n&lt;   \/\/Create Subscriber\r\n&lt;   time_sync_sub_ = gazebo_world_node-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/time&quot;), &amp;GazsimTimesourceThread::on_time_sync_msg, this);\r\n---\r\n&gt; \t\/\/Create Subscriber\r\n&gt; \ttime_sync_sub_ = gazebo_world_node-&gt;Subscribe(config-&gt;get_string(&quot;\/gazsim\/topics\/time&quot;),\r\n&gt; \t                                              &amp;GazsimTimesourceThread::on_time_sync_msg,\r\n&gt; \t                                              this);\r\n50,51c52,53\r\n&lt;   \/\/Create Time Source\r\n&lt;   time_source_ = new GazsimTimesource(clock);\r\n---\r\n&gt; \t\/\/Create Time Source\r\n&gt; \ttime_source_ = new GazsimTimesource(clock);\r\n53,54c55,56\r\n&lt;   \/\/register timesource and make it default\r\n&lt;   clock-&gt;register_ext_timesource(time_source_, true);\r\n---\r\n&gt; \t\/\/register timesource and make it default\r\n&gt; \tclock-&gt;register_ext_timesource(time_source_, true);\r\n57,58c59,60\r\n&lt; \r\n&lt; void GazsimTimesourceThread::finalize()\r\n---\r\n&gt; void\r\n&gt; GazsimTimesourceThread::finalize()\r\n60,62c62,64\r\n&lt;   \/\/remove time source\r\n&lt;   clock-&gt;remove_ext_timesource(time_source_);\r\n&lt;   delete time_source_;\r\n---\r\n&gt; \t\/\/remove time source\r\n&gt; \tclock-&gt;remove_ext_timesource(time_source_);\r\n&gt; \tdelete time_source_;\r\n65,66c67,68\r\n&lt; \r\n&lt; void GazsimTimesourceThread::loop()\r\n---\r\n&gt; void\r\n&gt; GazsimTimesourceThread::loop()\r\n68c70\r\n&lt;   \/\/nothing interesting\r\n---\r\n&gt; \t\/\/nothing interesting\r\n71c73,74\r\n&lt; void GazsimTimesourceThread::on_time_sync_msg(ConstSimTimePtr &amp;msg)\r\n---\r\n&gt; void\r\n&gt; GazsimTimesourceThread::on_time_sync_msg(ConstSimTimePtr &amp;msg)\r\n73,76c76,79\r\n&lt;   \/\/ logger-&gt;log_info(name(), &quot;Got Simulation Time&quot;);\r\n&lt;   \r\n&lt;   \/\/provide time source with newest message\r\n&lt;   time_source_-&gt;on_time_sync_msg(msg);\r\n---\r\n&gt; \t\/\/ logger-&gt;log_info(name(), &quot;Got Simulation Time&quot;);\r\n&gt; \r\n&gt; \t\/\/provide time source with newest message\r\n&gt; \ttime_source_-&gt;on_time_sync_msg(msg);\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_thread.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/gazsim_timesource_thread.h\r\n23,24c23,24\r\n&lt; #ifndef __PLUGINS_GAZSIM__TIMESOURCE_THREAD_H_\r\n&lt; #define __PLUGINS_GAZSIM__TIMESOURCE_THREAD_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZSIMTIMESOURCE_THREAD_H__\r\n&gt; #define _PLUGINS_GAZSIMTIMESOURCE_THREAD_H__\r\n26c26,29\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n---\r\n&gt; #include &quot;..\/msgs\/SimTime.pb.h&quot;\r\n&gt; #include &quot;gazsim_timesource_source.h&quot;\r\n&gt; \r\n&gt; #include &lt;aspect\/blocked_timing.h&gt;\r\n28d30\r\n&lt; #include &lt;aspect\/logging.h&gt;\r\n30,31c32,33\r\n&lt; #include &lt;aspect\/blocked_timing.h&gt;\r\n&lt; #include &lt;boost\/asio.hpp&gt;\r\n---\r\n&gt; #include &lt;aspect\/logging.h&gt;\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n33d34\r\n&lt; #include &lt;gazebo\/physics\/physics.hh&gt;\r\n36,37c37,38\r\n&lt; #include &quot;gazsim_timesource_source.h&quot;\r\n&lt; #include &quot;..\/msgs\/SimTime.pb.h&quot;\r\n---\r\n&gt; #include &lt;boost\/asio.hpp&gt;\r\n&gt; #include &lt;gazebo\/physics\/physics.hh&gt;\r\n41,47c42,47\r\n&lt; class GazsimTimesourceThread\r\n&lt; : public fawkes::Thread,\r\n&lt;   public fawkes::ClockAspect,\r\n&lt;   public fawkes::BlockedTimingAspect,\r\n&lt;   public fawkes::ConfigurableAspect,\r\n&lt;   public fawkes::LoggingAspect,\r\n&lt;   public fawkes::GazeboAspect\r\n---\r\n&gt; class GazsimTimesourceThread : public fawkes::Thread,\r\n&gt;                                public fawkes::ClockAspect,\r\n&gt;                                public fawkes::BlockedTimingAspect,\r\n&gt;                                public fawkes::ConfigurableAspect,\r\n&gt;                                public fawkes::LoggingAspect,\r\n&gt;                                public fawkes::GazeboAspect\r\n49,62c49,59\r\n&lt;  public:\r\n&lt;   GazsimTimesourceThread();\r\n&lt;   ~GazsimTimesourceThread();\r\n&lt; \r\n&lt;   virtual void init();\r\n&lt;   virtual void loop();\r\n&lt;   virtual void finalize();\r\n&lt; \r\n&lt;  private:\r\n&lt;   \/\/Timesource to give the fawkes clock\r\n&lt;   fawkes::GazsimTimesource* time_source_;\r\n&lt; \r\n&lt;   \/\/subscriber to get time msgs from\r\n&lt;   gazebo::transport::SubscriberPtr time_sync_sub_;\r\n---\r\n&gt; public:\r\n&gt; \tGazsimTimesourceThread();\r\n&gt; \t~GazsimTimesourceThread();\r\n&gt; \r\n&gt; \tvirtual void init();\r\n&gt; \tvirtual void loop();\r\n&gt; \tvirtual void finalize();\r\n&gt; \r\n&gt; private:\r\n&gt; \t\/\/Timesource to give the fawkes clock\r\n&gt; \tfawkes::GazsimTimesource *time_source_;\r\n64,65c61,62\r\n&lt;   \/\/handler\r\n&lt;   void on_time_sync_msg(ConstSimTimePtr &amp;msg);\r\n---\r\n&gt; \t\/\/subscriber to get time msgs from\r\n&gt; \tgazebo::transport::SubscriberPtr time_sync_sub_;\r\n66a64,65\r\n&gt; \t\/\/handler\r\n&gt; \tvoid on_time_sync_msg(ConstSimTimePtr &amp;msg);\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-timesource\/Makefile\r\n25d24\r\n&lt; \r\n31c30,31\r\n&lt; OBJS_all = $(OBJS_gazsim_timesource)\r\n---\r\n&gt; OBJS_all    = $(OBJS_gazsim_timesource)\r\n&gt; PLUGINS_all = $(PLUGINDIR)\/gazsim-timesource.so\r\n38,39c38,39\r\n&lt; \t     $(call boost-libs-cflags,$(REQ_BOOST_LIBS)) \\\r\n&lt; \t     $(CFLAGS_GAZEBO)\r\n---\r\n&gt;              $(call boost-libs-cflags,$(REQ_BOOST_LIBS)) \\\r\n&gt;              $(CFLAGS_GAZEBO)\r\n41,42c41,42\r\n&lt; \t     $(call boost-libs-ldflags,$(REQ_BOOST_LIBS)) \\\r\n&lt; \t     $(LDFLAGS_GAZEBO)\r\n---\r\n&gt;              $(call boost-libs-ldflags,$(REQ_BOOST_LIBS)) \\\r\n&gt;              $(LDFLAGS_GAZEBO)\r\n44c44\r\n&lt;   PLUGINS_all = $(PLUGINDIR)\/gazsim-timesource.so\r\n---\r\n&gt;   PLUGINS_build = $(PLUGINS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-vis-localization\/gazsim_vis_localization_plugin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-vis-localization\/gazsim_vis_localization_plugin.cpp\r\n21,22d20\r\n&lt; #include &lt;core\/plugin.h&gt;\r\n&lt; \r\n24a23,24\r\n&gt; #include &lt;core\/plugin.h&gt;\r\n&gt; \r\n34,36c34,35\r\n&lt;  public:\r\n&lt; \r\n&lt;   \/** Constructor.\r\n---\r\n&gt; public:\r\n&gt; \t\/** Constructor.\r\n39,43c38,41\r\n&lt;   GazsimVisLocalizationPlugin(Configuration *config)\r\n&lt;     : Plugin(config)\r\n&lt;   {\r\n&lt;     thread_list.push_back(new VisLocalizationThread());\r\n&lt;   }\r\n---\r\n&gt; \texplicit GazsimVisLocalizationPlugin(Configuration *config) : Plugin(config)\r\n&gt; \t{\r\n&gt; \t\tthread_list.push_back(new VisLocalizationThread());\r\n&gt; \t}\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-vis-localization\/gazsim_vis_localization_thread.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-vis-localization\/gazsim_vis_localization_thread.cpp\r\n22a23,24\r\n&gt; #include &lt;aspect\/logging.h&gt;\r\n&gt; #include &lt;interfaces\/Position3DInterface.h&gt;\r\n24,25d25\r\n&lt; #include &lt;stdio.h&gt;\r\n&lt; #include &lt;cmath&gt;\r\n28,30c28\r\n&lt; #include &lt;interfaces\/Position3DInterface.h&gt;\r\n&lt; \r\n&lt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n---\r\n&gt; #include &lt;cmath&gt;\r\n31a30\r\n&gt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n33c32\r\n&lt; #include &lt;aspect\/logging.h&gt;\r\n---\r\n&gt; #include &lt;stdio.h&gt;\r\n45,46c44,45\r\n&lt;   : Thread(&quot;VisLocalizationThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&lt;     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_WORLDSTATE)\r\n---\r\n&gt; : Thread(&quot;VisLocalizationThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&gt;   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_WORLDSTATE)\r\n50c49,50\r\n&lt; void VisLocalizationThread::init()\r\n---\r\n&gt; void\r\n&gt; VisLocalizationThread::init()\r\n52c52\r\n&lt;   logger-&gt;log_debug(name(), &quot;Initializing Visualization of the Localization&quot;);\r\n---\r\n&gt; \tlogger-&gt;log_debug(name(), &quot;Initializing Visualization of the Localization&quot;);\r\n54,63c54,63\r\n&lt;   \/\/read config values\r\n&lt;   update_rate_ = config-&gt;get_float(&quot;\/gazsim\/visualization\/localization\/update-rate&quot;);\r\n&lt;   robot_name_ = config-&gt;get_string(&quot;\/gazsim\/robot-name&quot;);\r\n&lt;   label_script_name_ = config-&gt;get_string(&quot;\/gazsim\/visualization\/label-script-name&quot;);\r\n&lt;   arrow_script_name_ = config-&gt;get_string(&quot;\/gazsim\/visualization\/label-arrow-name&quot;);\r\n&lt;   location_scripts_ = config-&gt;get_string(&quot;\/gazsim\/visualization\/location-scripts&quot;);\r\n&lt;   location_textures_ = config-&gt;get_string(&quot;\/gazsim\/visualization\/location-textures&quot;);\r\n&lt;   parent_name_ = config-&gt;get_string(&quot;\/gazsim\/visualization\/localization\/parent-name&quot;);\r\n&lt;   label_size_ = config-&gt;get_float(&quot;\/gazsim\/visualization\/localization\/label-size&quot;);\r\n&lt;   label_height_ = config-&gt;get_float(&quot;\/gazsim\/visualization\/localization\/label-height&quot;);\r\n---\r\n&gt; \t\/\/read config values\r\n&gt; \tupdate_rate_       = config-&gt;get_float(&quot;\/gazsim\/visualization\/localization\/update-rate&quot;);\r\n&gt; \trobot_name_        = config-&gt;get_string(&quot;\/gazsim\/robot-name&quot;);\r\n&gt; \tlabel_script_name_ = config-&gt;get_string(&quot;\/gazsim\/visualization\/label-script-name&quot;);\r\n&gt; \tarrow_script_name_ = config-&gt;get_string(&quot;\/gazsim\/visualization\/label-arrow-name&quot;);\r\n&gt; \tlocation_scripts_  = config-&gt;get_string(&quot;\/gazsim\/visualization\/location-scripts&quot;);\r\n&gt; \tlocation_textures_ = config-&gt;get_string(&quot;\/gazsim\/visualization\/location-textures&quot;);\r\n&gt; \tparent_name_       = config-&gt;get_string(&quot;\/gazsim\/visualization\/localization\/parent-name&quot;);\r\n&gt; \tlabel_size_        = config-&gt;get_float(&quot;\/gazsim\/visualization\/localization\/label-size&quot;);\r\n&gt; \tlabel_height_      = config-&gt;get_float(&quot;\/gazsim\/visualization\/localization\/label-height&quot;);\r\n65c65\r\n&lt;   last_update_time_ = clock-&gt;now().in_sec();\r\n---\r\n&gt; \tlast_update_time_ = clock-&gt;now().in_sec();\r\n67,68c67,68\r\n&lt;   \/\/open interface\r\n&lt;   pose_if_ = blackboard-&gt;open_for_reading&lt;Position3DInterface&gt;(&quot;Pose&quot;);\r\n---\r\n&gt; \t\/\/open interface\r\n&gt; \tpose_if_ = blackboard-&gt;open_for_reading&lt;Position3DInterface&gt;(&quot;Pose&quot;);\r\n70,71c70,71\r\n&lt;   \/\/create publisher\r\n&lt;   visual_publisher_ = gazebo_world_node-&gt;Advertise&lt;gazebo::msgs::Visual&gt;(&quot;~\/visual&quot;, 5);\r\n---\r\n&gt; \t\/\/create publisher\r\n&gt; \tvisual_publisher_ = gazebo_world_node-&gt;Advertise&lt;gazebo::msgs::Visual&gt;(&quot;~\/visual&quot;, 5);\r\n74c74,75\r\n&lt; void VisLocalizationThread::finalize()\r\n---\r\n&gt; void\r\n&gt; VisLocalizationThread::finalize()\r\n76c77\r\n&lt;   blackboard-&gt;close(pose_if_);\r\n---\r\n&gt; \tblackboard-&gt;close(pose_if_);\r\n79c80,81\r\n&lt; void VisLocalizationThread::loop()\r\n---\r\n&gt; void\r\n&gt; VisLocalizationThread::loop()\r\n81,105c83,105\r\n&lt;   \/\/visualize the estimated position of the robot every few seconds\r\n&lt;   fawkes::Time new_time = clock-&gt;now();\r\n&lt;   double time_elapsed = new_time.in_sec() - last_update_time_.in_sec();\r\n&lt;   if(time_elapsed &gt; 1 \/ update_rate_)\r\n&lt;   {\r\n&lt;     last_update_time_ = new_time;\r\n&lt; \r\n&lt;     \/\/read pose\r\n&lt;     pose_if_-&gt;read();\r\n&lt;     double x = pose_if_-&gt;translation(0);\r\n&lt;     double y = pose_if_-&gt;translation(1);\r\n&lt;     \/\/calculate ori from quaternion in interface\r\n&lt;     double* quat = pose_if_-&gt;rotation();\r\n&lt;     double ori = tf::get_yaw(tf::Quaternion(quat&#x5B;0], quat&#x5B;1], quat&#x5B;2], quat&#x5B;3]));\r\n&lt;     if(std::isnan(ori))\r\n&lt;     {\r\n&lt;       ori = 0.0;\r\n&lt;     }\r\n&lt; \r\n&lt;     \/\/create label with number\r\n&lt;     msgs::Visual msg_number;\r\n&lt;     msg_number.set_name((robot_name_ + &quot;-localization-label&quot;).c_str());\r\n&lt;     msg_number.set_parent_name(parent_name_.c_str());\r\n&lt;     msgs::Geometry *geomMsg = msg_number.mutable_geometry();\r\n&lt;     geomMsg-&gt;set_type(msgs::Geometry::PLANE);\r\n---\r\n&gt; \t\/\/visualize the estimated position of the robot every few seconds\r\n&gt; \tfawkes::Time new_time     = clock-&gt;now();\r\n&gt; \tdouble       time_elapsed = new_time.in_sec() - last_update_time_.in_sec();\r\n&gt; \tif (time_elapsed &gt; 1 \/ update_rate_) {\r\n&gt; \t\tlast_update_time_ = new_time;\r\n&gt; \r\n&gt; \t\t\/\/read pose\r\n&gt; \t\tpose_if_-&gt;read();\r\n&gt; \t\tdouble x = pose_if_-&gt;translation(0);\r\n&gt; \t\tdouble y = pose_if_-&gt;translation(1);\r\n&gt; \t\t\/\/calculate ori from quaternion in interface\r\n&gt; \t\tdouble *quat = pose_if_-&gt;rotation();\r\n&gt; \t\tdouble  ori  = tf::get_yaw(tf::Quaternion(quat&#x5B;0], quat&#x5B;1], quat&#x5B;2], quat&#x5B;3]));\r\n&gt; \t\tif (std::isnan(ori)) {\r\n&gt; \t\t\tori = 0.0;\r\n&gt; \t\t}\r\n&gt; \r\n&gt; \t\t\/\/create label with number\r\n&gt; \t\tmsgs::Visual msg_number;\r\n&gt; \t\tmsg_number.set_name((robot_name_ + &quot;-localization-label&quot;).c_str());\r\n&gt; \t\tmsg_number.set_parent_name(parent_name_.c_str());\r\n&gt; \t\tmsgs::Geometry *geomMsg = msg_number.mutable_geometry();\r\n&gt; \t\tgeomMsg-&gt;set_type(msgs::Geometry::PLANE);\r\n107,108c107,109\r\n&lt;     msgs::Set(geomMsg-&gt;mutable_plane()-&gt;mutable_normal(), ignition::math::Vector3d(0.0, 0.0, 1.0));\r\n&lt;     msgs::Set(geomMsg-&gt;mutable_plane()-&gt;mutable_size(), ignition::math::Vector2d(label_size_, label_size_));\r\n---\r\n&gt; \t\tmsgs::Set(geomMsg-&gt;mutable_plane()-&gt;mutable_normal(), ignition::math::Vector3d(0.0, 0.0, 1.0));\r\n&gt; \t\tmsgs::Set(geomMsg-&gt;mutable_plane()-&gt;mutable_size(),\r\n&gt; \t\t          ignition::math::Vector2d(label_size_, label_size_));\r\n110,112c111,113\r\n&lt;     msgs::Set(geomMsg-&gt;mutable_plane()-&gt;mutable_normal(), math::Vector3(0.0, 0.0, 1.0));\r\n&lt;     msgs::Set(geomMsg-&gt;mutable_plane()-&gt;mutable_size(), math::Vector2d(label_size_, label_size_));\r\n&lt;     msg_number.set_transparency(0.2);  \r\n---\r\n&gt; \t\tmsgs::Set(geomMsg-&gt;mutable_plane()-&gt;mutable_normal(), math::Vector3(0.0, 0.0, 1.0));\r\n&gt; \t\tmsgs::Set(geomMsg-&gt;mutable_plane()-&gt;mutable_size(), math::Vector2d(label_size_, label_size_));\r\n&gt; \t\tmsg_number.set_transparency(0.2);\r\n114c115\r\n&lt;     msg_number.set_cast_shadows(false);\r\n---\r\n&gt; \t\tmsg_number.set_cast_shadows(false);\r\n116c117\r\n&lt;     msgs::Set(msg_number.mutable_pose(), ignition::math::Pose3d(x, y, label_height_, 0, 0, 0));\r\n---\r\n&gt; \t\tmsgs::Set(msg_number.mutable_pose(), ignition::math::Pose3d(x, y, label_height_, 0, 0, 0));\r\n118c119\r\n&lt;     msgs::Set(msg_number.mutable_pose(), math::Pose(x, y, label_height_, 0, 0, 0));\r\n---\r\n&gt; \t\tmsgs::Set(msg_number.mutable_pose(), math::Pose(x, y, label_height_, 0, 0, 0));\r\n120,123c121,124\r\n&lt;     msgs::Material::Script* script = msg_number.mutable_material()-&gt;mutable_script();\r\n&lt;     script-&gt;add_uri(location_scripts_.c_str());\r\n&lt;     script-&gt;add_uri(location_textures_.c_str());\r\n&lt;     script-&gt;set_name(label_script_name_.c_str());\r\n---\r\n&gt; \t\tmsgs::Material::Script *script = msg_number.mutable_material()-&gt;mutable_script();\r\n&gt; \t\tscript-&gt;add_uri(location_scripts_.c_str());\r\n&gt; \t\tscript-&gt;add_uri(location_textures_.c_str());\r\n&gt; \t\tscript-&gt;set_name(label_script_name_.c_str());\r\n125c126\r\n&lt;     visual_publisher_-&gt;Publish(msg_number);\r\n---\r\n&gt; \t\tvisual_publisher_-&gt;Publish(msg_number);\r\n127c128\r\n&lt;     \/\/create label with direction arrow\r\n---\r\n&gt; \t\t\/\/create label with direction arrow\r\n129,151c130,156\r\n&lt;     msgs::Visual msg_arrow;\r\n&lt;     msg_arrow.set_name((robot_name_ + &quot;-localization-arrow&quot;).c_str());\r\n&lt;     msg_arrow.set_parent_name(parent_name_.c_str());\r\n&lt;     msgs::Geometry *geomArrowMsg = msg_arrow.mutable_geometry();\r\n&lt;     geomArrowMsg-&gt;set_type(msgs::Geometry::PLANE);\r\n&lt; #if GAZEBO_MAJOR_VERSION &gt; 5\r\n&lt;     msgs::Set(geomArrowMsg-&gt;mutable_plane()-&gt;mutable_normal(), ignition::math::Vector3d(0.0, 0.0, 1.0));\r\n&lt;     msgs::Set(geomArrowMsg-&gt;mutable_plane()-&gt;mutable_size(), ignition::math::Vector2d(0.17, 0.17));\r\n&lt; #else\r\n&lt;     msgs::Set(geomArrowMsg-&gt;mutable_plane()-&gt;mutable_normal(), math::Vector3(0.0, 0.0, 1.0));\r\n&lt;     msgs::Set(geomArrowMsg-&gt;mutable_plane()-&gt;mutable_size(), math::Vector2d(0.17, 0.17));\r\n&lt;     msg_arrow.set_transparency(0.4);  \r\n&lt; #endif\r\n&lt;     msg_arrow.set_cast_shadows(false);\r\n&lt; #if GAZEBO_MAJOR_VERSION &gt; 5\r\n&lt;     msgs::Set(msg_arrow.mutable_pose(), ignition::math::Pose3d(x, y, label_height_ + 0.01, 0, 0, ori - \/*turn image right*\/ M_PI \/ 2));\r\n&lt; #else\r\n&lt;     msgs::Set(msg_arrow.mutable_pose(), math::Pose(x, y, label_height_ + 0.01, 0, 0, ori - \/*turn image right*\/ M_PI \/ 2));\r\n&lt; #endif\r\n&lt;     msgs::Material::Script* arrow_script = msg_arrow.mutable_material()-&gt;mutable_script();\r\n&lt;     arrow_script-&gt;add_uri(location_scripts_.c_str());\r\n&lt;     arrow_script-&gt;add_uri(location_textures_.c_str());\r\n&lt;     arrow_script-&gt;set_name(arrow_script_name_.c_str());\r\n---\r\n&gt; \t\tmsgs::Visual msg_arrow;\r\n&gt; \t\tmsg_arrow.set_name((robot_name_ + &quot;-localization-arrow&quot;).c_str());\r\n&gt; \t\tmsg_arrow.set_parent_name(parent_name_.c_str());\r\n&gt; \t\tmsgs::Geometry *geomArrowMsg = msg_arrow.mutable_geometry();\r\n&gt; \t\tgeomArrowMsg-&gt;set_type(msgs::Geometry::PLANE);\r\n&gt; #\tif GAZEBO_MAJOR_VERSION &gt; 5\r\n&gt; \t\tmsgs::Set(geomArrowMsg-&gt;mutable_plane()-&gt;mutable_normal(),\r\n&gt; \t\t          ignition::math::Vector3d(0.0, 0.0, 1.0));\r\n&gt; \t\tmsgs::Set(geomArrowMsg-&gt;mutable_plane()-&gt;mutable_size(), ignition::math::Vector2d(0.17, 0.17));\r\n&gt; #\telse\r\n&gt; \t\tmsgs::Set(geomArrowMsg-&gt;mutable_plane()-&gt;mutable_normal(), math::Vector3(0.0, 0.0, 1.0));\r\n&gt; \t\tmsgs::Set(geomArrowMsg-&gt;mutable_plane()-&gt;mutable_size(), math::Vector2d(0.17, 0.17));\r\n&gt; \t\tmsg_arrow.set_transparency(0.4);\r\n&gt; #\tendif\r\n&gt; \t\tmsg_arrow.set_cast_shadows(false);\r\n&gt; #\tif GAZEBO_MAJOR_VERSION &gt; 5\r\n&gt; \t\tmsgs::Set(msg_arrow.mutable_pose(),\r\n&gt; \t\t          ignition::math::Pose3d(\r\n&gt; \t\t            x, y, label_height_ + 0.01, 0, 0, ori - \/*turn image right*\/ M_PI \/ 2));\r\n&gt; #\telse\r\n&gt; \t\tmsgs::Set(msg_arrow.mutable_pose(),\r\n&gt; \t\t          math::Pose(x, y, label_height_ + 0.01, 0, 0, ori - \/*turn image right*\/ M_PI \/ 2));\r\n&gt; #\tendif\r\n&gt; \t\tmsgs::Material::Script *arrow_script = msg_arrow.mutable_material()-&gt;mutable_script();\r\n&gt; \t\tarrow_script-&gt;add_uri(location_scripts_.c_str());\r\n&gt; \t\tarrow_script-&gt;add_uri(location_textures_.c_str());\r\n&gt; \t\tarrow_script-&gt;set_name(arrow_script_name_.c_str());\r\n153c158\r\n&lt;     visual_publisher_-&gt;Publish(msg_arrow);\r\n---\r\n&gt; \t\tvisual_publisher_-&gt;Publish(msg_arrow);\r\n155c160\r\n&lt;   }\r\n---\r\n&gt; \t}\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-vis-localization\/gazsim_vis_localization_thread.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-vis-localization\/gazsim_vis_localization_thread.h\r\n21,22c21,22\r\n&lt; #ifndef __PLUGINS_GAZSIM_VIS_LOCALIZATION_THREAD_H_\r\n&lt; #define __PLUGINS_GAZSIM_VIS_LOCALIZATION_THREAD_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZSIM_VIS_LOCALIZATION_THREAD_H_\r\n&gt; #define _PLUGINS_GAZSIM_VIS_LOCALIZATION_THREAD_H_\r\n24c24,25\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n---\r\n&gt; #include &lt;aspect\/blackboard.h&gt;\r\n&gt; #include &lt;aspect\/blocked_timing.h&gt;\r\n28,29c29\r\n&lt; #include &lt;aspect\/blackboard.h&gt;\r\n&lt; #include &lt;aspect\/blocked_timing.h&gt;\r\n---\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n32a33\r\n&gt; \r\n36d36\r\n&lt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n37a38\r\n&gt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n40d40\r\n&lt; \r\n42c42\r\n&lt;   class Position3DInterface;\r\n---\r\n&gt; class Position3DInterface;\r\n45,52c45,51\r\n&lt; class VisLocalizationThread\r\n&lt; : public fawkes::Thread,\r\n&lt;   public fawkes::ClockAspect,\r\n&lt;   public fawkes::LoggingAspect,\r\n&lt;   public fawkes::ConfigurableAspect,\r\n&lt;   public fawkes::BlackBoardAspect,\r\n&lt;   public fawkes::BlockedTimingAspect,\r\n&lt;   public fawkes::GazeboAspect\r\n---\r\n&gt; class VisLocalizationThread : public fawkes::Thread,\r\n&gt;                               public fawkes::ClockAspect,\r\n&gt;                               public fawkes::LoggingAspect,\r\n&gt;                               public fawkes::ConfigurableAspect,\r\n&gt;                               public fawkes::BlackBoardAspect,\r\n&gt;                               public fawkes::BlockedTimingAspect,\r\n&gt;                               public fawkes::GazeboAspect\r\n54,55c53,54\r\n&lt;  public:\r\n&lt;   VisLocalizationThread();\r\n---\r\n&gt; public:\r\n&gt; \tVisLocalizationThread();\r\n57,74c56,74\r\n&lt;   virtual void init();\r\n&lt;   virtual void loop();\r\n&lt;   virtual void finalize();\r\n&lt; \r\n&lt;  private:\r\n&lt;   \/\/read pose interface\r\n&lt;   fawkes::Position3DInterface *pose_if_;\r\n&lt; \r\n&lt;   \/\/Publisher for visual msgs\r\n&lt;   gazebo::transport::PublisherPtr visual_publisher_;\r\n&lt; \r\n&lt;   double update_rate_;\r\n&lt;   fawkes::Time last_update_time_;\r\n&lt; \r\n&lt;   \/\/config values\r\n&lt;   std::string robot_name_, label_script_name_, location_scripts_, location_textures_, parent_name_, arrow_script_name_;\r\n&lt;   float label_size_;\r\n&lt;   float label_height_;\r\n---\r\n&gt; \tvirtual void init();\r\n&gt; \tvirtual void loop();\r\n&gt; \tvirtual void finalize();\r\n&gt; \r\n&gt; private:\r\n&gt; \t\/\/read pose interface\r\n&gt; \tfawkes::Position3DInterface *pose_if_;\r\n&gt; \r\n&gt; \t\/\/Publisher for visual msgs\r\n&gt; \tgazebo::transport::PublisherPtr visual_publisher_;\r\n&gt; \r\n&gt; \tdouble       update_rate_;\r\n&gt; \tfawkes::Time last_update_time_;\r\n&gt; \r\n&gt; \t\/\/config values\r\n&gt; \tstd::string robot_name_, label_script_name_, location_scripts_, location_textures_, parent_name_,\r\n&gt; \t  arrow_script_name_;\r\n&gt; \tfloat label_size_;\r\n&gt; \tfloat label_height_;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-vis-localization\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-vis-localization\/Makefile\r\n25c25\r\n&lt; LIBS_gazsim_vis_localization = fawkescore fawkesutils fawkesaspects fvutils \\\r\n---\r\n&gt; LIBS_gazsim_vis_localization = m fawkescore fawkesutils fawkesaspects fvutils \\\r\n31a32\r\n&gt; PLUGINS_all = $(PLUGINDIR)\/gazsim-vis-localization.so\r\n37c38,39\r\n&lt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) -lm $(call boost-libs-ldflags,system) -lboost_system\r\n---\r\n&gt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) \\\r\n&gt;              $(call boost-libs-ldflags,system)\r\n39c41\r\n&lt;   PLUGINS_all = $(PLUGINDIR)\/gazsim-vis-localization.so\r\n---\r\n&gt;   PLUGINS_build = $(PLUGINS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam.cpp\r\n22a23\r\n&gt; #include &lt;fvutils\/color\/conversions.h&gt;\r\n24,25d24\r\n&lt; #include &lt;stdio.h&gt;\r\n&lt; #include &lt;math.h&gt;\r\n28d26\r\n&lt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n29a28\r\n&gt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n31,32c30,31\r\n&lt; \r\n&lt; #include &lt;fvutils\/color\/conversions.h&gt;\r\n---\r\n&gt; #include &lt;math.h&gt;\r\n&gt; #include &lt;stdio.h&gt;\r\n41d39\r\n&lt; \r\n48,50c46,48\r\n&lt; GazsimWebcam::GazsimWebcam(std::string shm_id,\r\n&lt; \t\t\t     gazebo::transport::NodePtr gazebo_world_node,\r\n&lt; \t\t\t     Configuration* config)\r\n---\r\n&gt; GazsimWebcam::GazsimWebcam(std::string                shm_id,\r\n&gt;                            gazebo::transport::NodePtr gazebo_world_node,\r\n&gt;                            Configuration *            config)\r\n52,84c50,78\r\n&lt;   shm_buffer_ = NULL;\r\n&lt;   \/\/read config values\r\n&lt;   std::string robot_name = config-&gt;get_string(&quot;\/gazsim\/robot-name&quot;);\r\n&lt;   shm_id_ = robot_name + &quot;\/&quot; + shm_id;\r\n&lt;   topic_name_ = (&quot;~\/&quot; \r\n&lt; \t\t + robot_name\r\n&lt;                  + config-&gt;get_string((std::string(&quot;\/gazsim\/webcam\/topic-suffixes\/&quot;)\r\n&lt; \t\t                        + shm_id).c_str()));\r\n&lt;   width_ = config-&gt;get_float((std::string(&quot;\/gazsim\/webcam\/widths\/&quot;) + shm_id).c_str());\r\n&lt;   height_ = config-&gt;get_float((std::string(&quot;\/gazsim\/webcam\/heights\/&quot;) + shm_id).c_str());\r\n&lt;   frame_ = config-&gt;get_string((std::string(&quot;\/gazsim\/webcam\/frames\/&quot;) + shm_id).c_str());\r\n&lt; \r\n&lt;   format_from_ = firevision::RGB;\r\n&lt;   format_to_ = firevision::YUV422_PLANAR;\r\n&lt; \r\n&lt;   \/\/subscribing to gazebo publisher\r\n&lt;   \/\/the messages are published by the sensor itself and not by a robot plugin\r\n&lt;   \/\/therefore we have to use the world node\r\n&lt;   webcam_sub_ = gazebo_world_node-&gt;Subscribe(topic_name_, &amp;GazsimWebcam::on_webcam_data_msg, this);\r\n&lt; \r\n&lt;   \/\/initialize shared memory image buffer\r\n&lt;   shm_buffer_ = new firevision::SharedMemoryImageBuffer( shm_id_.c_str(),\r\n&lt; \t\t\t\t\t\t\t format_to_,\r\n&lt; \t\t\t\t\t\t\t width_,\r\n&lt; \t\t\t\t\t\t\t height_\r\n&lt; \t\t\t\t\t\t\t );\r\n&lt;   if (!shm_buffer_-&gt;is_valid()) {\r\n&lt;     throw fawkes::Exception(&quot;Shared memory segment not valid&quot;);\r\n&lt;   }\r\n&lt;   shm_buffer_-&gt;set_frame_id(frame_.c_str());\r\n&lt;   buffer_ = shm_buffer_-&gt;buffer();\r\n&lt;   \/\/enable locking\r\n&lt;   shm_buffer_-&gt;add_semaphore();\r\n---\r\n&gt; \tshm_buffer_ = NULL;\r\n&gt; \t\/\/read config values\r\n&gt; \tstd::string robot_name = config-&gt;get_string(&quot;\/gazsim\/robot-name&quot;);\r\n&gt; \tshm_id_                = robot_name + &quot;\/&quot; + shm_id;\r\n&gt; \ttopic_name_ =\r\n&gt; \t  (&quot;~\/&quot; + robot_name\r\n&gt; \t   + config-&gt;get_string((std::string(&quot;\/gazsim\/webcam\/topic-suffixes\/&quot;) + shm_id).c_str()));\r\n&gt; \twidth_  = config-&gt;get_float((std::string(&quot;\/gazsim\/webcam\/widths\/&quot;) + shm_id).c_str());\r\n&gt; \theight_ = config-&gt;get_float((std::string(&quot;\/gazsim\/webcam\/heights\/&quot;) + shm_id).c_str());\r\n&gt; \tframe_  = config-&gt;get_string((std::string(&quot;\/gazsim\/webcam\/frames\/&quot;) + shm_id).c_str());\r\n&gt; \r\n&gt; \tformat_from_ = firevision::RGB;\r\n&gt; \tformat_to_   = firevision::YUV422_PLANAR;\r\n&gt; \r\n&gt; \t\/\/subscribing to gazebo publisher\r\n&gt; \t\/\/the messages are published by the sensor itself and not by a robot plugin\r\n&gt; \t\/\/therefore we have to use the world node\r\n&gt; \twebcam_sub_ = gazebo_world_node-&gt;Subscribe(topic_name_, &amp;GazsimWebcam::on_webcam_data_msg, this);\r\n&gt; \r\n&gt; \t\/\/initialize shared memory image buffer\r\n&gt; \tshm_buffer_ =\r\n&gt; \t  new firevision::SharedMemoryImageBuffer(shm_id_.c_str(), format_to_, width_, height_);\r\n&gt; \tif (!shm_buffer_-&gt;is_valid()) {\r\n&gt; \t\tthrow fawkes::Exception(&quot;Shared memory segment not valid&quot;);\r\n&gt; \t}\r\n&gt; \tshm_buffer_-&gt;set_frame_id(frame_.c_str());\r\n&gt; \tbuffer_ = shm_buffer_-&gt;buffer();\r\n&gt; \t\/\/enable locking\r\n&gt; \tshm_buffer_-&gt;add_semaphore();\r\n89c83\r\n&lt;   delete this-&gt;shm_buffer_;\r\n---\r\n&gt; \tdelete this-&gt;shm_buffer_;\r\n92,100c86,98\r\n&lt; void GazsimWebcam::on_webcam_data_msg(ConstImageStampedPtr &amp;msg)\r\n&lt; {  \r\n&lt;   \/\/convert image data and write it in the shared memory buffer\r\n&lt;   \/\/lock the shm so noone can read a half written image\r\n&lt;   shm_buffer_-&gt;lock_for_write();\r\n&lt;   convert(format_from_,  format_to_,\r\n&lt;  \t  (const unsigned char*) msg-&gt;image().data().data(),   buffer_,\r\n&lt; \t  width_, height_);\r\n&lt;   shm_buffer_-&gt;unlock();\r\n---\r\n&gt; void\r\n&gt; GazsimWebcam::on_webcam_data_msg(ConstImageStampedPtr &amp;msg)\r\n&gt; {\r\n&gt; \t\/\/convert image data and write it in the shared memory buffer\r\n&gt; \t\/\/lock the shm so noone can read a half written image\r\n&gt; \tshm_buffer_-&gt;lock_for_write();\r\n&gt; \tconvert(format_from_,\r\n&gt; \t        format_to_,\r\n&gt; \t        (const unsigned char *)msg-&gt;image().data().data(),\r\n&gt; \t        buffer_,\r\n&gt; \t        width_,\r\n&gt; \t        height_);\r\n&gt; \tshm_buffer_-&gt;unlock();\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam.h\r\n21,22c21,22\r\n&lt; #ifndef __PLUGINS_GAZSIM_WEBCAM_H_\r\n&lt; #define __PLUGINS_GAZSIM_WEBCAM_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZSIM_WEBCAM_H_\r\n&gt; #define _PLUGINS_GAZSIM_WEBCAM_H_\r\n24c24,25\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n---\r\n&gt; #include &lt;aspect\/blackboard.h&gt;\r\n&gt; #include &lt;aspect\/blocked_timing.h&gt;\r\n28,31d28\r\n&lt; #include &lt;aspect\/blackboard.h&gt;\r\n&lt; #include &lt;aspect\/blocked_timing.h&gt;\r\n&lt; #include &lt;plugins\/gazebo\/aspect\/gazebo.h&gt;\r\n&lt; #include &lt;string.h&gt;\r\n33c30\r\n&lt; \r\n---\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n34a32,33\r\n&gt; #include &lt;plugins\/gazebo\/aspect\/gazebo.h&gt;\r\n&gt; \r\n35a35\r\n&gt; #include &lt;string.h&gt;\r\n38d37\r\n&lt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n39a39\r\n&gt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n42d41\r\n&lt; \r\n45,71c44,70\r\n&lt;  public:\r\n&lt;   GazsimWebcam(std::string shm_id,\r\n&lt; \t       gazebo::transport::NodePtr gazebo_world_node,\r\n&lt; \t       fawkes::Configuration* config);\r\n&lt;   ~GazsimWebcam();\r\n&lt; \r\n&lt;  private:  \r\n&lt;   \/\/Subscriber to receive webcam data from gazebo\r\n&lt;   gazebo::transport::SubscriberPtr webcam_sub_;\r\n&lt; \r\n&lt;   \/\/handler function for incoming webcam data messages\r\n&lt;   void on_webcam_data_msg(ConstImageStampedPtr &amp;msg);\r\n&lt; \r\n&lt;   \/\/shared memory buffer\r\n&lt;   firevision::SharedMemoryImageBuffer *shm_buffer_;\r\n&lt;   \/\/reference to the buffer of shm_buffer_\r\n&lt;   unsigned char *buffer_;\r\n&lt; \r\n&lt;   \/\/config values\r\n&lt;   \/\/topic name of the gazebo message publisher\r\n&lt;   std::string topic_name_;\r\n&lt;   double width_, height_;\r\n&lt;   \/\/id of the shared memory object\r\n&lt;   std::string shm_id_;\r\n&lt;   std::string frame_;\r\n&lt;   firevision::colorspace_t format_from_;\r\n&lt;   firevision::colorspace_t format_to_;\r\n---\r\n&gt; public:\r\n&gt; \tGazsimWebcam(std::string                shm_id,\r\n&gt; \t             gazebo::transport::NodePtr gazebo_world_node,\r\n&gt; \t             fawkes::Configuration *    config);\r\n&gt; \t~GazsimWebcam();\r\n&gt; \r\n&gt; private:\r\n&gt; \t\/\/Subscriber to receive webcam data from gazebo\r\n&gt; \tgazebo::transport::SubscriberPtr webcam_sub_;\r\n&gt; \r\n&gt; \t\/\/handler function for incoming webcam data messages\r\n&gt; \tvoid on_webcam_data_msg(ConstImageStampedPtr &amp;msg);\r\n&gt; \r\n&gt; \t\/\/shared memory buffer\r\n&gt; \tfirevision::SharedMemoryImageBuffer *shm_buffer_;\r\n&gt; \t\/\/reference to the buffer of shm_buffer_\r\n&gt; \tunsigned char *buffer_;\r\n&gt; \r\n&gt; \t\/\/config values\r\n&gt; \t\/\/topic name of the gazebo message publisher\r\n&gt; \tstd::string topic_name_;\r\n&gt; \tdouble      width_, height_;\r\n&gt; \t\/\/id of the shared memory object\r\n&gt; \tstd::string              shm_id_;\r\n&gt; \tstd::string              frame_;\r\n&gt; \tfirevision::colorspace_t format_from_;\r\n&gt; \tfirevision::colorspace_t format_to_;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam_plugin.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam_plugin.cpp\r\n22,23d21\r\n&lt; #include &lt;core\/plugin.h&gt;\r\n&lt; \r\n25a24,25\r\n&gt; #include &lt;core\/plugin.h&gt;\r\n&gt; \r\n35,37c35,36\r\n&lt;  public:\r\n&lt; \r\n&lt;   \/** Constructor.\r\n---\r\n&gt; public:\r\n&gt; \t\/** Constructor.\r\n40,44c39,42\r\n&lt;   GazsimWebcamPlugin(Configuration *config)\r\n&lt;     : Plugin(config)\r\n&lt;   {\r\n&lt;     thread_list.push_back(new WebcamSimThread());\r\n&lt;   }\r\n---\r\n&gt; \texplicit GazsimWebcamPlugin(Configuration *config) : Plugin(config)\r\n&gt; \t{\r\n&gt; \t\tthread_list.push_back(new WebcamSimThread());\r\n&gt; \t}\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam_thread.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam_thread.cpp\r\n23a24,25\r\n&gt; #include &lt;aspect\/logging.h&gt;\r\n&gt; #include &lt;fvutils\/color\/conversions.h&gt;\r\n25,26d26\r\n&lt; #include &lt;stdio.h&gt;\r\n&lt; #include &lt;math.h&gt;\r\n29d28\r\n&lt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n30a30\r\n&gt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n32,34c32,33\r\n&lt; #include &lt;aspect\/logging.h&gt;\r\n&lt; \r\n&lt; #include &lt;fvutils\/color\/conversions.h&gt;\r\n---\r\n&gt; #include &lt;math.h&gt;\r\n&gt; #include &lt;stdio.h&gt;\r\n46,47c45,46\r\n&lt;   : Thread(&quot;WebcamSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&lt;     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SENSOR_PROCESS)\r\n---\r\n&gt; : Thread(&quot;WebcamSimThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&gt;   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SENSOR_PROCESS)\r\n51c50,51\r\n&lt; void WebcamSimThread::init()\r\n---\r\n&gt; void\r\n&gt; WebcamSimThread::init()\r\n53,54c53,54\r\n&lt;   logger-&gt;log_debug(name(), &quot;Initializing Simulation of the Webcams&quot;);\r\n&lt;   shm_ids_ = config-&gt;get_strings(&quot;\/gazsim\/webcam\/shm-image-ids&quot;);\r\n---\r\n&gt; \tlogger-&gt;log_debug(name(), &quot;Initializing Simulation of the Webcams&quot;);\r\n&gt; \tshm_ids_ = config-&gt;get_strings(&quot;\/gazsim\/webcam\/shm-image-ids&quot;);\r\n56,59c56,58\r\n&lt;   for (std::vector&lt;std::string&gt;::iterator it = shm_ids_.begin(); it != shm_ids_.end(); ++it)\r\n&lt;   {\r\n&lt;     webcams_.push_back(new GazsimWebcam(*it, gazebo_world_node, config));\r\n&lt;   }\r\n---\r\n&gt; \tfor (std::vector&lt;std::string&gt;::iterator it = shm_ids_.begin(); it != shm_ids_.end(); ++it) {\r\n&gt; \t\twebcams_.push_back(new GazsimWebcam(*it, gazebo_world_node, config));\r\n&gt; \t}\r\n62c61,62\r\n&lt; void WebcamSimThread::finalize()\r\n---\r\n&gt; void\r\n&gt; WebcamSimThread::finalize()\r\n64,67c64,66\r\n&lt;   for (std::vector&lt;GazsimWebcam*&gt;::iterator it = webcams_.begin(); it != webcams_.end(); ++it)\r\n&lt;   {\r\n&lt;     delete *it;\r\n&lt;   }  \r\n---\r\n&gt; \tfor (std::vector&lt;GazsimWebcam *&gt;::iterator it = webcams_.begin(); it != webcams_.end(); ++it) {\r\n&gt; \t\tdelete *it;\r\n&gt; \t}\r\n70c69,70\r\n&lt; void WebcamSimThread::loop()\r\n---\r\n&gt; void\r\n&gt; WebcamSimThread::loop()\r\n72c72\r\n&lt;   \/\/The interesting stuff happens in the callback of the webcams\r\n---\r\n&gt; \t\/\/The interesting stuff happens in the callback of the webcams\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam_thread.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/gazsim_webcam_thread.h\r\n22,23c22,23\r\n&lt; #ifndef __PLUGINS_GAZSIM_WEBCAM_THREAD_H_\r\n&lt; #define __PLUGINS_GAZSIM_WEBCAM_THREAD_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZSIM_WEBCAM_THREAD_H_\r\n&gt; #define _PLUGINS_GAZSIM_WEBCAM_THREAD_H_\r\n25c25,26\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n---\r\n&gt; #include &lt;aspect\/blackboard.h&gt;\r\n&gt; #include &lt;aspect\/blocked_timing.h&gt;\r\n29,30c30,31\r\n&lt; #include &lt;aspect\/blackboard.h&gt;\r\n&lt; #include &lt;aspect\/blocked_timing.h&gt;\r\n---\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n&gt; #include &lt;fvutils\/ipc\/shm_image.h&gt;\r\n32d32\r\n&lt; #include &lt;string.h&gt;\r\n34d33\r\n&lt; #include &lt;fvutils\/ipc\/shm_image.h&gt;\r\n35a35\r\n&gt; #include &lt;string.h&gt;\r\n38c38,39\r\n&lt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n---\r\n&gt; #include &quot;gazsim_webcam.h&quot;\r\n&gt; \r\n39a41\r\n&gt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n42,51c44,50\r\n&lt; #include &quot;gazsim_webcam.h&quot;\r\n&lt; \r\n&lt; class WebcamSimThread\r\n&lt; : public fawkes::Thread,\r\n&lt;   public fawkes::ClockAspect,\r\n&lt;   public fawkes::LoggingAspect,\r\n&lt;   public fawkes::ConfigurableAspect,\r\n&lt;   public fawkes::BlackBoardAspect,\r\n&lt;   public fawkes::BlockedTimingAspect,\r\n&lt;   public fawkes::GazeboAspect\r\n---\r\n&gt; class WebcamSimThread : public fawkes::Thread,\r\n&gt;                         public fawkes::ClockAspect,\r\n&gt;                         public fawkes::LoggingAspect,\r\n&gt;                         public fawkes::ConfigurableAspect,\r\n&gt;                         public fawkes::BlackBoardAspect,\r\n&gt;                         public fawkes::BlockedTimingAspect,\r\n&gt;                         public fawkes::GazeboAspect\r\n53,54c52,60\r\n&lt;  public:\r\n&lt;   WebcamSimThread();\r\n---\r\n&gt; public:\r\n&gt; \tWebcamSimThread();\r\n&gt; \r\n&gt; \tvirtual void init();\r\n&gt; \tvirtual void loop();\r\n&gt; \tvirtual void finalize();\r\n&gt; \r\n&gt; private:\r\n&gt; \tstd::vector&lt;GazsimWebcam *&gt; webcams_;\r\n56,64c62,63\r\n&lt;   virtual void init();\r\n&lt;   virtual void loop();\r\n&lt;   virtual void finalize();\r\n&lt; \r\n&lt;  private:\r\n&lt;   std::vector&lt;GazsimWebcam*&gt; webcams_;\r\n&lt;   \r\n&lt;   \/\/config values\r\n&lt;   std::vector&lt;std::string&gt; shm_ids_;\r\n---\r\n&gt; \t\/\/config values\r\n&gt; \tstd::vector&lt;std::string&gt; shm_ids_;\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/gazsim-webcam\/Makefile\r\n25c25\r\n&lt; LIBS_gazsim_webcam = fawkescore fawkesutils fawkesaspects fvutils \\\r\n---\r\n&gt; LIBS_gazsim_webcam = m fawkescore fawkesutils fawkesaspects fvutils \\\r\n30a31\r\n&gt; PLUGINS_all = $(PLUGINDIR)\/gazsim-webcam.so\r\n36c37,38\r\n&lt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) -lm $(call boost-libs-ldflags,system) -lboost_system\r\n---\r\n&gt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) \\\r\n&gt;              $(call boost-libs-ldflags,system)\r\n38c40\r\n&lt;   PLUGINS_all = $(PLUGINDIR)\/gazsim-webcam.so\r\n---\r\n&gt;   PLUGINS_build = $(PLUGINS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/Makefile fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/Makefile\r\n26,27c26,27\r\n&lt; \t  gazsim-vis-localization gazsim-webcam gazsim-timesource \\\r\n&lt; \t  gazsim-depthcam\r\n---\r\n&gt;           gazsim-vis-localization gazsim-webcam gazsim-timesource \\\r\n&gt;           gazsim-depthcam\r\n29c29\r\n&lt; LIBS_gazebo = fawkescore fawkesaspects fawkesgazeboaspect\r\n---\r\n&gt; LIBS_gazebo = m fawkescore fawkesaspects fawkesgazeboaspect\r\n32a33\r\n&gt; PLUGINS_all = $(PLUGINDIR)\/gazebo.$(SOEXT)\r\n36c37,38\r\n&lt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) -lm $(call boost-libs-ldflags,system)\r\n---\r\n&gt;   LDFLAGS += $(LDFLAGS_GAZEBO) $(LDFLAGS_PROTOBUF) \\\r\n&gt;              $(call boost-libs-ldflags,system)\r\n38c40\r\n&lt;   PLUGINS_all = $(PLUGINDIR)\/gazebo.$(SOEXT)\r\n---\r\n&gt;   PLUGINS_build = $(PLUGINS_all)\r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/node_thread.cpp fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/node_thread.cpp\r\n26,28d25\r\n&lt; #include &lt;gazebo\/transport\/TransportIface.hh&gt;\r\n&lt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n&lt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n31d27\r\n&lt; #include &lt;gazebo\/msgs\/msgs.hh&gt;\r\n32a29,32\r\n&gt; #include &lt;gazebo\/msgs\/msgs.hh&gt;\r\n&gt; #include &lt;gazebo\/transport\/Node.hh&gt;\r\n&gt; #include &lt;gazebo\/transport\/TransportIface.hh&gt;\r\n&gt; #include &lt;gazebo\/transport\/TransportTypes.hh&gt;\r\n46,48c46,48\r\n&lt;   : Thread(&quot;GazeboNodeThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&lt;     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_POST_LOOP),\r\n&lt;     AspectProviderAspect(&amp;__gazebo_aspect_inifin)\r\n---\r\n&gt; : Thread(&quot;GazeboNodeThread&quot;, Thread::OPMODE_WAITFORWAKEUP),\r\n&gt;   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_POST_LOOP),\r\n&gt;   AspectProviderAspect(&amp;gazebo_aspect_inifin_)\r\n52d51\r\n&lt; \r\n58d56\r\n&lt; \r\n62,87c60,84\r\n&lt;   \/\/read config values\r\n&lt;   robot_channel = config-&gt;get_string(&quot;\/gazsim\/world-name&quot;)\r\n&lt;     + &quot;\/&quot; + config-&gt;get_string(&quot;\/gazsim\/robot-name&quot;);\r\n&lt;   \r\n&lt;   world_name = config-&gt;get_string(&quot;\/gazsim\/world-name&quot;);\r\n&lt; \r\n&lt;   if(gazebo::transport::is_stopped()) {\r\n&lt;     gazebo::transport::init();\r\n&lt;     gazebo::transport::run();\r\n&lt;   }\r\n&lt;   else {\r\n&lt;     logger-&gt;log_warn(name(), &quot;Gazebo already running &quot;);\r\n&lt;   }\r\n&lt; \r\n&lt;   \/\/Initialize Communication nodes:\r\n&lt;   \/\/the common one for the robot\r\n&lt;   gazebo::transport::NodePtr node(new gazebo::transport::Node());\r\n&lt;   __gazebonode = node;\r\n&lt;   \/\/initialize node (this node only communicates with nodes that were initialized with the same string)\r\n&lt;   __gazebonode-&gt;Init(robot_channel.c_str());\r\n&lt;   __gazebo_aspect_inifin.set_gazebonode(__gazebonode);\r\n&lt;   \r\n&lt;   \/\/and the node for world change messages\r\n&lt;   __gazebo_world_node = gazebo::transport::NodePtr(new gazebo::transport::Node());\r\n&lt;   __gazebo_world_node-&gt;Init(world_name.c_str());\r\n&lt;   __gazebo_aspect_inifin.set_gazebo_world_node(__gazebo_world_node);\r\n---\r\n&gt; \t\/\/read config values\r\n&gt; \trobot_channel =\r\n&gt; \t  config-&gt;get_string(&quot;\/gazsim\/world-name&quot;) + &quot;\/&quot; + config-&gt;get_string(&quot;\/gazsim\/robot-name&quot;);\r\n&gt; \r\n&gt; \tworld_name = config-&gt;get_string(&quot;\/gazsim\/world-name&quot;);\r\n&gt; \r\n&gt; \tif (gazebo::transport::is_stopped()) {\r\n&gt; \t\tgazebo::transport::init();\r\n&gt; \t\tgazebo::transport::run();\r\n&gt; \t} else {\r\n&gt; \t\tlogger-&gt;log_warn(name(), &quot;Gazebo already running &quot;);\r\n&gt; \t}\r\n&gt; \r\n&gt; \t\/\/Initialize Communication nodes:\r\n&gt; \t\/\/the common one for the robot\r\n&gt; \tgazebo::transport::NodePtr node(new gazebo::transport::Node());\r\n&gt; \tgazebonode_ = node;\r\n&gt; \t\/\/initialize node (this node only communicates with nodes that were initialized with the same string)\r\n&gt; \tgazebonode_-&gt;Init(robot_channel.c_str());\r\n&gt; \tgazebo_aspect_inifin_.set_gazebonode(gazebonode_);\r\n&gt; \r\n&gt; \t\/\/and the node for world change messages\r\n&gt; \tgazebo_world_node_ = gazebo::transport::NodePtr(new gazebo::transport::Node());\r\n&gt; \tgazebo_world_node_-&gt;Init(world_name.c_str());\r\n&gt; \tgazebo_aspect_inifin_.set_gazebo_world_node(gazebo_world_node_);\r\n90d86\r\n&lt; \r\n94,99c90,95\r\n&lt;   __gazebonode-&gt;Fini();\r\n&lt;   __gazebonode.reset();\r\n&lt;   __gazebo_aspect_inifin.set_gazebonode(__gazebonode);\r\n&lt;   __gazebo_world_node-&gt;Fini();\r\n&lt;   __gazebo_world_node.reset();\r\n&lt;   __gazebo_aspect_inifin.set_gazebonode(__gazebo_world_node);\r\n---\r\n&gt; \tgazebonode_-&gt;Fini();\r\n&gt; \tgazebonode_.reset();\r\n&gt; \tgazebo_aspect_inifin_.set_gazebonode(gazebonode_);\r\n&gt; \tgazebo_world_node_-&gt;Fini();\r\n&gt; \tgazebo_world_node_.reset();\r\n&gt; \tgazebo_aspect_inifin_.set_gazebonode(gazebo_world_node_);\r\n101d96\r\n&lt; \r\ndiff -r fawkes-robotino\/fawkes\/src\/plugins\/gazebo\/node_thread.h fawkes-robotino-2016\/fawkes\/src\/plugins\/gazebo\/node_thread.h\r\n23,24c23,24\r\n&lt; #ifndef __PLUGINS_GAZEBO_NODE_THREAD_H_\r\n&lt; #define __PLUGINS_GAZEBO_NODE_THREAD_H_\r\n---\r\n&gt; #ifndef _PLUGINS_GAZEBO_NODE_THREAD_H_\r\n&gt; #define _PLUGINS_GAZEBO_NODE_THREAD_H_\r\n26,30d25\r\n&lt; #include &lt;core\/threading\/thread.h&gt;\r\n&lt; #include &lt;aspect\/logging.h&gt;\r\n&lt; #include &lt;aspect\/configurable.h&gt;\r\n&lt; #include &lt;aspect\/clock.h&gt;\r\n&lt; #include &lt;aspect\/blocked_timing.h&gt;\r\n31a27,31\r\n&gt; #include &lt;aspect\/blocked_timing.h&gt;\r\n&gt; #include &lt;aspect\/clock.h&gt;\r\n&gt; #include &lt;aspect\/configurable.h&gt;\r\n&gt; #include &lt;aspect\/logging.h&gt;\r\n&gt; #include &lt;core\/threading\/thread.h&gt;\r\n32a33\r\n&gt; #include &lt;sys\/types.h&gt;\r\n34d34\r\n&lt; #include &lt;string.h&gt;\r\n36c36\r\n&lt; #include &lt;sys\/types.h&gt;\r\n---\r\n&gt; #include &lt;string.h&gt;\r\n39,41c39,40\r\n&lt;   namespace transport {\r\n&lt;     class Node;\r\n&lt;   }\r\n---\r\n&gt; namespace transport {\r\n&gt; class Node;\r\n42a42\r\n&gt; } \/\/ namespace gazebo\r\n44,50c44,49\r\n&lt; class GazeboNodeThread\r\n&lt; : public fawkes::Thread,\r\n&lt;   public fawkes::BlockedTimingAspect,\r\n&lt;   public fawkes::LoggingAspect,\r\n&lt;   public fawkes::ConfigurableAspect,\r\n&lt;   public fawkes::ClockAspect,\r\n&lt;   public fawkes::AspectProviderAspect\r\n---\r\n&gt; class GazeboNodeThread : public fawkes::Thread,\r\n&gt;                          public fawkes::BlockedTimingAspect,\r\n&gt;                          public fawkes::LoggingAspect,\r\n&gt;                          public fawkes::ConfigurableAspect,\r\n&gt;                          public fawkes::ClockAspect,\r\n&gt;                          public fawkes::AspectProviderAspect\r\n52,69c51,74\r\n&lt;  public:\r\n&lt;   GazeboNodeThread();\r\n&lt;   virtual ~GazeboNodeThread();\r\n&lt; \r\n&lt;   virtual void init();\r\n&lt;   virtual void loop();\r\n&lt;   virtual void finalize();\r\n&lt; \r\n&lt;  \/** Stub to see name in backtrace for easier debugging. @see Thread::run() *\/\r\n&lt;  protected: virtual void run() { Thread::run(); }\r\n&lt; \r\n&lt;  private:\r\n&lt;   \/\/Node for communication to gazebo-robot-plugins\r\n&lt;   gazebo::transport::NodePtr  __gazebonode;\r\n&lt;   \/\/Node to control the gazebo world (e.g. spawn visual objects)\r\n&lt;   gazebo::transport::NodePtr  __gazebo_world_node;\r\n&lt;   \/\/Publisher to send Messages:\r\n&lt;   gazebo::transport::PublisherPtr __visual_publisher, __model_publisher, __request_publisher, __light_publisher;\r\n---\r\n&gt; public:\r\n&gt; \tGazeboNodeThread();\r\n&gt; \tvirtual ~GazeboNodeThread();\r\n&gt; \r\n&gt; \tvirtual void init();\r\n&gt; \tvirtual void loop();\r\n&gt; \tvirtual void finalize();\r\n&gt; \r\n&gt; \t\/** Stub to see name in backtrace for easier debugging. @see Thread::run() *\/\r\n&gt; protected:\r\n&gt; \tvirtual void\r\n&gt; \trun()\r\n&gt; \t{\r\n&gt; \t\tThread::run();\r\n&gt; \t}\r\n&gt; \r\n&gt; private:\r\n&gt; \t\/\/Node for communication to gazebo-robot-plugins\r\n&gt; \tgazebo::transport::NodePtr gazebonode_;\r\n&gt; \t\/\/Node to control the gazebo world (e.g. spawn visual objects)\r\n&gt; \tgazebo::transport::NodePtr gazebo_world_node_;\r\n&gt; \t\/\/Publisher to send Messages:\r\n&gt; \tgazebo::transport::PublisherPtr visual_publisher_, model_publisher_, request_publisher_,\r\n&gt; \t  light_publisher_;\r\n71c76\r\n&lt;   fawkes::GazeboAspectIniFin  __gazebo_aspect_inifin;\r\n---\r\n&gt; \tfawkes::GazeboAspectIniFin gazebo_aspect_inifin_;\r\n73,74c78,79\r\n&lt;   \/\/channel of a specified robot for the gazebo node communication\r\n&lt;   std::string robot_channel, world_name;\r\n---\r\n&gt; \t\/\/channel of a specified robot for the gazebo node communication\r\n&gt; \tstd::string robot_channel, world_name;\r\ndiff -r fawkes-robotino\/src\/plugins\/gazebo\/Makefile fawkes-robotino-2016\/src\/plugins\/gazebo\/Makefile\r\n21c21\r\n&lt; \t  gazsim-machine-signal gazsim-gripper \\\r\n---\r\n&gt; \t  gazsim-gripper \\\r\n23a24\r\n&gt; # gazsim-machine-signal\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 18.04\u3078\u306efawkes-robotino \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u8a66\u884c &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.kdel.org\/wp\/?p=2648\"> <span class=\"screen-reader-text\">fawkes-robotino-2016\u306egazebo9\u4ee5\u964d\u3078\u306e\u5bfe\u5fdc<\/span> \u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[10,3,2],"tags":[],"class_list":["post-2648","post","type-post","status-publish","format-standard","hentry","category-fawkes","category-logistics-league","category-robocup"],"_links":{"self":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2648"}],"version-history":[{"count":3,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2648\/revisions"}],"predecessor-version":[{"id":2953,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2648\/revisions\/2953"}],"wp:attachment":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}