[YAML parser] ROS2 get parameters from sequences
I give a yaml file as a parameter to a ROS2 (crystal) node and want to read a sequence.
Is it possible to read parameters from a yaml sequence? I found that there is a test case rcl/rcl_yaml_param_parser/test/seq_map1.yaml
. But I couldn't figure out how to do it.
I tried it with this parameter file:
parameter_test: ros__parameters: test_int: 4 test_list: - item: 1 - item: 2 - item: 3
And with this variations in code. None of them seem to work.
int item; node->get_parameter("test_list/[0]/item", item); node->get_parameter("test_list/0/item", item); node->get_parameter("test_list[0]/item", item);