Node name / parameter name sanitization

Are there any helper functions for sanitizing names of nodes or parameters in the core of the ROS2 software stack?

A while ago, I opened this PR which prevents moveit2 rviz2 plugin from creating an invalid node name by sanitizing it, and DLu made a good point about where such sanitization functions should be implemented.

After some research, I found that there were some name validation functions in rmw:

However, I could not find any sanitization functions in rmw, rclcpp, etc.

Is there anyone who knows whether such functions are implemented in the core packages?
If not, what would be the best package to add these functions to?

P.S. during making the PR, I also found that there is no concrete specification about what characters should or should not be used in parameter names. Something has to be done for this issue too…

Is there anyone who knows whether such functions are implemented in the core packages?
If not, what would be the best package to add these functions to?

as you mentioned, rmw does have some functions, but not exposed to client layer.
probably we can have those aligned with rmw_validate_node_name, and bring those up to client layer via rcl as utility functions?

I also found that there is no concrete specification about what characters should or should not be used in parameter names. Something has to be done for this issue too…

true. this could be good enhancement as well.

probably this can be one of the topic in client wg meeting as well, ROS 2 Client Library Working Group [Update]

CC: @clalancette @wjwwood @alsora

Thanks Tomoya for your attention to this matter.

Yes, please do consider it as one of the topics in the working group.

The parameter name verification would be a separate issue, so I will open another thread once I gather the information out there to help discussion.

@tokoro10g please feel free to jump in the meeting!