ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Ok, I figured it out :).

In the current implementation the generated <name>Config class contains the variables of all groups as members directly. The ones under the corresponding group (class), the ones you (and I as well) accessed, never get assigned the default values.

So what you should do instead (at least until this code gets cleaned up):

void dynamic_cb(pkgConfig &config, uint32_t){
  a = Duration(config.a);
  b1 = config.part1;
  b2 = config.part2;
}

You can take a look at the implementation of the code generator here.

Just adding this small note here: you can also not add parameters with the same name to different groups, as they would get the same variable name in the main <name>Config class.

Cheers