Задани на лабораторные работы. ПРК / Professional Microsoft Robotics Developer Studio
.pdf
www.it-ebooks.info
Visually Programming
Robots
The Microsoft Visual Programming Language (VPL) can be used to implement general-purpose programs that have nothing to do with robotics, but because it is part of the Microsoft Robotics Developer Studio SDK, this chapter focuses on robotic applications.
First, the relationship between VPL activities and DSS services is explained, and you’ll learn how to compile a diagram into a C# service implementation. Next you’ll learn how to associate an activity with a specific service. Simple examples are provided that demonstrate how to control actuators and read data from sensors.
More complicated examples are presented in Chapter 12.
VPL Activities and Services
A VPL activity can represent a DSS service. As explained in Chapter 3, a service implements a specific contract by supporting a number of operations on its main port. A service may also implement an alternate contract and its associated operations on a separate port. The VPL activity that represents the service has inputs for all of the operations on the main port and any alternate ports.
You know from the previous chapter that an activity may have more than one action associated with it. Each action has its own set of inputs and outputs. Each action associated with an activity corresponds to an operation supported by the service. For example, when you connect a wire to the input of the SimpleDialog service, three possible actions are supported: AlertDialog, PromptDialog, and ConfirmDialog. If you look at the implementation of the simple dialog in samples\Misc\Utility\Dialog\DialogTypes.cs, the DialogOperations class has operations defined for DsspDefaultLookup, DsspDefaultDrop, Alert, Prompt, and Confirm. The DisplayName attribute for the Alert class is “AlertDialog,” and this Alert operation corresponds to the Alert action in the SimpleDialog activity. The inputs and outputs for this

Compile as a Service. The first time you select this option for a particular diagram, VPL prompts for the destination directory for the service.