locked
Searching among multiple services of same type RRS feed

  • Question

  •  

    Hi,

     

    this is a typical RTFM question, but please bear with me as I couldn't find a manual.

     

    I'm developing multi-robot systems with the simulator, and was wondering if there's any shortcuts for accessing specific instances of simulated bumper arrays, differential drives etc.

    You can search the entire service directory and see what's running and try to guess what's what, but is there a direct way to subscribe/alter these?

    For example, if you use

     

    Microsoft.Robotics.Simulation.XX.Proxy.Contract.CreateService()

     

    can you later on access this directly, and give it an easily recognizable name or something while you're at it?

     

    Having DSS/Robotics able to dynamically load up hardware modules without knowledge of what's going to be there is great. However, the methods for accessing sensors/drives in Robotics tutorials are no good if you've got more than one robot, as you end up subscribing to the first service you find. Also, the method used in Simple Dashboard example (get a list of all relevant services) doesn't give you info on which laser range finder belongs to which robot - as far as I could see.

     

    So, I was wondering if someone knows how to be "selective" when it comes to your Partners..

     

    For example, if I create a robot called A and attach bumpers to it, is there a way to specify that I want A's bumpers for a partner service, not B's or anyone else's?

     

    Best regards.

    H.R

    Friday, May 25, 2007 3:13 PM

Answers

  • You can easily control the URI a service instance gets assigned to, when you create it. You can assign a URI to a service, either from the manifest, or when you send the Create message to the constructor. Basically, fill in the ServiceInfo.Service field to be the URI your service needs ot take.

     

    So if i am starting 10 bumpers for example, i can give the all a different URI, and then qhen querying the directory, distinguish them from the URI they have.

     

    Another approach, cleaner, but more involved, is to specify a partner when you create the service. ServiceInfo (the body of the Create request), has a PartnerList field. In there, you can add a PartnerType instance, and you can set the Name to be anything you want.

     

    Then, when you want to distinguish services, query/subscribe for them in the directory, then look at their parterlist: The ones with the named parter, tell you their functionaloty, etc.

     

    Usually, when talking about multiple bots, multiple dssnodes should be used. Its cleaner, more robust and ofcourse each robot is easily identified by its unique http/tcp port.

     

    hope this helps. Service tutorials talk about partners a bit more, and so does the Dss User guide.

     

    Saturday, May 26, 2007 4:56 AM