PickNikRobotics / generate_parameter_library

Declarative ROS 2 Parameters
BSD 3-Clause "New" or "Revised" License
240 stars 45 forks source link

Array of custom sub-structs #140

Closed christophfroehlich closed 1 year ago

christophfroehlich commented 1 year ago

Is it somehow possible to declare an array of a custom sub-structure? Or how could the library be extended in this way?

Something like

cpp_name_space:
  sub_array:
    sub_struct:
      a_parameter: {
        type: double
      }
      another_parameter: {
        type: double
      }

and

  ros__parameters:
    sub_array:
      - a_parameter: 1.
        another_parameter: 2.0
      - a_parameter: 2.
        another_parameter: 3.0

used as params.sub_array.at(0).a_parameter

tylerjw commented 1 year ago

I don't know how that would map into ros parameters themselves. I don't think they have the concept of a map of structures. The current structure implementation is based on the idea of multiple parameters in a namespace and not something more formal like a ros message.

christophfroehlich commented 1 year ago

you are right, I haven't thought about that end