| Crates.io | rosrust_dynamic_reconfigure |
| lib.rs | rosrust_dynamic_reconfigure |
| version | 0.2.0 |
| created_at | 2023-05-25 10:40:07.653386+00 |
| updated_at | 2023-07-04 12:11:05.215152+00 |
| description | dynamic_reconfigure implementation for rosrust |
| homepage | |
| repository | https://github.com/ModProg/rosrust_dynamic_reconfigure |
| max_upload_size | |
| id | 874200 |
| size | 92,665 |
This is currently very much WIP and more of an experiment how to best implement it in rust.
dynamic_reconfigure APIIn the process of developing this crate, I noticed that there wasn't any
conclusive documentation on the API used by dynamic_reconfigure. This section
is my attempt at providing that.
The {namespace} is the place where the config is "hosted" normally ~.
Names are expected to match the pattern [a-zA-Z][a-zA-Z0-9_]* and descriptions
can be any string not containing quotes, i.e. " and '1. Though quotes are
probably fine, this might just be a limitation of the original library.
A Node implementing dynamic_reconfigure needs to provide2:
ConfigDescription at {namespace}/parameter_descriptions.Config at {namespace}/parameter_updates.Reconfigure at {namespace}/set_parameters.Additionally to the publishers/service dynamic_reconfigure reads on initialization and writes parameters at
{namespace}/{parameter_name}.
ConfigDescription MessageGroup[] groups
Config max
Config min
Config dflt
max and min describe the ranges for all int and double values, while
dflt contains the default value for all parameters (see Config).
groups contains the hierarchical structure of the configuration, with the root
of the configuration being the group with id=0, all other groups are
subgroups of the group whose id matches their parent.
string name
string type
ParamDescription[] parameters
int32 parent
int32 id
type concerns how the group is displayed in e.g. rqt_reconfigure, which
currently supports3:
'') Normal groupcollapse Group is collapsible, collapse state is controlled by statetab Shows the group as a tabhide If state is false hides the groupapply Shows an Apply button and only submits input when clicked.params describes the parameters that belong to a group.
string name
string type
uint32 level
string description
string edit_method
type is the data type, either4:
strboolintdoublelevel provides a way to optimize partial updates, where the levels of all
modified properties are | binary-ored to create a bit mask.
If edit_method is non-empty, the field is an enum. The contents are then
expected to be the repr() (almost JSON) string of the required constants5:
(one way repr() differs from JSON is its use of single quotes for strings,
though in the decoding direction " should be supported as well, meaning this
is only an issue for parsing as long as no escapes are used.)
{
"enum_description": "{description}",
"enum": [ // for every variant
{
"name": "{variant_name}",
"type": "{variant_type}", // Not used by rqt_reconfigure (should be the same as the param)
"value": "{variant_value}",
"description": "{variant_description}"
// .. srcline + srcfile
}
]
}
Config MessageBoolParameter[] bools
IntParameter[] ints
StrParameter[] strs
DoubleParameter[] doubles
GroupState[] groups
bools, ints, strs and doubles hold the flattened values for each datatype.
string name
{type} value
groups contain the hierarchical information similar to ParamDescription.
string name
bool state
int32 id
int32 parent
state controls state of collapse and hide.
https://github.com/ros/dynamic_reconfigure/blob/2654f228adae0848c6e9b70fcf07f890ca6a2841/src/dynamic_reconfigure/parameter_generator.py#L64-L74 ↩
https://github.com/ros/dynamic_reconfigure/blob/2654f228adae0848c6e9b70fcf07f890ca6a2841/src/dynamic_reconfigure/server.py#L77-L83 ↩
https://github.com/ros-visualization/rqt_reconfigure/blob/988179e349329b5b29f19a891b37d3ac0620ebd2/src/rqt_reconfigure/param_groups.py#L52-L58 ↩
https://github.com/ros/dynamic_reconfigure/blob/2654f228adae0848c6e9b70fcf07f890ca6a2841/src/dynamic_reconfigure/parameter_generator.py#L56-L59 ↩
https://github.com/ros/dynamic_reconfigure/blob/2654f228adae0848c6e9b70fcf07f890ca6a2841/src/dynamic_reconfigure/parameter_generator.py#LL269C21-L269C73 ↩