Skip to content

Support complex parameter values. #496

@balthasarschuess

Description

@balthasarschuess

Assuming the following yaml configuration.

/**:
    ros__parameters:
      param: 
        sub_param_foo: "foo"
        sub_param_bar: "bar"

Currently this fails, because key/value ParameterValues are not implemented yet:

let node = executor.create_node("test")?;
let w2mo_config: MandatoryParameter<Arc<str>> = node.declare_parameter("param").mandatory()?;
// --> Error: 
//      parameter was declared as non-optional but no value was available, 
//      either through a user specified default, a command-line override, or a previously set value

Most useful to me would be something like the following to work:

use serde::Deserialize;

#[derive(Deserialize, Clone)]
pub struct MyParam {
  pub sub_param_foo : String,
  pub sub_param_foo: String, 
}

let node = executor.create_node("test")?;
let w2mo_config: MandatoryParameter<MyParam> = node.declare_parameter("param").mandatory()?;

But I also would be happy if I could parse my struct from the Arc<str> somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions