Subscribing and Publishing with generic type of message
Hello,
This question is subsequent to this one.
I'm still working on the connexion between Neural Network Simulator (Prométhé) and ROS. Now I know how to retrieve my publisher and subscriber pointers in the Prométhé comunicating functions. But the issue is the following :
When going from Prométhé to ROS, I have Groups of Neurons (i.e. a certain number of activity level <=> a table of floating values between 0 and 1) that I want to put them in a message to send them through a topic. But I can't know before execution what type of topic will be required because it depends on the link that is drawn in the network (ad the simulator will be compiled for a while). The problem is equivalent from ROS to Prométhé : to subscribe to a topic, I have to know which type it is to define the callback function.
So is there a way to be transparent from the type of topic (and compatible with C, meaning that I can't use templates) like a function that dynamically determines type or a "generic" type that gathers every other types (a "common_message" type) ? Or must I define a look-up table / switch case to use the right message depending on the input/output data (considering that I can get a user specified option giving the wanted type) ?