Megosztás a következőn keresztül:


Simulation Empty Project

Glossary Item Box

Microsoft Robotics Developer Studio Send feedback on this topic

Simulation Empty Project

The purpose of this tutorial is to create a base project that you can use for any project that uses the simulator. Instead of rewriting the same code over and over again for each service that uses the simulator, you can use this project as a starting point for any custom services you want to write.

This project was developed using the DSS Service Visual Studio Wizard that are installed when RDS is installed.

Using the DSS New Service Visual Studio Wizard

The DSS New Service Visual Studio project wizard allows you to create a DSS service that partners with any number of existing DSS services. This wizard will save you lots of redundant typing, especially if your service partners with a number of existing services.

To use the DSS New Service wizard, start Visual Studio. Then select the "New Project" option.

Simulation Empty Project Creating

Simulation Empty Project Creating - Creating a new project

Under "Visual C#" -> "Microsoft Robotics", select the "DSS Service (2.0)" project. After giving your project a name, click "OK".

Simulation Empty Project Wizard

Simulation Empty Project Wizard - Creating a DSS Service (2.0) project

Now the DSS New Service dialog should appear. Under the "Service" tab, you can leave it to the defaults that are populated in the dialog. It should appear like the below:

Simulation Empty Project Name

Simulation Empty Project Name - Giving the service a name

Under the "Partners" tab, search for the "Simulation Engine" services in the "Services" text box. Click the "Add as partner" button to add the "Simulation Engine" as a partner to the sample service. Use the defaults that are populated for the "Simulation Engine".

In short, a "partner" is a different service that your service requires to run. Partnering with a service allows your service to communicate with the service you partnered with.

Simulation Empty Project Partners

Simulation Empty Project Partners - Adding partners the service requires to run

We'll skip the "Alternate Contracts" tab for now since it is not necessary for our sample service. Click "OK" and the service will be generated. You can run this service right away and it will start the simulation engine. All that will appear is a black screen.

Adding additional references to the base project

In addition to the assemblies that the DSS New Service wizard adds when adding the SimulationEngine as a partner to our service, we'll also add a few other assemblies that are necessary for defining custom entities and interacting with the simulator. To add a reference, select "Project" -> "Add Reference." When the "Add Reference" dialog appears, select the "Browse" tab and locate the "bin" directory under the folder where you installed Microsoft Robotics Developer Studio 4.

Add the SimulationEngine.dll, SimulationCommon.dll, SimulationCommon.Proxy.dll, RoboticsCommon.dll, RoboticsCommon.Proxy.dll, and PhysicsEngine.dll. The below two pictures show you how to add the SimulationEngine.dll assembly to your project. The others can be added in a similar fashion.

Simulation Empty Project References

Simulation Empty Project References - Adding additional references

Simulation Empty Project Selecting

Simulation Empty Project Selecting - Selecting the references

Summary

Now you have defined a nice empty sample project that can be used for subsequent simulation services. In this tutorial, you learned how to:

  • Using the DSS New Service Visual Studio Wizard
  • Adding additional references to the base project

 

 

© 2012 Microsoft Corporation. All Rights Reserved.