parsing the YAML file
Hello All,
I'm new to ROS and C++.
here's the question:
so, my yaml
file looks like this:
parameters:
status:
stage1:
distance: 4000
color1:
r: 0
g: 255
b: 0
color2:
r: 0
g: 0
b: 0
stage2:
distance: 8000
color1:
r: 0
g: 0
b: 255
color2:
r: 0
g: 0
b: 0
i want to read the struct stage1 and stage2 and their members( first status and then its member(children) like distance, color1 and color2 ) in my main.cpp
.
i have configured it in XmlRpc::XmlRpcValue
way to read the value.
at the moment i can just read parameters and its member, like:
parameters:
distance: 4000
color1:
r: 0
g: 12
b: 0
color2:
r: 255
g: 0
b: 0
but i'm unable to read its member's member.
is it possible to read first stages
and then its members(Children) like distance
, color1
and color2
? if not possible, i can maybe remove status
and have just the stages
.
or is there any other way to read the file where distance
, color1
and color2
can be read based on their parent(like stage1
and stage2
)?
Thankyou so much in Advance!!