ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I guess it depends...
If the data is somewhat simple, the best way might be to put it on the param server.
If processing and reading the data takes considerable effort either in computation time or in code, and/or if the data should somehow be converted, your solution of a node that provides this data as a service certainly works.
Another option is to put either a URL to the xml file or the actual xml contents on the param server for other nodes to read. In either case, each node needs to parse in the xml data by itself. Both solutions are natively supported by the param server.
For the first solution, a package relative URL like package://my_data_pkg/xml/stuff.xml
is customary. The resource_retriever package can also load that directly into memory. Alternatively the ROS API provides ways to resolve the package path locally.
The second solution can be done directly by the param server, similar how a robot_description is usually loaded as a textfile.