On a different topic, here's my musing on the architecture of robot model tools...
here's an outline of the stack as it exists right now (kinda):
Robot description schema: describes the elements, hierarchy and behavior of the format.
Schema parser: converts the description file into data accessible by a C++, Python or other API. Example: urdfdom
External formats parser/converter: convert the description file into another format, or convert it to an external API representation. Example: collada_parser, kdl_parser
State publisher: Combines information about the robot's kinematic
state with its static
description for forward kinematics and publishes that over the network. Example: joint_state_publisher and robot_state_publisher.
and more...
The guidelines for writing these tools in ROS 2 should be (these may seem like no-brainers, but as Sachin pointed out they are not followed in the robot_model repository currently):
We should stick to one internal API representation used by ROS-specific tools such as the ROS 2 equivalents of Rviz, MoveIt, state_publisher. Let's call that the URDF 2 API for now.
Compatibility libraries with other standards like URDF 1.0, SDF, etc. should convert from these external formats to the URDF2 API. They should not have ROS communication-specific dependencies anywhere in the dependency tree.
Similarly, tools higher in the stack should not have knowledge of external parser libraries (e.g. collada_parser). The URDF 2 API should be general/powerful enough to represent the other supported formats, so parsing the raw representation of another format should not be necessary.
^ The argument against this is when there is a library that does not use the URDF 2 API but is necessary for higher-level calculations, such as needing KDL in MoveIt. But KDL is not a description format, it is another API. kdl_parser is a package for parsing URDF and converting it into a KDL representation. I think the reduce redundancy kdl_parser should just be kdl_converter, and is simply a shim that converts a URDF API representation to KDL (and vice versa).
(this idea is a bit crazier)
Tools up in the stack can parse the robot description from a parameter in xml format, ROS-1 style, OR they can use intra-process communication (probably an intra-process service) to access a unique_ptr to the API representation of a robot model to skip the parsing step (useful if there are several nodes in the same process sharing a robot description, so that each of those nodes doesn't have to duplicate the parsing step). Using this intra-process access trick, you could inject one of the external parsing libraries into the same process as one of your tools and share it without that tool having any knowledge of collada, SDF, etc.