ros / dynamic_reconfigure

BSD 3-Clause "New" or "Revised" License
48 stars 111 forks source link

Special characters in group name break build #96

Open orzechow opened 6 years ago

orzechow commented 6 years ago

Special characters like "(" in the parameter group name break the build, but might be desirable to put a short description in brackets.

Example:

fov_sub = gen.add_group("Field of view (relative to vehicle frame)")

generates C++ classes named FIELD_OF_VIEW_(RELATIVE_TO_VEHICLE_FRAME), which are obviously bad syntax.

To serve the need for group descriptions (that show up in rqt_reconfigure for example), I see two possiblities:

  1. Support special characters in the group name
  2. Add a description argument to add_group
mikaelarguedas commented 6 years ago

Thanks @orzechow for reporting it.

Support special characters in the group name

Supporting special characters may be challenging as this would (maybe there is an alternative I'm not seeing) require stripping or substituting such characters and could en up in different groups in the same .cfg to collide as they would result in the same class name.

Add a description argument to add_group

This sounds good to me. As this would likely break API we would need to make this feature available in ROS Melodic and later. For the existing ROS distributions (Indigo Kinetic and Lunar) we could check the name string when processing the cfg file to fail earlier with a better error message (such functions are already available and used for parameter names and description strings). https://github.com/ros/dynamic_reconfigure/blob/17e1d4bf6a538d2def097a7f70b139ccd41e9f78/src/dynamic_reconfigure/parameter_generator_catkin.py#L66-L76

See #97 for a a possible implementation of the suggested solution for existing ROS distributions