Ask a questionAsk a question
 

AnswerHow to configure a Diff Drive in a service?

  • Wednesday, May 21, 2008 11:42 AMMendi10 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi

     

    I am trying to understand whats the diffrence between these 2 code samples if I want to use a simulated diffrenial drive:

     

    using drive = Microsoft.Robotics.Services.Drive.Proxy;

     

    to;

     

    using drive = Microsoft.Robotics.Services.Simulation.Drive.Proxy;

     

    I have notice that only with the first code example I can actually create port to the drive service and send commands...?

     

    Can I create port using the second kind of code too?

Answers

All Replies

  • Thursday, May 22, 2008 8:59 AMThe Technology Tourist Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    You don't need to use the Simulation.Drive.Proxy in your code, and in fact you should not. The Drive.Proxy is a generic contract that works with all differential drives, including the simulated differential drive.

     

    In your manifest you specify what type of robot to use, and what services should run for the robot. So for instance if you start a simulated iRobot Create then you would add a simulated differential drive. Your code still uses Drive.Proxy though because the interface to the simulated drive is the same as for a real iRobot Create. This is one of the key points of MRDS.

     

    Trevor

     

     

  • Thursday, May 22, 2008 9:59 AMMendi10 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Thanks

     

    I am not sure that I have understand what do you mean.. so I will explain my problem better.

    I am using Ben Axelrod Logger & SimRobot service and at the begining of the code the "drive" is implemented like that:

     

    using drive = Microsoft.Robotics.Services.Simulation.Drive.Proxy;

     

    But as I told before, I can't create a Partnership and port to the "drive".

     

    If I have understand you right, I can change the "drive" configuration from:  Simulation.Drive.Proxy;   to:

    using drive = Microsoft.Robotics.Services.Drive.Proxy;

     

    and than I will be able to create Partnership and port to the drive service?

    and in addition I will specify the DiffDrive that I want to use throw manifest.

     

    P.S

    By the way I am using Ben's Services cause I need to log info of the robot movement and his Simrobot have this option built-in.

    I am using the logged info for tests that I am running as a part of a project in my univesity.

     

    Thanks

    mendi

     

     

  • Friday, May 23, 2008 12:32 AMThe Technology Tourist Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Sorry, I think Ben needs to answer this question. He is probably using the simulated drive so that he can get pose information.

     

    Trevor

     

     

  • Saturday, June 28, 2008 10:42 AMqjay Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I'm sure that's where I'm going wrong!

    I am trying to create a autonomy in simulations, but I have been trying to use simulation differential drives.... So the key lies within the MAINFEST, not within the code? We would implment it just like a hardware robot, then change the Manifest?

    Well then, that would make my life a lot easier, but I still get problems.

    I have made the robot with a normal drive and the normal hardware calls. Then using the manifest editor I added the SimulatedGenericDifferntialDrive and the Simulation. I left out the enitity, since that is done in the code (am I correct so far?)

    //drive = Microsoft.Robotics.Services.Drive.Proxy
    [Partner("Driver", Contract = drive.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExistingOrCreate)]
            private drive.DriveOperations _drivePort = new drive.DriveOperations();

    is my driveport partner

    but the error I get is:

    **  Failed setting partners for service [service_name]. Alternate contract URI of partner dssp.tcp://[computer_name]:50001/simulateddifferentialdrive/a2b73736-359f-424f-9bf6-b3136288a545 could not be retrieved [06/28/2008 12:31:59][http://[computer_name]:50000/manifestloader/ac1eee69-2b17-4078-ba15-25ec94b389ef]

    Which leads me to believe I'm doing something wrong with the partner or the manifest editor.

    But it also may be the creation of the Bot itself, I am trying out a LegoNXTTribot, and the problem might be in the Contract created there:

    CreateService(
                    drive.Contract.Identifier,
                    Microsoft.Robotics.Simulation.Partners.CreateEntityPartner(
                        "http://localhost/" + robotBaseEntity.State.Name)
                );

    The robot may be unnecessarily disconnected from the drive itself?
  • Saturday, June 28, 2008 1:01 PMMendi10 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi

     

    I think you should change the creation policy to "Use Existing" and than use the manifest as yo describe, thats should work fine.

    Let me know if it's not working, I will send you a code example.

     

    Mendi

  • Monday, June 30, 2008 3:04 PMqjay Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi there!

    I thought of that as well and it didn't work. But I tried again so I could show you the error:

    **  Failed setting partners for service dssp.tcp://[computer_name]:50001/[project_name]. Alternate contract URI of partner dssp.tcp://[computer_name]:50001/simulateddifferentialdrive/6cac46cd-b171-4294-8f54-c337317ecb4d could not be retrieved [06/30/2008 16:59:23][http://[computer_name]:50000/manifestloader/5553b06d-f7d4-4607-9eb9-e9a22e521e38]

    and then:

    *** Partner enumeration during service startup failed. Partner Name:http://schemas.microsoft.com/robotics/2006/05/drive.html:LeftMotor
    Partner Contract:
        Partners specified statically in service implementation class:
            PartnerAttribute NameTongue TiedubMgr,Contract:http://schemas.microsoft.com/xw/2005/01/subscriptionmanager.html,CreationPolicy:CreateAlways
            PartnerAttribute Name:LeftMotor,Contract:http://schemas.microsoft.com/robotics/2006/05/motor.html,CreationPolicy:UsePartnerListEntry
            PartnerAttribute Name:RightMotor,Contract:http://schemas.microsoft.com/robotics/2006/05/motor.html,CreationPolicy:UsePartnerListEntry
            PartnerAttribute Name:LeftEncoder,Contract:http://schemas.microsoft.com/robotics/2006/05/encoder.html,CreationPolicy:UsePartnerListEntry
            PartnerAttribute Name:RightEncoder,Contract:http://schemas.microsoft.com/robotics/2006/05/encoder.html,CreationPolicy:UsePartnerListEntry
        Partners specified at runtime, in CreateRequest:
            Name: http://schemas.microsoft.com/robotics/2006/04/simulation.html:Entity, Contract: , Service: http://localhost/LegoNXTMotorBase
            Name: http://schemas.microsoft.com/xw/2004/10/dssp.html:CreatorService, Contract: http://schemas.tempuri.org/2008/06/qlegobot.html, Service: d
    ssp.tcp://[computer_name]:50001/[project_name]
            Name: http://schemas.microsoft.com/xw/2004/10/dssp.html:ConstructorService, Contract: http://schemas.microsoft.com/xw/2004/10/constructor.html
    , Service: dssp.tcp://[computer_name]:50001/constructor/26936ae1-25a3-41ab-a989-6ddabaec6b1b
            Name: http://schemas.microsoft.com/xw/2004/10/dssp.htmlStick out tongueartnerListService, Contract: http://schemas.microsoft.com/xw/2004/10/partnerlist.html
    , Service: dssp.tcp://[computer_name]:50001/drivedifferentialtwowheel/19e5575a-79cc-4e56-b63c-58315c692e8b/dss/partnermanager
     [06/30/2008 16:59:28][http://[computer_name]:50000/drivedifferentialtwowheel/19e5575a-79cc-4e56-b63c-58315c692e8b]

    A code sample would be great, thank you so much!!!

    -Quintin
  • Friday, July 04, 2008 10:02 AMqjay Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Solved it. Solution is at

    RobotExodus

    -Quintin