module documentation
Turning names from ROS2 into browse names.
A message field or a parameter segment such as child_frame_id is browsed as ChildFrameId, which follows the opensmi naming rule. The raw ROS2 name stays as the DisplayName. A name that does not convert is refused, never fixed silently.
| Function | browse |
Return the browse name for a ROS2 name: split on _, capitalise each part, join. |
| Function | browse |
Return the browse name of each ROS2 name among siblings, keyed by the ROS2 name. |
| Function | pascal |
Return name parts capitalised and joined, which is how opensmi derives a browse name from a field name. |
| Function | suggested |
Return the name that follows the rule and is closest to name, or None if there is none. |
| Constant | _CONVERTIBLE |
Undocumented |
| Constant | _NOT |
Undocumented |
Return the browse name for a ROS2 name: split on _, capitalise each part, join.
child_frame_id gives ChildFrameId and FollowPath stays as it is. Use ros2_name itself as the DisplayName.
| Raises | |
BindingNameError | When the name has a character other than letters, digits and _, an empty part, or does not give a valid browse name (it starts with a digit, or is None, True or False). The message suggests a name where one can be derived. |
def browse_names(ros2_names:
Iterable[ str], renamed: Mapping[ str, str] | None = None) -> dict[ str, str]:
¶
Return the browse name of each ROS2 name among siblings, keyed by the ROS2 name.
A name in renamed takes its new name as it is, which already follows the rule.
| Raises | |
BindingNameError | When one name does not convert, see browse_name. |
DuplicateVariableNameError | When two names give one browse name, such as x_1 and x1. The error names both ROS2 names; the author fixes it with the rename option of the Binding. |
Return name parts capitalised and joined, which is how opensmi derives a browse name from a field name.