From e98ea80896687d2df0f6f0ed6642565e9a88bd68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sergi=20Hern=C3=A0ndez=20Juan?= <shernand@iri.upc.edu>
Date: Fri, 3 Nov 2017 09:48:42 +0000
Subject: [PATCH] Solved a problem in the namespace generation. Now the modules
 action and service clients require the full namespace as a parameter.

---
 include/iri_ros_tools/module.h         | 2 +-
 include/iri_ros_tools/module_action.h  | 2 +-
 include/iri_ros_tools/module_service.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/iri_ros_tools/module.h b/include/iri_ros_tools/module.h
index db73bb1..c93fac4 100644
--- a/include/iri_ros_tools/module.h
+++ b/include/iri_ros_tools/module.h
@@ -252,7 +252,7 @@ CModule<ModuleCfg>::CModule(const std::string &name,const std::string &name_spac
     this->module_thread_id=name+"_module_thread";
     this->thread_server->create_thread(this->module_thread_id);
     this->thread_server->attach_thread(this->module_thread_id,this->module_thread,this);
-    this->name=this->module_nh.getNamespace()+"/"+name;
+    this->name=this->module_nh.getNamespace();
   }
   catch (CException &ex)
   {
diff --git a/include/iri_ros_tools/module_action.h b/include/iri_ros_tools/module_action.h
index a74dc2f..3ed6bc3 100644
--- a/include/iri_ros_tools/module_action.h
+++ b/include/iri_ros_tools/module_action.h
@@ -501,7 +501,7 @@ class CModuleAction
 };
 
 template<class action_ros>
-CModuleAction<action_ros>::CModuleAction(const std::string &name,const std::string &name_space):nh(ros::this_node::getName()+"/"+name_space)
+CModuleAction<action_ros>::CModuleAction(const std::string &name,const std::string &name_space):nh(name_space)
 {
   this->name=this->nh.getNamespace()+"/"+name;
   this->status=ACTION_IDLE;
diff --git a/include/iri_ros_tools/module_service.h b/include/iri_ros_tools/module_service.h
index e05dce2..d8d1aaa 100644
--- a/include/iri_ros_tools/module_service.h
+++ b/include/iri_ros_tools/module_service.h
@@ -169,7 +169,7 @@ class CModuleService
 };
 
 template<class service_msg>
-CModuleService<service_msg>::CModuleService(const std::string &name,const std::string &name_space):nh(ros::this_node::getName()+"/"+name_space)
+CModuleService<service_msg>::CModuleService(const std::string &name,const std::string &name_space):nh(name_space)
 {
   this->current_num_retries=0;
   this->max_num_retries=DEFAULT_SERVICE_MAX_RETRIES;
-- 
GitLab