Partilhar via


Simulation Introduction

Glossary Item Box

Microsoft Robotics Developer Studio Send feedback on this topic

Simulation Introduction

The Microsoft Robotics Developer Studio (RDS) features a powerful Visual Simulation Environment that enables users to develop robots in a rich virtual environment with realistic physics and state of the art rendering. This tutorial teaches you how to start the simulation engine service and rendering window with an existing scene file. It also shows several of the features of the simulator.

Simulation Introduction

Simulation Introduction - Simulation Visualizer

Simulation Introduction

Simulation Introduction - Simulation Visualizer: Physics View

This tutorial teaches you how to:

  • Running the simulator
  • Controlling the simulator
  • Simulator engine features

See Also:

  • Simulation Environment Overview

Simulation Environment Overview

The Simulation Environment is composed of the following components:

  • The Simulation Engine Service - is responsible for rendering entities and progressing the simulation time for the physics engine. It tracks of the entire simulation world state and provides the service/distributed front end to the simulation.
  • The Managed Physics Engine Wrapper - abstracts the user from the low level physics engine API, provides a more concise, managed interface to the physics simulation.
  • The NVIDIA™ PhysX™ Technology - enables hardware acceleration through the NVIDIA™ PhysX™ capable NVIDIA™ graphics processing units (GPUs).
  • Entities - represent hardware and physical objects in the simulation world. A number of entities come predefined with the RDS and enable users to quickly assemble them and build rich simulated robot platforms in various virtual environments.

Prerequisites

Hardware

A graphics accelerator card suitable for gaming, this includes most mid-range to high-end cards purchased within the last four years. The following link has a list of graphics cards we have tried:

https://channel9.msdn.com/wiki/default.aspx/Channel9.SimulationFAQ

Software

This tutorial is designed for use with Microsoft DSS Manifest Editor (DSSMe), which is shipped as part of RDS.

Starting and running the sample

To run this tutorial, we just need to open and run a manifest in DSSMe.

Begin by opening DSS Manifest Editor, which can be found under "Microsoft Robotics Developer Studio 4" in the start menu. The program should appear as the below:

Simulation Introduction

Simulation Introduction - DSS Manifest Editor

Now proceed to open the manifest named "SimulationIntroduction.manifest.xml" from the "File" -> "Open" menu.

Simulation Introduction

Simulation Introduction - SimulationIntroduction.manifest.xml

The manifest should load into DSSMe and appear similar to the below screenshot.

Simulation Introduction

Simulation Introduction - SimulationIntroduction.manifest.xml loaded into DSSMe

After you have opened this manifest, you can run the manifest by selecting the "Run" -> "Run Manifest" menu.

Simulation Introduction

Simulation Introduction - Running SimulationIntroduction.manifest.xml

At this step, if you are running a firewall, you may need to allow VplHost32 and DSSMe to communicate over ports 50000 and 50001.

Simulation Introduction

Simulation Introduction - SimulationIntroduction.manifest.xml running with DSSMe in the background

Controlling the simulator

Keyboard Controls

  • F2 - Toggles display/rendering of the physics primitive visualization. Useful for debugging your physics geometry.

  • Camera Movement:

    • A / Left Arrow / Num Pad 4 - Strafe Left (lateral move left)
    • D / Right Arrow / Num Pad 6 - Strafe Right (lateral move right)
    • W / Up Arrow / Num Pad 8 - Move Forward
    • S / Down Arrow / Num Pad 2 - Move Backward
    • Q / Page Up / Num Pad 9 - Move Up on the Y-axis (vertically)
    • E / Page Down / Num Pad 3 - Move Down on the Y-axis (vertically)
    • Left shift or right shift - Hold down either of these keys to move the camera faster
    • Home - Reset camera to initial position

Mouse Controls

Dragging on the simulator window with your mouse (using the left button) tilts and pans the camera perspective.

Xbox360 Gamepad Controls

  • Left shoulder button - Hold down this button to control the camera using the gamepad
  • Left thumb stick - Controls the camera position
  • Right thumb stick - Tilts and pans the camera perspective

Using various features of the simulator

Saving a scene

Try moving the camera around and then selecting the "File" -> "Save Scene As..." option (pictured below). Type a name like "MyApartmentScene.xml" and save the scene.

Simulation Introduction

Now try moving the camera again and then open the scene you just saved using the "File" -> "Open Scene..." option. You will see that the simulation camera is restored to the position and orientation when you saved the scene.

Using the playback mode

Another interesting feature of the simulator is the playback functionality. Select "View" -> "Playback Bar". You will see the playback bar appears at the bottom of the window.

Simulation Introduction

The playback feature is very simple to use. It allows you to record some actions and play them back for later viewing. Try pressing the record button (the red circle) and move the simulator's camera around. You should notice an image similar to the below.

Simulation Introduction

After you have moved the camera around for a while, press the stop button (the blue square). You will be prompted for a filename. Type any name you wish, such as "ApartmentPlayback.plb".

Simulation Introduction

Now, by pressing the play button (the blue triangle) you can replay the camera movement and any other actions that occurred during the recording. Try pressing the play button and select the playback file you just saved.

Simulation Introduction

Now, by pressing the play button (the blue triangle) you can replay the camera movement and any other actions that occured during the recording. Try pressing the play button and select the playback file you just saved. During playback, you should notice the simulator looks similar to the below image. You can drag the slider around during playback to whatever position you wish.

Simulation Introduction

To exit from playback mode, just click the stop button (the blue square).

Changing the render mode

Switching between different render modes can be useful when you want to verify that the physical properties of an entity match up with its visual representation. Switching between various render modes is trivial. Select "Render" -> "Physics" to switch to physics view or "Render" -> "Combined" to switch to combined rendering and physics.

Simulation Introduction

Simulation Introduction

Simulation Introduction

Viewing simulated web cameras

Often in a robotics scenario one may have a simulated web camera for navigation purposes. The apartment scene contains a simulated webcam inside it. RDS has built in support for viewing the web camera in a separate window. Select the "Camera" -> "Show SimulatedWebcam in separate window". You should see an image similar to the below.

Simulation Introduction

Summary

In this tutorial, you learned how to:

  • Running the simulator
  • Controlling the simulator
  • Simulator engine features

 

 

© 2012 Microsoft Corporation. All Rights Reserved.