locked
RoboticsTutorial3: Connecting to Front&Rear bumpers simultaneusly RRS feed

  • Question

  • Hello,

    I am walking through RoboticsTutorial3 now. Here we getting notifications from both front & rear bumpers. But really I am getting messages only from single touch sensor.

    But in any way how can it work?
    1) In original tutorial RoboticsTutorial3Service binds to abstract touch sensor

            [Partner("Bumper",
                Contract = contactsensor.Contract.Identifier,
                CreationPolicy = PartnerCreationPolicy.UseExisting)]
            contactsensor.ContactSensorArrayOperations _contactSensorPort = new contactsensor.ContactSensorArrayOperations();

    In LEGO.NXT.TriBot.manifest.xml single touch sensor service is created. Hence we can't get notifications from two sensors???

        <ServiceRecordType>
          <dssp:Contract>http://schemas.microsoft.com/robotics/2007/07/lego/nxt/touchsensor.html</dssp:Contract>
          <dssp:PartnerList>
            <dssp:Partner>
              <dssp:Contract>http://schemas.microsoft.com/robotics/2007/07/lego/nxt/touchsensor.html</dssp:Contract>
              <dssp:Service>LEGO.NXT.TriBot.Bumper.Config.xml</dssp:Service>
              <dssp:PartnerList />
              <dssp:Name>dssp:StateService</dssp:Name>
            </dssp:Partner>
            <dssp:Partner>
              <dssp:Contract>http://schemas.microsoft.com/robotics/2007/07/lego/nxt/brick.html</dssp:Contract>
              <dssp:PartnerList />
              <dssp:Name>touchsensor:brick</dssp:Name>
              <dssp:ServiceName>this:LegoNXTBrickv2</dssp:ServiceName>
            </dssp:Partner>
          </dssp:PartnerList>
          <Name>this:LegoNXTTouchSensorv2</Name>
        </ServiceRecordType>

    I tried to add another sensor in manifest and both services work and synchronize with robot correctly. But how to access those functionality from RoboticsTutorial3Service (another partner or...)?

    Also I tried to add LegoNXTContactSensorArray in LEGO.NXT.TriBot.manifest.xml as a requested service description and added to SensorConfigurations:
    First:
    RangeName=Pressed
    DeviceModel=TouchSensor
    DeviceName=frontBumper
    SuccessRangeMin=0
    SuccessRangeMin=1
    Second: same but name is rearBumper

    But this also doesn't work. Even serivces are not connected to robot (I think I missed something).

    Can somebody describe how to work with two (touch) sensors of same type???


    I am running: MSRS 2008 Express
    Hardware: Lego NXTv2

    Thanks!
    Monday, February 16, 2009 10:39 AM

Answers