Simulated Bumper

Microsoft Robotics

Glossary Item Box

Microsoft Robotics Developer StudioSend feedback on this topic

Simulated Bumper

The SimulatedBumper service demonstrates how to simulate a bumper sensor using the simulation engine's ability to send notifications upon physical collisions.

This sample is provided in the C# language. You can find the project files for this sample at the following location under the Microsoft Robotics Developer Studio installation folder:

Sample location
Samples\Simulation\Sensors\Bumper

Contents:

Prerequisites

Hardware

This service requires no special hardware apart from a suitable graphics card to run the Simulator.

Software

This software is designed to run with Microsoft Robotics Developer Studio.

Setting Up the Service

The SimulatedBumper service is installed automatically with RDS. The sample that shows usage of the SimulatedBumper service is the iRobot Simulation or Simulated LEGO NXT which are available from the Start Menu.

The simulated bumper implements the Generic Contact Sensor service contract so that it can be used by other services.

Running the Service

There are two different methods to start the SimulatedBumper service.

  • Start the service by adding the service to a manifest either through DSS Manifest Editor (DSSME) or manually with any text editor. The below XML shows how the SimulatedBumper service should appear in the manifest.
    XML
    <?xml version="1.0"?>
    <Manifest 
        xmlns:simulatedbumper="http://schemas.microsoft.com/robotics/simulation/services/2006/05/simulatedbumper.html" 
        xmlns:simulation="http://schemas.microsoft.com/robotics/2006/04/simulation.html" 
        xmlns:this="urn:uuid:63f57df1-0ba9-4e02-ba36-237135c74206" 
        xmlns:dssp="http://schemas.microsoft.com/xw/2004/10/dssp.html" 
        xmlns="http://schemas.microsoft.com/xw/2004/10/manifest.html">
      <CreateServiceList>
        <ServiceRecordType>
          <!--Any other services you want to start could be here-->
          <dssp:Contract>http://schemas.microsoft.com/robotics/simulation/services/2006/05/simulatedbumper.html</dssp:Contract>
          <dssp:PartnerList>
            <dssp:Partner>
              <dssp:Service>http://localhost/BumperArrayEntityName</dssp:Service>
              <dssp:PartnerList />
              <dssp:Name>simulation:Entity</dssp:Name>
            </dssp:Partner>
          </dssp:PartnerList>
          <Name>this:SimulatedGenericContactSensors</Name>
        </ServiceRecordType>
      </CreateServiceList>
    </Manifest>
  • Start the service programatically as done in a program that generates a simulation environment:
    C#
    Microsoft.Robotics.Services.Simulation.Sensors.Bumper.Proxy.Contract.CreateService(
      ConstructorPort, "http://localhost/" + bumperArrayEntity.State.Name,
      Microsoft.Robotics.Simulation.Partners.CreateEntityPartner(
          "http://localhost/" + bumperArrayEntity.State.Name)
    );

Summary

This sample covered the following:

 

 

© 2012 Microsoft Corporation. All Rights Reserved.

Show: