Closed corot closed 10 years ago
rosbridge_library has a dynamic message loader which you might be interested in. https://github.com/RobotWebTools/rosbridge_suite/blob/develop/rosbridge_library/src/rosbridge_library/internal/ros_loader.py#L40-L45
Forget this if it does not fit in the purpose.
@corot why would the server need the message definitions? I thought they would just be taking some fields and storing these in the database - e.g. relevant ones here would be
I can't see where it would actually need the message definition.
Some code that might be useful. C++ and python relaying of unknown topics at a lower level (xmlrpc/master level):
https://github.com/stonier/multimaster_experimental/tree/master/foreign_relay/src/nodes
Yes, yes. You are right, but at some point all the solutions I have inspected import the package containing the messages. Or, as foreign_relay does, reads from the master the published topics and get topic type from there (what cannot be done in the WC server: he will publish already unpublished topics).
But I'm not worry too much about this: In most cases, the messages will be already in the server workspace, and if not, the only victim is PublishAnnotations, who will answer: "Message type not available for publishing"
I suspect the client library will require the message package import floating around on the ROS_PACKAGE_PATH as well. It will have to pack binary data into these message type instances.
right. but in the client it's not a problem: if the client wants some kinds of annotations is because he knows them.
2014-06-12 3:14 GMT+02:00 Daniel Stonier notifications@github.com:
I suspect the client library will require the message package import floating around on the ROS_PACKAGE_PATH as well. It will have to pack binary data into these message type instances.
— Reply to this email directly or view it on GitHub https://github.com/corot/world_canvas/issues/5#issuecomment-45819774.
We can close this.
Yes:
but.... as roslib.message import get_message_class internally imports the module containing the topic type, it must be in the Python path, what will not always be the case: the code running on the server is not supposed to have access to all the annotations' message definitions that he must handle.
Or will he??? I think this will impose a hard (but reasonable) constraint to the world canvas server use.