locked
"Multiple instances of one service" - another question about this RRS feed

  • Question

  • I want to run multiple instances of the LBR3 Arm Service in the simulation environment, e.g. have two dashboards to drive two robots in the simulation tutorial four. I changed the manifest of the simulation tutorial to partner with two Arm robots. Here is a snippet from it:

     

    Code Block

    <ServiceRecordType>

    <dssp:Contract>http://schemas.microsoft.com/robotics/simulation/services/2006/07/simulatedlbr3arm.html</dssp:Contract>

    <dssp:PartnerList />

    <Name>this:LBR3Arm</Name>

    </ServiceRecordType>

    <ServiceRecordType>

    <dssp:Contract>http://schemas.microsoft.com/robotics/simulation/services/2006/07/simulatedlbr3arm.html</dssp:Contract>

    <dssp:PartnerList />

    <Name>this:LBR3Arm1</Name>

    </ServiceRecordType>

     

     

    I also added another dashboard as partner, so whenever the simulation tutorial four runs, it starts with two dashboards. I then insert a new entity of the LBR3 arm into the simulation editor (via. the "entity" - "new" dialog of the editor) and call it LBR3Arm1. However, when I connect to the dsshosts node from the dashboard, I can see just one arm service running - and of course can only control one robot.

     

    After reading through the documentation, the related posts on this list and playing with the manifest editor and the VPL-editor to create new services I am now completly clueless as of what to do. As I figured, there is not just one way to do this, but neither of the hints I found helped me.

     

    Can someone please post some guidelines on how to do this in a very easy step-by-step fashion for beginners? I would be very gratefull - and hopefully some others, too.   

    Maybe it would be possible to get a short overview of the different approaches ( e.g. how to do this programmatically, how to do it via manifests, how to do it in VPL, etc. ) and their con's and pro's.

     

    Thanks a lot!

    Wednesday, January 16, 2008 10:15 AM

Answers

  • The issue here is two fold and is actually partially related to simulation entity naming, not DSS services.

     

    1) For two services to start on the same node, they must have unique URIs. Our DSS documentation talks about how a service gets its URI (either through the ServicePort attribute on the service main port or through the ServiceElement in the manifest)

    2) for two entities to coexist in the simulation, the must have unique names as well. So when you insert the second kuka arm, it must get a unique name.

     

    You can control the name the kuka LBR service gets, simply by adding AllowMultiple=true, in the code of the simulated lbr3 service, on the ServicePort attribute. Then recompile and you should be able to start two services, using the same manifest as above.

    OR modify your manifest to add a Service element that tells us exactly what name each LBR3 instance gets:

     

    Code Block

    <ServiceRecordType>

    <dssp:Contract>http://schemas.microsoft.com/robotics/simulation/services/2006/07/simulatedlbr3arm.html</dssp:Contract>

    <dsspTongue Tiedervice>http://localhost/Lbr3Arm1</dsspTongue Tiedervice>

    <dsspStick out tongueartnerList />

    <Name>this:LBR3Arm</Name>

    </ServiceRecordType>

    <ServiceRecordType>

    <dssp:Contract>http://schemas.microsoft.com/robotics/simulation/services/2006/07/simulatedlbr3arm.html</dssp:Contract>

    <dsspTongue Tiedervice>http://localhost/Lbr3Arm2</dsspTongue Tiedervice>

    <dsspStick out tongueartnerList />

    <Name>this:LBR3Arm1</Name>

    </ServiceRecordType>

     

    Thursday, January 17, 2008 12:18 AM

All replies

  • The issue here is two fold and is actually partially related to simulation entity naming, not DSS services.

     

    1) For two services to start on the same node, they must have unique URIs. Our DSS documentation talks about how a service gets its URI (either through the ServicePort attribute on the service main port or through the ServiceElement in the manifest)

    2) for two entities to coexist in the simulation, the must have unique names as well. So when you insert the second kuka arm, it must get a unique name.

     

    You can control the name the kuka LBR service gets, simply by adding AllowMultiple=true, in the code of the simulated lbr3 service, on the ServicePort attribute. Then recompile and you should be able to start two services, using the same manifest as above.

    OR modify your manifest to add a Service element that tells us exactly what name each LBR3 instance gets:

     

    Code Block

    <ServiceRecordType>

    <dssp:Contract>http://schemas.microsoft.com/robotics/simulation/services/2006/07/simulatedlbr3arm.html</dssp:Contract>

    <dsspTongue Tiedervice>http://localhost/Lbr3Arm1</dsspTongue Tiedervice>

    <dsspStick out tongueartnerList />

    <Name>this:LBR3Arm</Name>

    </ServiceRecordType>

    <ServiceRecordType>

    <dssp:Contract>http://schemas.microsoft.com/robotics/simulation/services/2006/07/simulatedlbr3arm.html</dssp:Contract>

    <dsspTongue Tiedervice>http://localhost/Lbr3Arm2</dsspTongue Tiedervice>

    <dsspStick out tongueartnerList />

    <Name>this:LBR3Arm1</Name>

    </ServiceRecordType>

     

    Thursday, January 17, 2008 12:18 AM
  • Dear George,

     

    thank you very much for your reply.

     

    I could not get it to run, though.

     

    I did change the manifest of the simulation ("SimulationTutorial4.manifest.xml") as you suggested (the "OR" alternative), thus creating two services for the simulated LBR3 Arm on the same node, with two distinct URIs, that refer to the names of the simulation entities. I then create a second entity of the Kuka Arm in the simulation and name it according to the Manifest LBR3Arm1.

     

    In the code for the simulated Arm ("SimulatedLBR3Arm.cs") it says already "AllowMultiple=true".

     

    What am I missing? Is there something that I have to do with the "KUKA.LBR3.simulation.xml" file in the config folder?

     

    Thanks again.

     

    Dirk

     

     

    Thursday, January 17, 2008 2:04 PM
  • make sure you are not loading the kuka entity from the config file, but creating it programmatically and giving it a unique name. Unless your manifest references the config file above, then its not used.

     

    I recommend you move this thread in the sim forum, i think there are already other posts (search for LBR3 in the posts) that have multiple arms enabled.

     

    Friday, January 18, 2008 3:36 AM