Simulated LRF

Glossary Item Box

Microsoft Robotics Developer Studio Send feedback on this topic

Simulated LRF

The SimulatedLRF service demonstrates how to simulate a laser ranger finder using the simulation engine's raycast capabilities.

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:

Samples\Simulation\Sensors\LaserRangeFinder

Contents:

  • Setting Up the Service
  • Running the Service

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 SimulatedLRF service is installed automatically with RDS. The sample that shows usage of the SimulatedLRF service is the simulation tutorial Multiple Simulated Sensors.

The SimulatedLRF implements the Laser Range Finder service contract so that it can be used by other services.

Running the Service

There are two different methods to start the SimulatedLRF service. Either:

  • 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 SimulatedLRF service should appear in the manifest.

    <?xml version="1.0"?>
    <Manifest 
        xmlns:simulation="https://schemas.microsoft.com/robotics/2006/04/simulation.html" 
        xmlns:simulatedlrf="https://schemas.microsoft.com/robotics/simulation/services/2006/05/simulatedlrf.html" 
        xmlns:this="urn:uuid:1ec97e0a-7369-44eb-a5a6-5d29767af745" 
        xmlns:dssp="https://schemas.microsoft.com/xw/2004/10/dssp.html" 
        xmlns="https://schemas.microsoft.com/xw/2004/10/manifest.html">
      <CreateServiceList>
        <!--Any other services you want to start could be here-->
        <ServiceRecordType>
          <dssp:Contract>https://schemas.microsoft.com/robotics/simulation/services/2006/05/simulatedlrf.html</dssp:Contract>
          <dssp:PartnerList>
            <dssp:Partner>
              <dssp:Service>https://localhost/LaserRangeFinderEntityName</dssp:Service>
              <dssp:PartnerList />
              <dssp:Name>simulation:Entity</dssp:Name>
            </dssp:Partner>
          </dssp:PartnerList>
          <Name>this:SimulatedLaserRangeFinder</Name>
        </ServiceRecordType>
      </CreateServiceList>
    </Manifest>
    
  • Start the service programatically as done in a program that generates a simulation environment:

    Microsoft.Robotics.Services.Simulation.Sensors.LaserRangeFinder.Proxy.Contract.CreateService(
      ConstructorPort, "https://localhost/" + lrfEntity.State.Name,
      Microsoft.Robotics.Simulation.Partners.CreateEntityPartner(
          "https://localhost/" + lrfEntity.State.Name)
    );
    

Summary

This sample covered the following:

  • Setting Up the Service
  • Running the Service

 

 

© 2012 Microsoft Corporation. All Rights Reserved.