From eb6abfd304ac2f9225670b95d8309d1c60c1842a Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Fri, 6 Nov 2020 15:47:58 +0100
Subject: [PATCH] Updated the launch files.

---
 ...launch => tiago_play_motion_client.launch} |  8 ++++----
 ...ch => tiago_play_motion_client_sim.launch} |  2 +-
 src/tiago_play_motion_module.cpp              | 20 +++----------------
 3 files changed, 8 insertions(+), 22 deletions(-)
 rename launch/{play_motion_client.launch => tiago_play_motion_client.launch} (58%)
 rename launch/{play_motion_client_sim.launch => tiago_play_motion_client_sim.launch} (66%)

diff --git a/launch/play_motion_client.launch b/launch/tiago_play_motion_client.launch
similarity index 58%
rename from launch/play_motion_client.launch
rename to launch/tiago_play_motion_client.launch
index 977318f..738b3d1 100644
--- a/launch/play_motion_client.launch
+++ b/launch/tiago_play_motion_client.launch
@@ -1,15 +1,15 @@
 <launch>
 
   <!-- launch the play motion client node -->
-  <node name="play_motion_client"
-        pkg="play_motion_client"
-        type="play_motion_client"
+  <node name="tiago_play_motion_client"
+        pkg="tiago_play_motion_module"
+        type="tiago_play_motion_client"
         output="screen"
         ns="/tiago">
     <remap from="~/play_motion_module/play_motion"
              to="/play_motion"/>
 
-    <rosparam file="$(find tiago_modules)/config/play_motion_module_default.yaml" command="load" ns="play_motion_module" />
+    <rosparam file="$(find tiago_play_motion_module)/config/tiago_play_motion_module_default.yaml" command="load" ns="play_motion_module" />
   </node>
 
   <!-- launch dynamic reconfigure -->
diff --git a/launch/play_motion_client_sim.launch b/launch/tiago_play_motion_client_sim.launch
similarity index 66%
rename from launch/play_motion_client_sim.launch
rename to launch/tiago_play_motion_client_sim.launch
index 6109633..f1531f9 100644
--- a/launch/play_motion_client_sim.launch
+++ b/launch/tiago_play_motion_client_sim.launch
@@ -5,7 +5,7 @@
     <arg name="robot" value="steel" />
   </include>
 
-  <include file="$(find play_motion_client)/launch/play_motion_client.launch"/>
+  <include file="$(find tiago_play_motion_module)/launch/tiago_play_motion_client.launch"/>
 
 </launch>
 
diff --git a/src/tiago_play_motion_module.cpp b/src/tiago_play_motion_module.cpp
index 27ddbb6..4ecd1a8 100644
--- a/src/tiago_play_motion_module.cpp
+++ b/src/tiago_play_motion_module.cpp
@@ -2,7 +2,7 @@
 
 
 CTiagoPlayMotionModule::CTiagoPlayMotionModule(const std::string &name,const std::string &name_space) : CModule(name,name_space),
-  tiago_play_motion_action("tiago_play_motion",this->module_nh.getNamespace())
+  tiago_play_motion_action("play_motion",this->module_nh.getNamespace())
 {
   this->start_operation();
 
@@ -109,25 +109,11 @@ void CTiagoPlayMotionModule::reconfigure_callback(tiago_play_motion_module::Tiag
 
 void CTiagoPlayMotionModule::execute_motion(std::string motion_name)
 {
-  XmlRpc::XmlRpcValue symbols;
-
-  if(!ros::param::get(this->config.motions_param_path.c_str(), symbols))
-    return;
-  else
-  {
-    if(symbols.getType()==XmlRpc::XmlRpcValue::TypeArray)
-      return;
-    for (XmlRpc::XmlRpcValue::iterator i=symbols.begin(); i!=symbols.end(); ++i) 
-    {
-      std::cout << i->second << std::endl;
-    }
-  }
-/*
   std::string motion;
 
   if(this->is_finished())
   {
-    if(this->module_nh.getParam("/play_motion/motions/" + motion_name + "/meta/name", motion)) //If motion exists
+    if(this->module_nh.getParam(this->config.motions_param_path + "/" + motion_name + "/meta/name", motion)) //If motion exists
     {
       this->goal.motion_name=motion_name;
       this->goal.skip_planning=false;
@@ -139,7 +125,7 @@ void CTiagoPlayMotionModule::execute_motion(std::string motion_name)
       ROS_WARN("CTiagoPlayMotionModule: Motion name does not exist");
       this->status=TIAGO_PLAY_MOTION_MODULE_INVALID_ID;
     }
-  }*/
+  }
 }
 
 void CTiagoPlayMotionModule::stop(void)
-- 
GitLab