Skip to content

Allow Parameter API to get/set maps of values #529

Closed

Description

@clalancette

Feature request

Feature description

There are some users of the Parameter API in ROS1 that depend on getting a map of values, e.g. https://github.com/ros-teleop/teleop_twist_joy/blob/indigo-devel/src/teleop_twist_joy.cpp#L78 . It would be great to have a helper API to do this in ROS2 as well, to reduce the amount of boilerplate that users would have to do to get parameters one at a time.

Activity

  1. dirk-thomas commented on Aug 6, 2018

    @dirk-thomas
    Member

    ... to reduce the amount of boilerplate that users would have to do to get parameters one at a time.

    I am not sure what you mean with "one at a time".

    Couldn't you create a "syntactic sugar" API which wraps the existing get_parameters method and instead of returning a std::vector<rclcpp::Parameter> return a std::map<std::string, rclcpp::ParameterValue>?

  2. added
    enhancement
    on Aug 6, 2018
  3. nuclearsandwich commented on Sep 7, 2018

    @nuclearsandwich
    Member

    Couldn't you create a "syntactic sugar" API which wraps the existing get_parameters method and instead of returning a std::vectorrclcpp::Parameter return a std::map<std::string, rclcpp::ParameterValue>?

    From talking with @clalancette about this a get_parameters overload which can return a map or fill a provided one would be a good enhancement, although not needed for the work on teleop_twist_joy.
    Another method that would be useful (but again isn't necessary for teleop_twist_joy) is one which can get an entire prefix. An example would be something like std::map<std::string, rclcpp::ParameterValue> get_parameters_by_prefix(std::string prefix); Given the parameters in our example on the wiki this method would be used to get a map of all parameters under the prefix some_lists

  4. added this to the untargeted milestone on Sep 7, 2018
  5. added
    in review
    on Jan 4, 2019
  6. self-assigned this
    on Jan 8, 2019
  7. clalancette commented on Jan 17, 2019

    @clalancette
    ContributorAuthor

    Fixed by merging #575 , so closing this.

  8. removed
    in review
    on Jan 17, 2019
  9. added a commit that references this issue on Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions