Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction with paramater server #23

Open
roboticlemon opened this issue Feb 2, 2021 · 2 comments
Open

Interaction with paramater server #23

roboticlemon opened this issue Feb 2, 2021 · 2 comments

Comments

@roboticlemon
Copy link

roboticlemon commented Feb 2, 2021

With standard dynamic reconfigure, new paramaters are mirrored on the ros paramater server such that you can do rosparam list and see your paramaters.

With this library however I can't see the paramaters at all with rosparam list. They appear in rqt_reconfigure but are apparently invisible to the rosparam api. Am I misunderstanding the library or have I done something wrong? Just making a small modification to the sample code on the readme to printout the keys :

int main(int argc, char **argv) {

        ros::init(argc, argv, "ddynamic_tutorials");
        ros::NodeHandle nh("~/other_namespace");
        ddynamic_reconfigure::DDynamicReconfigure ddr(nh);

        int int_param = 0;
        ddr.registerVariable<int>("int_param", &int_param, "param description");
        ddr.publishServicesTopics();

        std::vector<std::string> keys;
        nh.getParamNames(keys);

        // Print out keys on param server
        for(auto k : keys){
            printf("Key is %s\n", k.c_str());
        }
        ros::spin();
        return 0;
}

The only printed keys are the default roscore ones. I am on ROS Melodic, 18.04.

Any guidance is much appreciated. I am trying to use this vastly superior package with control_toolbox.

@KKonaOG
Copy link

KKonaOG commented Jul 9, 2021

You may find this useful:
pnh_.param("demo_value", demo_value_enabled_, false);
ddr_.registerVariable("demo_value", &demo_value_enabled_, boost::bind(changeDemoValue, _1), "Enable Demo Value", false, true, "Demo Category");

I setup each parameter both in the typical parameter server and inside ddr. This allows me to see them listed, as well as, lets me work with them inside ddr and use them for callbacks.

@qpc001
Copy link

qpc001 commented Apr 1, 2023

You may find this useful: pnh_.param("demo_value", demo_value_enabled_, false); ddr_.registerVariable("demo_value", &demo_value_enabled_, boost::bind(changeDemoValue, _1), "Enable Demo Value", false, true, "Demo Category");

I setup each parameter both in the typical parameter server and inside ddr. This allows me to see them listed, as well as, lets me work with them inside ddr and use them for callbacks.

您可能会发现以下命令很有用: pnh_.param(“demo_value”,demo_value_enabled_,false); ddr_.registerVariable(“demo_value”,&demo_value_enabled_,boost::bind(changeDemoValue,_1),“启用演示值”,false,true,“演示类别”);

我在典型的参数服务器和ddr中设置了每个参数。这让我可以看到它们的列表,也让我可以在ddr中使用它们,并将它们用于回调。

Not work too. Help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants