-
Notifications
You must be signed in to change notification settings - Fork 912
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
roscpp missing getParam() for lists and dictionaries #263
Comments
I think many of us have implemented similar things. It would be great to see some of them added to the core libraries. Do you have an implementation of your own floating around somewhere? |
Sorry for the delayed response. I have getters for vectors and maps Bea On 8/21/2013 8:54 AM, Jonathan Bohren wrote:
|
Here is my code. Some thoughts:
|
@b-adkins The best way to contribute a patch is by "forking" a given repository, making your changes in the fork, and then creating a "pull request" (tutorial here). I've been waiting for three years or so for someone to implement these features, and I think part of it is because while most submissions work, they're not up to the standards of the ROS dev team. I took some time thisafternoon to create a patch with a similar scope, but a little more polished: #279 and hopefully this can get merged in soon and roscpp can stop envying rospy... |
PR has been merged and package released. |
White background to contrast with black pens
"roscpp's parameter API supports all of [ROS Parameter Server's data types], though it is only easy to use strings, integers, floats and booleans." (roscpp Parameter Server)
Why? I don't see why an application developer needs to learn XmlRpc and re-implement the wheel. I believe it's quite doable to reconstruct lists and dictionaries (at least of primitives) entered in YAML to the parameter server.
I propose a patch with templated varieties of NodeHandle::getParam() and param::get() that:
Extracts lists as
Extracts dictionaries as
Proposed interface:
(n_max is the maximum elements the passed buffer(s) can hold, to prevent buffer overrun)
The C++-style versions would be very easy to use. The C-style types may be useful for performance.
I've essentially already written these for another project. I would like to offer my code as part of this proposed patch.
EDIT: For easy reference, here is <ros/param.h>:
https://github.com/ros/ros_comm/blob/groovy-devel/clients/roscpp/include/ros/param.h
Also note that the methods would need to be wrapped NodeHandle:
https://github.com/ros/ros_comm/blob/groovy-devel/clients/roscpp/src/libros/node_handle.cpp
The text was updated successfully, but these errors were encountered: