From 9a45d9e09c689c9dfb97b8bf1f81f09d55f1787a Mon Sep 17 00:00:00 2001 From: Sergi Hernandez Juan <shernand@iri.upc.edu> Date: Thu, 4 Jun 2020 17:26:50 +0200 Subject: [PATCH] Added the python module to add the necessary parameters to the cfg file. --- CMakeLists.txt | 4 +++- setup.py | 9 +++++++++ src/iri_base_bt_client/__init__.py | 0 src/iri_base_bt_client/submodule.py | 11 +++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 setup.py create mode 100644 src/iri_base_bt_client/__init__.py create mode 100644 src/iri_base_bt_client/submodule.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bd4019..e5662c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8.3) project(iri_base_bt_client) -# set(CMAKE_BUILD_TYPE "DEBUG") +set(CMAKE_BUILD_TYPE "DEBUG") ## Add support for C++11, supported in ROS Kinetic and newer # add_definitions(-std=c++11) @@ -20,6 +20,8 @@ find_package(catkin REQUIRED COMPONENTS # find_package(Boost REQUIRED COMPONENTS system) find_package(Boost REQUIRED COMPONENTS system thread) +catkin_python_setup() + ## Uncomment this if the package has a setup.py. This macro ensures ## modules and global scripts declared therein get installed ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..30b7ff1 --- /dev/null +++ b/setup.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +from distutils.core import setup +from catkin_pkg.python_setup import generate_distutils_setup +d = generate_distutils_setup( + packages=['iri_base_bt_client'], + package_dir={'': 'src'}, + requires=['roslib', 'rospy', 'rosservice'] +) +setup(**d) diff --git a/src/iri_base_bt_client/__init__.py b/src/iri_base_bt_client/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/iri_base_bt_client/submodule.py b/src/iri_base_bt_client/submodule.py new file mode 100644 index 0000000..c46fc44 --- /dev/null +++ b/src/iri_base_bt_client/submodule.py @@ -0,0 +1,11 @@ +# submodule config parameters +from dynamic_reconfigure.parameter_generator_catkin import * + +def add_bt_client_params(gen): + new_group = gen.add_group('bt_client') + + new_group.add("bt_client_rate",double_t,0,"Desired rate in Hz of the client", 1.0, 0.1, 1000.0) + new_group.add("bt_client_enable_cout_logger",bool_t,0,"Enables status printing in terminal", False) + new_group.add("bt_client_enable_minitrace_logger",bool_t,0,"Enables duration saving in log file", False) + new_group.add("bt_client_enable_file_logger",bool_t,0,"Enables status saving in log file", False) + new_group.add("bt_client_enable_zmq_publisher",bool_t,0,"Enables live status sending to Groot", False) -- GitLab