Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In general the design is here: https://design.ros2.org/articles/ros_parameters.html

We added arrays of homogeneous type at some point in the past:

https://github.com/ros2/design/pull/152

There are some discussions on that pull request about dictionaries, arrays of arrays (multidimensional arrays), and that would include arrays of dictionaries, but ultimately we decided not to do those things in order to simplify the design, especially for languages like C where storing heterogeneous list and maps is hard without non-native types. For example, see:

https://github.com/ros2/design/pull/152#discussion_r141136231

We discussed multi-dimensional arrays, and I actually felt at the time that it was an important feature, but it didn't get in. I think it's something that the community would be receptive to, but we'd need to have a pr to that design document that laid out all of the features you'd like to see, how they might be used and implemented, and then discuss it with everyone to see if we can justify the increase in complexity.


In the meantime, I would restructure your example like this, which is less convenient to be sure, but might let you keep going without changes to ROS 2 for now:

points:
  point1:
    x: 1.0
    y: 0.0
  point2:
    x: 2.0
    y: 0.0

If we had enabled support for multidimensional arrays, then you would have been able to do something like this:

points: [
  [1.0, 0.0],
  [2.0, 0.0],
]

Which looses you the named keys x and y for each point, but would have avoided the need to come up with a unique name for each point.