rosparam_handler icon indicating copy to clipboard operation
rosparam_handler copied to clipboard

nested parameters

Open ahoarau opened this issue 7 years ago • 5 comments

It would be awesome if we could do :

some_group:
   a_param: 0
   b_param: 0
some_other_group:
   a_param: 0
   b_param: 0
   c_param: 0

I though it was the purpose of 'groups', but it's only a dynamic reconfigure goodie.

ahoarau avatar May 16 '18 21:05 ahoarau

Hi, thanks for the comment. What would you expect some_group to be ? A nested namespace ? Cheers.

artivis avatar Jun 06 '18 09:06 artivis

Yes exactly. Practical example : a pid controller. The param yaml would be something like :

controller_name : test
some_other_param : 2
pid:
    p: [ 1, 2, 3 ]
    i:  [ 1, 2, 3 ]
    d: [ 1, 2, 3 ]

But for that I would have to define a config for each 'level' ( the level that contains controller_name and some_other_param and another for the pid alone)

ahoarau avatar Jun 06 '18 09:06 ahoarau

I definitely see the interest in this feature, but it would be a little tricky to implement. Since a nested namespace could be provided for each parameter, one as to keep tracks of the associated namespaces.

I'll have a look but I can't make it a priority right now, I'm open to discussion if you want to tackle it yourself ;) .

artivis avatar Jun 06 '18 09:06 artivis

I can add that in the end I'd like to have :

    ros::NodeHandle nh("~");
    ParamType testParams(nh);
    testParams.fromParamServer();
    testParams.pid().p; // --> vector of double or eigen vector

I'll have a look but I can't make it a priority right now, I'm open to discussion if you want to tackle it yourself ;)

I was counting on you guys :) But i'll definitely have a look.

ahoarau avatar Jun 06 '18 09:06 ahoarau

You actually expect a nested struct from the cpp implementation. That 's a different story. It is even more complicated to implement and I don't know if it is actually desirable.

artivis avatar Jun 07 '18 12:06 artivis