How to get list element from rosparam parameter from the cmd? [closed]
I loaded this yaml file:
num_boxes: 1
boxes: [[x: 0.349, y: 0.213, z: 0.117]]
with rosparam load my_config.yaml
then I can do rosparam get boxes
and get:
- - {x: 0.349}
- {y: 0.213}
- {z: 0.117}
But how can I access only the first list or elements in the second list? I tried boxes[0], boxes(0) and boxes{0} but nothing worked. I'm sure this must be possible it is such a basic functionality.
did you intentionally nest two lists here? And then put key-value pairs in the innermost list as elements?
Because now you have a list, inside a list and the inner list contains dictionaries with only a single key:value pair each.
Yes that is on purpose