Dynamic Reconfigure Keep Publishing

asked 2018-08-13 21:58:37 -0500

ytosclee gravatar image

updated 2018-08-14 23:34:19 -0500

jayess gravatar image

Hi, I used dynamic reconfigure with rqt and I found that the topics keep publishing even there is no change in the value. Is there any way to configure dynamic reconfigure to publish topic only when there is an update? I am using Kinetic on a PC. Thanks!


Update:

I am using the below code for the dynamic server.

#!/usr/bin/env python
PACKAGE = "mypackage"
from dynamic_reconfigure.parameter_generator_catkin import *
gen = ParameterGenerator()
gen.add("double_param_1", double_t, 0, "A double parameter", .1, 0, 1)
gen.add("double_param_2", double_t, 0, "A double parameter", .1, 0, 1)
exit(gen.generate(PACKAGE, "mypackage", "mypackage_"))
edit retag flag offensive close merge delete

Comments

What is the dynamic reconfigure server you are connecting to? How the server is implemented is possibly where the fault lies. Other than that is there any other client to the server running at the same time as the rqt dynamic reconfigure plugin?

lucasw gravatar imagelucasw ( 2018-08-14 19:30:04 -0500 )edit

HI Lucasw:

I am using the below code for the dynamic server. Sorry that I cannot post the code in the comment due to the number of characters limitation. Thanks!

ytosclee gravatar imageytosclee ( 2018-08-14 22:40:44 -0500 )edit

@ytosclee there are character limits in the comments because they're supposed to be short. If you're going to be giving more information about your question then please use the "edit" button.

jayess gravatar imagejayess ( 2018-08-14 23:36:21 -0500 )edit

@ytosclee is that what you have for your server? That's a cfg file which is used to define the parameters. You need to implement the server. Take a look at the tutorials.

jayess gravatar imagejayess ( 2018-08-14 23:39:44 -0500 )edit

@ytosclee Update the question with your python or C++ code that runs the server.

lucasw gravatar imagelucasw ( 2018-08-15 09:51:40 -0500 )edit

Hi Lucasw and Jayess:

I found out my problem. I publish data in the server code and I should not do that. I should subscribe to /node/parameter_updates instead. Thanks for the help!

Best Regards,

Ytosclee

ytosclee gravatar imageytosclee ( 2018-08-15 10:20:14 -0500 )edit