Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To read a regular standard variable type:

int item;
this->get_parameter_or<int>("test_int", item, <default_int_value>);

For a sequence, you need to iterate through the test_list namespace like:

static const std::string param_list = "test_list";
auto parameters_and_prefixes = list_parameters({param_list}, 2);
for (const std::string &name : parameters_and_prefixes.names) {
    std::cout << name.substr(param_list.size()+1, name.size()) << " : " << get_parameter(name).get_value<int>() << std::endl;
}

This has changed from dashing on. You need to declare all parameters beforehand: http://answers.ros.org/question/325939/declare-nested-parameter/