ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Use dynamic reconfiguration to set the parameter value in ROS

asked 2014-02-24 09:34:33 -0600

rosqueries gravatar image

updated 2014-02-24 09:50:43 -0600

I am new to ROS and i want to use Dynamic reconfiguration technique to set a parameter (rectangle_height).

Through internet i came across with the following method but its not working.

Problem: when i run rqt_reconfigure, in that my node (visual_analysis) is not visual so i can't change the parameter.

-In my Includes, i have included the following:

#include <dynamic_reconfigure/DoubleParameter.h>
#include <dynamic_reconfigure/Reconfigure.h>
#include <dynamic_reconfigure/Config.h>

-In my main() where my variable is declared, i have written the following:

int main( )
{
    double rectangle_height;

    ///////////////////Dynamic Reconfig
    dynamic_reconfigure::ReconfigureRequest srv_req;
    dynamic_reconfigure::ReconfigureResponse srv_resp;
    dynamic_reconfigure::DoubleParameter double_param;
    dynamic_reconfigure::Config conf;   

    //Entering values using Dynamic Reconfig
    double_param.name = "kurtana_pitch_joint";
    double_param.value = rectangle_height;
    conf.doubles.push_back(double_param);

    srv_req.config = conf;
    ros::service::call("/visual_analysis/set_parameters", srv_req, srv_resp);


    return 0; 
}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-02-24 14:03:16 -0600

ahendrix gravatar image

You have to add explicit support for dynamic_reconfigure in the node you're trying to configure.

Dynamic_reconfigure has a very nice tutorial describing how to do this: http://wiki.ros.org/dynamic_reconfigu...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-02-24 09:34:33 -0600

Seen: 1,351 times

Last updated: Feb 24 '14