Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with nested maps #151

Closed
g-argyropoulos opened this issue Oct 3, 2023 · 1 comment
Closed

Error with nested maps #151

g-argyropoulos opened this issue Oct 3, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@g-argyropoulos
Copy link

While trying out the map feature of generate_parameter_library, I encountered a compilation error with nested maps. A minimal example is the following:

queries_list: {
    type: string_array,
  }

  queries:
    __map_queries_list:    
      arguments: {
        type: string_array,
      }
      __map_arguments:       
        command: {
          type: string,
        }    

The output looks like that:

In member function ‘void foo::ParamListener::refresh_dynamic_parameters()’:
error: ‘struct foo::Params’ has no member named ‘arguments’
  153 |       for (const auto & value : updated_params.arguments){
      |                                                ^~~~~~~~~
error: ‘struct foo::Params::Queries’ has no member named ‘__map_queries_list’; did you mean ‘MapQueriesList’?
  154 |           auto& entry = updated_params.queries.__map_queries_list.arguments_map[value];
      |                                                ^~~~~~~~~~~~~~~~~~
      |                                                MapQueriesList
In member function ‘rcl_interfaces::msg::SetParametersResult foo::ParamListener::update(const std::vector<rclcpp::Parameter>&)’:
error: ‘struct foo::Params’ has no member named ‘arguments’
  187 |         for (const auto & value : updated_params.arguments){
      |                                                  ^~~~~~~~~
error: ‘struct foo::Params::Queries’ has no member named ‘__map_queries_list’; did you mean ‘MapQueriesList’?
  190 |                 updated_params.queries.__map_queries_list.arguments_map[value].command = param.as_string();
      |                                        ^~~~~~~~~~~~~~~~~~
      |                                        MapQueriesList
In member function ‘void foo::ParamListener::declare_params()’:
error: ‘struct foo::Params’ has no member named ‘arguments’
  231 |       for (const auto & value : updated_params.arguments){
      |                                                ^~~~~~~~~
error: ‘struct foo::Params::Queries’ has no member named ‘__map_queries_list’; did you mean ‘MapQueriesList’?
  232 |           auto& entry = updated_params.queries.__map_queries_list.arguments_map[value];
      |                                                ^~~~~~~~~~~~~~~~~~
      |                                                MapQueriesList

Are nested maps not supported or am I doing something wrong?

@tylerjw
Copy link
Contributor

tylerjw commented Oct 11, 2023

I don't have any examples of anyone else doing this. It is probably just not yet working. You are welcome to submit PRs if you want to work on making nested maps work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants