Skip to content

Array parameters wierdness #128

Open
@sprenger120

Description

@sprenger120

There seem to be some issues with the handling of array parameters. I'm encountering problems with setting parameters and getting my application terminated, because of

Wrong parameter type, parameter {myParam} is of type {integer}, setting it to {integer_array} is not allowed.

Working configuration:

parameters.yaml

  myParam: {
    type: int_array_fixed_2,
    description: "myDescription",
    default_value: [ 0, 0],
    validation: {
      element_bounds<>: [ 0, 10000 ]
    }
  }

config.yaml

node:
  ros__parameters:
    myParam: [0, 1]

bounds demoting array to single integer

parameters.yaml

  myParam: {
    type: int_array_fixed_2,
    description: "myDescription",
    default_value: [ 0, 0],
    validation: {
      bounds<>: [ 0, 10000 ]
    }
  }

Changing out element_bounds to bounds will demote the parameter to a single integer and cause the error at the start. Removing the validation block will fix the problem.

No default_value demotes to single integer

parameters.yaml

  myParam: {
    type: int_array_fixed_2,
    description: "myDescription",
    validation: {
      element_bounds<>: [ 0, 10000 ]
    }
  }

Removing the default_value key will also demote the array. Removing the validation block will change nothing.

Something fishy is going on here, could you have a look? Thank you <3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions