Skip to content

How to read subgroups from .ini based YARP configuration files? #2563

Discussion options

You must be logged in to vote

Please note groups and nested subgroups internally translate to lists (a.k.a. bottles). For instance:

// config1.ini
test1 a

[MYGROUP]
test2 b
NESTED1 (test3 c)

After parsing this file with ResourceFinder and printing out its contents via toString(), you'll get:

(MYGROUP (test2 b) (NESTED1 (test3 c))) (from config1.ini) (test1 a)

Which is exactly the same output you'll see if your config file resembles this one:

// config2.ini
test1 a
MYGROUP (test2 b) (NESTED1 (test3 c))

Although there is no specific .ini syntax for subgroups such as there is [<group_name>] for groups, the nested-like behavior can be mimicked by abusing the parens notation. The following C++ code proves my point in tha…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@prashanthr05
Comment options

Comment options

You must be logged in to vote
4 replies
@prashanthr05
Comment options

@prashanthr05
Comment options

@PeterBowman
Comment options

@prashanthr05
Comment options

Answer selected by prashanthr05
Comment options

You must be logged in to vote
1 reply
@prashanthr05
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment