Open Antoni-Robotec opened 1 year ago
@Antoni-Robotec it would be good to use name validation / rosify tools which are already available in the Gem
Linked to #414
I looked into it a little and the validation tools don't perform a full check. https://docs.ros2.org/dashing/api/rcl/validate__topic__name_8h.html A full validation can be done with: https://docs.ros2.org/dashing/api/rmw/validate__full__topic__name_8h.html However, it first requires adding the namespace (I think it's equivalent if we don't add it and validate the namespace separately?) and expanding the name (for example, currently we allow for stuff like "{node}" to be in the topic name, which when creating the server is expanded to the name of the node we are publishing from): https://docs.ros2.org/dashing/api/rcl/expand__topic__name_8h.html I think what needs to be done is deciding whether performing this in the field validation is feasible and either doing so, or adding try catch statements around server creation.
As discussed in issue triage, the issue is a case of issue https://github.com/o3de/o3de-extras/issues/414. It is being implemented. Raised priority from minor to major.
Invalid names can lead to a crash. To replicate:
terminate called after throwing an instance of 'rclcpp::exceptions::RCLError' what(): topic name must not contain repeated '/', at ./src/rcl/node_resolve_name.c:102 Aborted (core dumped)
A similar error occurs when assigning a name with consecutive '/' to a topic. We are probably missing some try-catch statements.