From 217443c02c92499437dfd0b103c3042a1d3d6861 Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Sun, 31 Oct 2021 15:00:58 +0100
Subject: [PATCH] Solved a bug in the read_params functions: The bools
 parameters was used for all data types.

---
 include/iri_ros_tools/module.h            | 2 +-
 include/iri_ros_tools/module_dyn_reconf.h | 6 +++---
 setup.py                                  | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/iri_ros_tools/module.h b/include/iri_ros_tools/module.h
index 12e8981..13eedfa 100644
--- a/include/iri_ros_tools/module.h
+++ b/include/iri_ros_tools/module.h
@@ -170,7 +170,7 @@ class CModule
      * \param name prefix given to the module servie variables in order to locate and
      *             handle them.
      */
-    void dynamic_reconfigure(ModuleCfg &config, const std::string &name);
+    virtual void dynamic_reconfigure(ModuleCfg &config, const std::string &name);
     /**
       * \brief function to start the operation of the class
       *
diff --git a/include/iri_ros_tools/module_dyn_reconf.h b/include/iri_ros_tools/module_dyn_reconf.h
index 331a66a..1e4e539 100644
--- a/include/iri_ros_tools/module_dyn_reconf.h
+++ b/include/iri_ros_tools/module_dyn_reconf.h
@@ -336,11 +336,11 @@ void CModuleDynReconf<dyn_reconf_config>::read_params(void)
     for(i=0;i<set_params_srv.response.config.bools.size();i++)
       this->bool_params[set_params_srv.response.config.bools[i].name]=set_params_srv.response.config.bools[i].value;
     for(i=0;i<set_params_srv.response.config.ints.size();i++)
-      this->bool_params[set_params_srv.response.config.ints[i].name]=set_params_srv.response.config.ints[i].value;
+      this->int_params[set_params_srv.response.config.ints[i].name]=set_params_srv.response.config.ints[i].value;
     for(i=0;i<set_params_srv.response.config.strs.size();i++)
-      this->bool_params[set_params_srv.response.config.strs[i].name]=set_params_srv.response.config.strs[i].value;
+      this->string_params[set_params_srv.response.config.strs[i].name]=set_params_srv.response.config.strs[i].value;
     for(i=0;i<set_params_srv.response.config.doubles.size();i++)
-      this->bool_params[set_params_srv.response.config.doubles[i].name]=set_params_srv.response.config.doubles[i].value;
+      this->double_params[set_params_srv.response.config.doubles[i].name]=set_params_srv.response.config.doubles[i].value;
     this->read_done=true;
   }
   else
diff --git a/setup.py b/setup.py
index b40c66f..b69fcec 100644
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,7 @@
 from distutils.core import setup
 from catkin_pkg.python_setup import generate_distutils_setup
 d = generate_distutils_setup(
+    scripts=['src/iri_ros_tools/dyn_params.py'],
     packages=['iri_ros_tools'],
     package_dir={'': 'src'},
     requires=['roslib', 'rospy', 'rosservice']
-- 
GitLab