-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add service node #34
Comments
+1 for this issue For us, the assumption to have only one client advertising a service is absolutely sufficient (for the time being ;-) Let us know, how we can help? |
I was thinking about this issue.. I'm not sure if i really understand why it shouldn't be possible for the rosbridge server to know to which of it's clients a service request should be sent. please correct me if I misunderstood the problem.. |
another option should be to implement a service provider that has it's 'own' dedicated connection to the non ros system and just passes requests to that system as well as just passing responses back to ros by answering the service request as if no connection to 'outside' of ros had been made.. this, of course, would not even need to use rosbridge at all.. ;-) |
The issue does not stem from the possibility of having the client advertise a service, but from the implications of allowing them to do so. In particular, if you think of rosbridge as being a server, then multiple clients can be connected at any point (a common use case). If this is true, then if client A advertised The more I thought about this over the past several weeks the more I agree that this should be brought into rosbridge; however, it should come with a big old warning about the issue above! 😄 |
I'll also add that if we want to move down this direction, we can start making suggestions to how the protocol should look in this thread and then merge it into ROSBRIDGE_PROTOCOL.md |
okay.. I just checked what happens when I try to register a service twice from within ros.. what about using a 'fixed' service that comes with rosbridge to register external services? |
what about the status messages(3.2)? that would be way better than abusing a service for that functionality.. they are marked as experimental.. |
I think that would be the correct way to handle it, yeah -- and nope, no one is currently working on that! 👍 |
another thing.. I checked again how ros itself behaves when a service is registered several times .. : |
I should add that this shows that not even ros itself is giving any feedback about registering an already advertised service.. (above output is from a fresh ros-fuerte installation, not sure if a newer ros version behaves differently) |
Here are some remarks from my side:
ROS directs a service request always to the node (service server) that advertised the service the last. So, if we want to behave in the same way as ROS does, there is also only one node (rosbridge_client) at a time being the service server for a service. This could be handled by mapping a service name to (the currently responsible) node - i.e. the rosbridgeserver client represented by his client-id. If we want to allow only one service server to advertise under a name, we could achieve this by putting the service names in a unique namespace (e.g. /{client-id}/{service-name}). in that way a "add-two-ints"-service that is advertised by two different clients would appear as "/client-1/add-two-ints" and "/client-2/add-two-ints". To sum up, for our scenario, the "ROS"-way would be sufficient and we also do not need notification as we guarantee to have unique service servers ourselves. What do you think? |
And then I am wondering whether we would need a new opmode for advertising a service or whether we could use "advertise" that is used to advertise a topic. It's probably easier to use a new opmode (e.g. "advertise_service") to not mess up with the topic advertisement and to cleanly separate it. |
I also just found that - at least in the ROSBRIDGE_PROTOCOL.md - many-to-many communication with topics is also not supported: |
I like where this is going 👍 I think we should go with what you said/ROS is doing. In the long term, once status messages are implemented, an error/warning should be sent to the client through that, if anything. As for the OP code, you are correct. We should have a completely new op code instead of overloading the topic one. Also, I think you found a typo in the ROSBRIDGE_PROTOCOL.md or else I will have to check what the code is actually doing (I was not the original author of ROSBRIDGE_PROTOCOL or the implementation of rosbridge_suite). I think, it should be that if a topic exists with a different type, it will be dropped since topics can not have many types. many-to-many with topics should be supported |
+1 to @ipa-fxm And I also think it is a typo in the protocol. It should say that it cannot have multiple type for a single topic. many to many topics should be supported. |
just to let you know: I wrote some basic classes that allow advertising and calling of services which are provided by "non-ros" clients, connected to ros via rosbridge. will update on this issue |
feel free to follow my code via: |
service provider does not need to provide module and type within responses
Original discussion started at RobotWebTools/roslibjs#28
Discussion on having rosbridge protocol support advertising services started by @daveconger
Current thoughts on that thread but moved to here to open up more discussion.
The text was updated successfully, but these errors were encountered: