Skip to content

[WIP] Initialize parameters #477

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

Closed
wants to merge 3 commits into from
Closed

Conversation

sloretz
Copy link
Contributor

@sloretz sloretz commented May 23, 2018

Work in progress towards initializing parameters.

Current state:

When the node is constructed yaml files passed as CLI args are parsed, and the parameters within are set on the node.

RCL

Questions/Assumptions

  • Assuming rclcpp needs to call methods to parse yaml because rcl doing it would cause a circular dependency between it and rcl_yaml_parse_params
  • Assuming rcl will have a method for getting a path to a yaml file from an rcl_arguments_t Has method for getting all yaml paths specified
  • Does rcl_yaml_param_parser dependency need to be exported? Yes
  • Should rcl_yaml_param_parser namespace + nodename include a leading slash? currently it does not
  • What was the idea of ParameterInitializationMap for? Why not std::vector<ParameterVariant>?

TODO

Bare minimum:

  • NodeParameters should start parameter services in its constructor (Autostart parameter services #478)
    • Need to pass full Node instance to NodeParameters to give to ParameterService
  • NodeParameters needs to get yaml file from CLI arguments (Initialize params via yaml from command line #488)
    1. If rcl_arguments_t passed to node options is not zero initialized, then get yaml files from it
    2. if node options use_global_argumentsisTrue` then get yaml files from global arguments.

Desired:

  • Split ParameterVariant into Parameter which has a ParameterValue (Split ParameterVariant into Parameter and ParameterValue #481)
  • rclcpp method to convert rcl_params_t to std::vector<Parameter> (or std::map<string, ParameterValue> or std::map<string, Parameter> ? ) (Convert rcl_params_t to ParameterMap #485)
  • Allow passing std::vector<Parameter> into NodeParameters constructor. (Pass initial parameter values to node constructor #486)
    • Needed to initialize a node with parameters generated by roslaunch after it merges multiple yaml files together.
  • node::create_parameter(name, value)
    • Declares a parameter is known by a node
  • std::vector<Parameter> node::unknown_initial_parameters()
    • Returns a list of parameters that are in the yaml file but not known to the node
    • To be called by a user after all parameters have been created
  • void node::raise_if_unknown_initial_parameters()
    • Raises exception if there is an unknown initial parameter
    • To be called by a user after all parameters have been created

@sloretz sloretz added enhancement New feature or request in progress Actively being worked on (Kanban column) labels May 23, 2018
@sloretz sloretz added this to the bouncy milestone May 23, 2018
@sloretz sloretz self-assigned this May 23, 2018
@sloretz sloretz force-pushed the rclcpp_parameter_initialization branch from 9f516bc to ba2a2f8 Compare May 25, 2018 20:15
@sloretz sloretz force-pushed the rclcpp_parameter_initialization branch from 42d6998 to a3e73e0 Compare June 1, 2018 17:38
@sloretz
Copy link
Contributor Author

sloretz commented Jun 8, 2018

I should have put this info into an issue instead of a PR. The content is covered by #488 and #475. Closing.

@sloretz sloretz closed this Jun 8, 2018
@sloretz sloretz deleted the rclcpp_parameter_initialization branch June 8, 2018 23:41
nnmm pushed a commit to ApexAI/rclcpp that referenced this pull request Jul 9, 2022
* Migrate to '--ros-args ... [--]'-based ROS args extraction

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Extend rcl arguments API to retrieve unparsed ROS args.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Adapt rcl arguments tests.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Complete unparsed ROS args functionality.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Address peer review comments.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Extend rcl arguments test coverage.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Adapt more rcl tests to use --ros-args.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Address peer review comments.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Ignore duplicate --ros-args flags.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress Actively being worked on (Kanban column)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant