I've got an XML file in my project containing data that shall be addressable globally by any node that is running in my ROS. What's the royal road to achieve this? Is setting up an srv that serves that data on request the ideal way?
//additional information
It's relatively simple data that's mainly accessed via XPath. It consists of a tree whose branches are used to convert a path like description of an ID into a byte sequence. Each individually named node has an attribute 'id'. I use XPath to retrieve the sequence of IDs of a leaf node up to it's farthest ancestor one layer below the root node.
Example:
An XPath of /IDTree/Node1/Subnode1/Subsubnode1 shall be converted to the byte sequence [0x01,0x01,0x01]. Additionally, this conversion should work in both directions.
The XML data for this would look like that for instance:
<IDTree>
<Node1 id="0x01">
<Subnode1 id="0x01">
<Subsubnode1 id="0x01" />
</Subnode1>
</Node1>
</IDTree>
The names of the nodes aren't specified anywhere. Only the structure which is always three layers deep below the root node and every node must have its id attribute set appropriately.
The real tree is way bigger and stored in an XML file called idtree.xml which I've placed in the root folder of my catkin workspace.
I'd like to be able to make this conversion anywhere in my ROS project. I guess a service is the ideal way for this, am I right?
Originally posted by Hendrik Wiese on ROS Answers with karma: 1145 on 2013-07-08
Post score: 1
Original comments
Comment by dornhege on 2013-07-09:
If you're interesting in queries like what's the byte sequence along Node1, then yes, that sounds like a service.