I added suitable string tables to Player so that names can be printed
instead of numbers in messages in order to improve their readability.
Having to looking up interface numbers in player.h takes too long.
Brian advised me that there was some of this functionality already
present in interface_util.* and so that would be the best place to put
string tables relevant to the interface stuff. So I re-purposed the
existing table in there to be suitable for a string table that can be
rapidly looked up via direct index when a message needs to print out. I
left the existing functionality in interface_util intact as it's
slightly different than a string table. (Surprisingly, I found existing
functionality similar to a string table also in the C client library,
similarly underutilised - I decided to supersede that with this, so we
don't have to maintain separate but identical string tables.) I also
added a string table for message types. Error messages can now be more
readable. For example:
warning : skipping subscription to unknown device position2d:0
warning : unsubscription failed for device audio:0
So that this functionality is also available in the client libraries,
and also client programs that may want to use it as Brian suggested, I
made interface_util a separate library, "libplayerutils". I think in the
near future we may want to move some other generic functionality that is
independant of the transport layer and both the server and clients want
into this library as well, but that's a separate matter.
When/if this patch gets committed, I would encourage anyone who needs to
print a message type or interface name in a message to use the lookup
functions interf_to_str() and msgtype_to_str() in their message to
The patch that implements this change is now in the patch tracker.
Robotics research group, University of Auckland