Support ROS parameter descriptions#68
Conversation
…rvices With this, the parameters are shown in Rqt or Foxglove Studio.
|
This is a neat feature, thanks! I think it's better to make the API changes now and then bump to 0.8 rather than trying to be backwards compatible. You can make the changes in this PR and when you are done I can merge it and make a new release. |
|
Ok, but I'll get to this not earlier than next week. |
The code is already merged, so renaming makes little sense.
With this change, adding doc comments to fields of structures used with `#[derive(RosParams)]` results in those comments being used as parameter description. See r2r/examples/parameters_derive.rs for how to use and test this feature. *BREAKING CHANGE* This commit changes r2r public API. Previously Node::params contained HashMap<String, ParameterValue>, now it contains HashMap<String, Parameter>. If you previously used the ParameterValue from this HashMap, now you can get the same by using the .value field of the Parameter structure.
f6bb388 to
86d1605
Compare
|
This is the version with updated API. I think, it could be reviewed. As described in the commit message, the only change in public API is a different type of I was thinking whether to change API of parameter event stream or not and decided not to change it. If one needs, the parameter description ( |
|
Looks good. 👍 on the well written descriptions. I will make a release shortly. |
With this change, adding doc comments to fields of structures used with
#[derive(RosParams)]results in those comments to be used as parameter description.See
r2r/examples/parameters_derive.rsfor how to use and test this feature.The advantage of this implementation is that it should be backward compatible with all current users of r2r crate. However, it has also some disadvantages:
@m-dahl How stable is r2r API? Would it be acceptable/welcomed to change parameters API as outlined above, say for version 0.8?