What is best practice for parameters which are empty lists in ros2
I recently discovered that loading a parameter which is an empty list value in ROS2 Foxy is not supported. For example a yaml file containing
my_string_list_param: [] # This will cause an exception to be thrown
It seems that the parameter loaders complain that the type of the parameter cannot be determined and therefore empty sequences are rejected see here https://github.com/ros2/launch_ros/bl...
I believe empty lists are a very reasonable need for node configurations. My question, is what is the best practice in this case? What is the most ROS2 way to define empty list parameters? My main thought at the moment is a separate flag parameter which denotes if the list parameter is empty but this requires additional logic in the loading node. For some uses having the parameter be optional could also work, but this assumes a case where the default is empty and this my not always be the best choice from a configuration management perspective.
Could you find an answer?
Unfortunately no, I'm currently using a workaround of [' '] to store an single space string to indicate list empty and handling it with custom code.
Currently still an open issue: https://github.com/ros2/rclcpp/issues...