ROBOTICS TUTORIALS
4. Advanced Robotics Tutorials
1. ROBOTICS TUTORIALS
Here is an overview of the categories of tutorials and samples that are provided to help you get started using Microsoft Robotics Studio.
· Setting Up Your Hardware Overview Microsoft Robotics Studio can be used with a variety of robot platforms. Here you can find information about how to set up your hardware and how you may communicate with it from a PC. This will also help you getting setup for running the Basic Robotics Tutorials Overview.
· Basic Robotics Tutorials Overview The basic robotics tutorials help you getting started writing the very first service for your robot. The tutorials take you from getting input from a single sensor to control an actuator to being able to write a "drive-by-wire" application where you can move your robot around.
· Advanced Robotics Tutorials Overview These tutorials demonstrate more advanced topics including autonomous navigation to how you can build your own support for your robot. In addition, we provide tutorials for how to provide rich UI that allows you to control and monitor your robot remotely from either a Web Browser or from an Instant Messaging client.
· Technology Samples Overview Here you can find an interesting set of samples that demonstrate how to use Microsoft Robotics Studio with various technologies ranging from text-to-speech to GPS and other cool stuff.
2. SETTING UP YOUR HARDWARE
Setting Up Your Hardware Overview
Microsoft Robotics Studio can be used with a wide variety of robotics hardware. In this section you can find information for setting up some but the list is by no means exhaustive. Information about additional hardware platforms is provided by Microsoft Robotics Studio Partners, the Microsoft Robotics Studio developer community, and on the MSDN forums (see references at the bottom of this topic).
In general, follow the instructions for setting up your hardware and its means of communication to your PC running an operating system supported by Microsoft Robotics Studio. The following information may be helpful in setting up the robots supported by the tutorials included in this release. In addition Robotics Tutorial 6 (C#) - Remotely Connected Robots provides step-by-step instructions for how to develop support for other remotely connected robotics hardware.
fischertechnik
Several of the Robotics Tutorials included in Microsoft Robotics Studio can only be used with the fischertechnik 16-bit based Robo Interface (93293), using either the USB or RF serial connection (Microsoft Robotics Studio does not support the older, 8-bit Robo Interface).
To use the fischertechnik Robo Interface, install the fischertechnik drivers on your PC. Then plug in the USB connection between your PC and the Robo Interface or plug in the fischertechnik RF device into your PC's USB port following the instructions found in your fischertechnik documentation. When completed, applying power (either an appropriate battery pack or AC adapter) to the Robo Interface should be all that's necessary to run the Microsoft Robotics Studio tutorials.
Once you have the PC software installed and the Robo Interface properly setup with its connection to your PC and powered on, you should be able to use it with the Microsoft Robotics Studio tutorials. The tutorials require a special configuration file that describes the way you have sensors and motors connected to the Robo Interface. For further information about this file, refer to the individual tutorials.
Note that Microsoft Robotics Studio comes with several manifests tuned for particular robot physical configurations. We currently have configuration files for the Bionic Walker and the RoboMobile physical kits. You can verify that the platform works by executing following command line from a Microsoft Robotics Studio Command Prompt:
iRobot Create and Roomba
The Robotics Tutorials can be used with both iRobot Roomba and Create when connected to the PC using a serial port or Bluetooth adapter. To use either the iRobot Roomba or Create with Microsoft Robotics Studio, follow the manufacturer's directions for establishing a connection between the PC and the robot.
When you start one of the Robotics tutorials like for example Robotics Tutorial 4 (C#) - Drive-By-Wire for the first time, a Web browser window will open automatically allowing you to configure the hardware. Please change the SerialPort value to the COM port connecting the PC to the robot. If you are using a Bluetooth adapter that assigns separate inbound and outbound serial ports for the connection, use the outbound port.
To verify that your robot is connected, you can start a DSS node using any of these command lines from a Microsoft Robotics Studio Command Prompt:
To start the basic iRobot service exposing the iRobot SCI command interface:
dsshost /p:50000 /t:50001 /m:"samples\config\iRobot.manifest.xml"
To start the drive service as part of Robotics Tutorial 4 (C#) - Drive-By-Wire:
dsshost /p:50000 /t:50001 /m:"samples\config\iRobot.Drive.manifest.xml" /m:"samples\config\RoboticsTutorial4.manifest.xml"
To start the drive service together with a simple dashboard service which can be used to drive the robot around with a joystick or a mouse:
dsshost /p:50000 /t:50001 /m:"samples\config\iRobot.DriveDashboard.manifest.xml"
LEGO MINDSTORMS RCX - Robotics Inventions System
This topic provides information about getting up and running using Microsoft Robotics Studio with LEGO MINDSTORMS RCX.
What to expect when installing the LEGO RIS 2.0 software
The LEGO RIS 2.0 software on the CD that comes with the LEGO kit will install and run on Windows 98, Windows ME, and Windows XP. It may install on other Windows versions, but there is no support by LEGO and, according to some discussion forum threads, the software is very likely to crash. We strongly recommend using only a version of Windows XP for programming LEGO MINDSTORMS RCX using Microsoft Robotics Studio.
After installing the software from the LEGO RIS 2.0 CD onto your computer, you will likely need to install one (possibly two) software patches from LEGO:
1. For all XP systems, there is a bug that starts the RIS Software each time the PC system is restarted. Download RIS20XPPatch.exe from the LEGO web site and install the patch following their instructions.
2. For PCs using Hyper-Threading (HT), you will need to install an updated IR tower driver to prevent system lockups. This patch file is also found on the LEGO web site. Download and save the Tower164 patch, double-click it, then follow the on-screen instructions to finalize the patch installation. It is also recommended you install it if the PC has a dual-core CPU.
Some dual-core systems have issues running the LEGO software even after this patch has been installed.
What should I expect the first time I run the LEGO RIS 2.0 software?
First plug the LEGO infrared (IR) tower into a USB port. The hardware wizard should detect the device and install it automatically using default selections. (NOTE The hardware wizard needs to run every time you connect the IR tower to the PC.)
Next, make sure your speaker volume is turned up so you can follow the directions given when the application is running. Start the LEGO RIS 2.0 Software from the desktop shortcut or from the Programs menu. The first time you run the program, select the top menu option, Run.
During installation, this software takes control of your screen and you will not be able to switch between other running programs. You will be guided through the setup of the IR tower, the downloading of the LEGO RCX firmware via the IR tower to the RCX brick, and the testing of the effective range of communication between the IR tower and the RCX brick. Once finished, you can exit the program. The Constructopedia booklet included with the LEGO kit contains additional information about this on page 4
PLEASE NOTE THE FOLLOWING:
· Do not run other applications while performing the download of firmware (basically, the LEGO operating system) to the RCX brick.
· It is not unusual for it to take several download attempts before the firmware successfully transfers to the RCX brick. Three or four attempts before succeeding is also not unusual.
· The download of the firmware takes approximately four minutes. During that time, you should see a faint flashing green light coming from the IR tower and a counter on the face of the RCX brick going from 0000 to 2500. If the download fails you will be given the opportunity to retry.
· After completing the download of the firmware, the LEGO program downloads five proprietary sample applications to the RCX brick. This takes approximately one minute. The counter on the face of the RCX brick will go from 1 to 5 as the sample applications are downloaded. If the download fails, you will be given the opportunity to retry.
· If the batteries drain too low or you must remove the batteries from the RCX brick, it will be necessary to re-download the firmware.
Where do I get the software needed to program the RIS 2.0?
If you have not done so already, please download and install a copy of Visual Studio Express 2005 Edition onto your Microsoft Windows XP computer. Installing Visual Studio also ensures you have Microsoft .NET 2.0 installed as well.
Why Windows XP? The RIS 2.0 system was originally designed for Windows 98. Although it has support for Windows XP, it does not work well with Windows 2000 or Windows 2003 Server. Additionally, Microsoft Robotics Studio requires .NET 2.0, which generally requires more hardware horsepower than found on most Windows 98 and Windows ME computers. We therefore recommend sticking with a version of Windows XP for your MINDSTORMS RIS 2.0 coding projects.
Next, you need to install the LEGO MINDSTORMS RCX Software Development Kit (SDK) 2.5. This can be downloaded for free from LEGO.
Once the MINDSTORMS SDK is installed and you turn on the RCX brick, you should be able to begin using the Microsoft Robotics Studio tutorials. The tutorials require a special configuration file that describes the way you have sensors and motors connected to the RCX brick. For further information about this file, refer to the tutorial instructions.
Tips for setting up LEGO software and Microsoft Robotics Studio for LEGO MINDSTORMS RCX
The following is intended to provide some realistic expectations for what can be accomplished with this release of the Microsoft Robotics Studio for LEGO MINDSTORMS.
There are some known issues to be aware of:
· Some newer computers will not recognize the LEGO IR tower. For example, we have been unable to install the IR tower driver on a Toshiba Protege 3500 Tablet PC. A similar problem has been mentioned on some web forums for certain Dell desktop models, but we do not have a list of model numbers.
· Postings on several different forums related to LEGO MINDSTORMS RIS 2.0 have indicated a problem getting the LEGO software to communicate with the IR tower on some PCs with dual-core processors. Use of the Tower164.exe patch discussed earlier does not address this problem directly, but there are unconfirmed reports that it has, in some cases, resolved the issue.
· Changing the batteries in the RCX brick or letting the RCX brick sit for long times between uses can require the re-download of the LEGO firmware by starting the LEGO RIS 2.0 software, selecting the Settings menu option, and then selecting Download Firmware. If you are prompted for a password, simply enter your name and press enter.
The challenges of infrared-based communication ("tethered")
Because your code is running on the PC, think of LEGO IR tower as a wireless tether (a lifeline) between the PC running your application and the RCX brick that must execute physical actions based on those instructions. The IR tower is what makes this possible. If the communications link with the tower breaks at either end, the execution of your program stops.
Because the RCX brick is a very simple computer compared to your PC, you need to keep in mind its limitations when developing your code. For example, the RCX brick does not raise events. The IR tower must poll the brick for changes in hardware state and the information gathered must then be interpreted by your Microsoft Robotics Studio program as being an event that needs to be handled or not. Likewise, the tower using the relatively slow infrared signals form of communication may experience backlogs in instructions to the brick from the computer. In some test application development we noted the following issues may arise:
·
Communications latency.
There may be a several second delay between when an event occurs on the RCX
brick and when it is recognized by the PC. Long delays can cause an event to be
lost altogether. Limiting situations and circumstances that can cause tower
interference can be important in these cases, such as: preventing direct
sunlight from shining onto the tower, keeping the robot within a reasonable
range of the tower (about 8'-10'), and not placing obstacles in the signal path
between the RCX brick and the tower.
·
Losing commands.
This has occurred most often when issuing motor commands from a sensor event
handler.
·
Setting the sensor type.
You may experience a narrow window of time in which this works. We recommend
setting sensor types in the main form load event of your application.
·
Queued commands may keep running.
Even after stopping the running application on the PC, the robot may continue to
run queued up commands. In such cases it may be necessary to turn off the brick
manually.
· We continue to explore resolutions and work-arounds for these issues, but you should be cognizant of them in the meantime when trying to create and debug your applications.
LEGO MINDSTORMS NXT
LEGO MINDSTORMS NXT refers to the 32-bit robotics kit supplied by LEGO. The LEGO MINDSTORMS NXT provides Bluetooth and USB communication between the PC and the NXT. This section describes how to get the NXT and Microsoft Robotics Studio to talk to each other.
Once the setup has been completed you can try out the LEGO MINDSTORMS NXT tutorials (see LEGO MINDSTORMS NXT Tutorials Overview).
To prepare your NXT for use with our tutorials make certain you have the latest NXT firmware installed. In order to accomplish this, you will need to run the LEGO MINDSTORMS NXT software which came with your NXT.
From the menu, select “Tools”, then “Update NXT Firmware…” Click on the “Online Update: [Check]” button. This will open a web page to LEGO MINDSTORMS NXT Software Updates. Download the latest firmware from that web site and continue updating the firmware following the instructions provided by LEGO.
The current samples and tutorials provided in the Microsoft Robotics Studio only support Bluetooth communication. This means that you will need a Bluetooth adapter on your PC to use the tutorials. In order to configure your PC's Bluetooth adapter to communicate with the NXT you typically need to use the Bluetooth manager provided with your Bluetooth adapter to create a secure partnership connection between your PC and the device. Follow the instructions provided by your computer (if already configured with Bluetooth) or your Bluetooth adapter.
When initiating a Bluetooth connection make sure to initiate it from the PC to the NXT. If you have trouble with the Bluetooth connection, try performing the following steps:
1. Open the Bluetooth configuration applet. You can usually bring up this page by double-clicking the Bluetooth icon in the taskbar.
2. Select Add a new connection or instruct the PC to search for Bluetooth devices which are in range.
3. Once the device is paired, view the properties or details to find out which COM port has been assigned to the NXT. Sometimes two ports are assigned. In this case, you want the outbound connection.
4. If the Bluetooth manager does not list the COM port, open the Device Manager on your PC and view Ports (COM & LPT) to help discover the COM port which is assigned to your NXT connection.
I cannot get the Bluetooth connection set up from the PC to the NXT
1. Try to disable then re-enable your Bluetooth antenna.
2. Try restarting the PC.
3. Try clearing your Bluetooth contacts on the NXT.
4. If you are using a Bluetooth dongle it is highly recommended that you use the drivers that came on the CD with the dongle. Note that if you try to switch drivers, you have to uninstall the previous drivers first. This process will also require you to clear your Bluetooth contacts in the NXT.
I am seeing some other bad behavior.
1. Examine the output from the Console Output system service against a running DSS node (typically http://localhost:50000/console/output) where you can see errors and warnings identifying potential problems
2. Post your question to the Microsoft Robotics Studio Hardware Configuration and Troubleshooting forum.
KHR-1 Service Sample
The KHR-1 Service service provides a DSS service to interface with a Kondo KHR-1 robot.
You will also need Microsoft Internet Explorer or another conventional web browser.
Start the Microsoft Robotics Studio Command Prompt from the Start > All Programs menu.
Start a DssHost node and create an instance of the service by typing the following command:
dsshost /p:50000 /m:"samples\config\khr1service.manifest.xml"
This starts the service and you see a response like the following:
Initializing Dss Node with manifesfile:///C:/mri/config/khr1service.manifest.x
Start Internet Explorer (IE) and type the following URI in the Address bar:
http://localhost:50000/khr1
This displays the web page for the KHR1 service. To see the XML representation of the service state, use the following URI:
http://localhost:50000/khr1/raw
The KHR1 service state contains the following members:
· The COM port used to connect to the KHR1.
· A list of 2 servo control board states, each with an ID, speed, and 12 channels (each with a position).
The KHR1 service does not support subscriptions.
You can send the following messages to the KHR1 service:
· PlayMotion - Plays the specified preset motion.
· SetServoPosition - Sets the servo speed and positions for one control board.
The web interface to the KHR1 service allows you to change servo positions, play motions, turn the servos off and on, set the home position and read the current servo positions.
1. Specify a speed for the change. A value between 0 and 7, where 0 is fast and 7 is slow.
2. Set the servo positions as required. Servo positions are expressed in degrees between 0 and 180.
3. Press the Change button. Sends this information to the relevant servo board.
Enter the number of the preset motion to play in the Motion: text box and click the Play button.
The Sleep and Motion buttons turn the servos off and on respectively. This is useful for conserving battery power when the robot is not in use.
Pressing the Home button causes the KHR1 to store the current servo positions as its home position. It assumes this position when it is powered up.
Click the Read button to read the current servo positions. This can be useful after playing a motion when the state of the service is not in sync with the current servo positions.
The servo assignments on your Kondo KHR1 depend on the assembly of the robot. If the instructions provided by Kondo are followed, the servos are assigned as follows:
|
Board |
Channel |
Assignment |
|
0 |
1 |
Left Shoulder |
|
0 |
2 |
Left Elbow |
|
0 |
3 |
Left Wrist |
|
0 |
4 |
unused |
|
0 |
5 |
unused |
|
0 |
6 |
Head |
|
0 |
7 |
Right Shoulder |
|
0 |
8 |
Right Elbow |
|
0 |
9 |
Right Wrist |
|
0 |
10 |
unused |
|
0 |
11 |
unused |
|
0 |
12 |
unused |
|
1 |
1 |
Left Pelvis |
|
1 |
2 |
Left Hip |
|
1 |
3 |
Left Knee |
|
1 |
4 |
Left Ankle |
|
1 |
5 |
Left Foot |
|
1 |
6 |
unused |
|
1 |
7 |
Right Pelvis |
|
1 |
8 |
Right Hip |
|
1 |
9 |
Right Knee |
|
1 |
10 |
Right Ankle |
|
1 |
11 |
Right Foot |
|
1 |
12 |
unused |
MobileRobots Pioneer P3DX
First ensure that the P3DX robot has the correct prerequisites for running Microsoft Robotics Studio directly on the robot. To verify that the P3DX robot can run Microsoft Robotics Studio, use DSS Deploy Tool (DssDeploy.exe) to create a self-extracting deploy package with all the necessary files required to run the Explorer service which is the service described in Robotics Tutorial 5 (C#) - Using Advanced Services. To create and deploy the package follow these steps:
Execute the following command from an Microsoft Robotics Studio Command Prompt:
dssdeploy /p /m:"samples\config\explorer.manifest.xml" ExplorerDeployment.exe
Copy the generated deploy package file (ExplorerDeployment.exe) to the robot or mount a drive letter on your development PC to map to a drive on the robot.
Unpack the deploy package on the robot using the following command from a regular DOS command prompt on the robot:
dssdeploy /u /t:"C:\MSRS" ExplorerDeployment.exe
This will unpack the files neccessary to run the services on the robot into the C:\MSRS directory.
Run the Explorer service on the P3DX robot. To do so, open a DOS command prompt on the robot, navigate to the directory you created earlier, and start the DSS runtime as follows:
cd /d C:\MSRS
dsshost /p:50000 /t:50001 /m:"samples\config\explorer.manifest.xml"
The SICK Laser Range Finder normally takes a while to start up but after a minute or two you should see the robot start to navigate autonomously around the floor.
3. BASIC ROBOTICS TUTORIALS FOR VPL OVERVIEW
The basic robotics tutorials help you getting started writing the very first service for your robot. The tutorials take you from getting input from a single sensor to control an actuator to being able to write a "drive-by-wire" application where you can move your robot around.
Understanding how to use services is a key to the Microsoft Robotics Studio programming model. This tutorial starts you off with how to access a service for a simple sensor.
This tutorial builds on the previous tutorial and shows you how use the input from a simple sensor and use it to control a motor service.
This tutorial describes of a generic drive and contact service that you apply across a variety of hardware platform and includes a simple "wanderer" service.
This tutorial covers how to build a simple application to use a conventional Windows user interface to control a motor drive service.
|
See Also |
|
Robotics Basic Tutorials: Basic Robotics Tutorials Overview
Microsoft Robotics Studio
Robotics Tutorial 1 (VPL) - Accessing a Service
Writing an application using the Microsoft Robotics Studio is a simple matter of orchestrating input and output between a set of services. Services represent the interface to software or hardware and allow you to communicate between processes that perform specific functions.
This tutorial teaches you how to use a basic service that reads the output of a contact sensor (referred in this tutorial as a bumper) and displays a message in the Console window.
This tutorial is provided in the Microsoft Visual Programming Language (VPL) language. You can find the project files for this tutorial at the following location under the Microsoft Robotics Studio installation folder:
Sample location
Samples\RoboticsTutorials\Tutorial1\mvpl
You need a robot with microcontroller and a contact sensor. Contact sensors are typically simple mechanical switches that send a signal when physical contact is made. The sensor can also be distance detection devices (like sonars or infrared sensors) that provide a simple binary signal when a particular threshold is detected. Connect the sensor to your robot's microcontroller following the normal conventions for the hardware you are using.
To determine if support is included in Microsoft Robotics Studio for your robot and to setup your hardware, see Setting Up Your Hardware Overview. You may be able to apply this tutorial for other robots that provide similar services (or create your own services by performing the Service Tutorials included in Microsoft Robotics Studio). Setting up Your Hardware may also provide you with any recommended guidelines for setting up your PC to communicate with your robot.
This tutorial is designed for use with Microsoft Visual Programming Language.
Microsoft Visual Programming Language (VPL) is an application development environment designed on a graphical dataflow-based programming model rather than control flow typically found in conventional programming. Rather than a series of imperative commands sequentially executed, a dataflow program is more like a series of workers on an assembly line who do their assigned task as the materials arrive. As a result, VPL is well suited to programming a variety of concurrent or distributed processing scenarios.
VPL is targeted for beginning programmers with a basic understanding of concepts like variables and logic. However, VPL is not limited to novices. The compositional nature of the programming language may appeal to more advanced programmers for rapid prototyping or code development. In addition, while its toolbox is tailored for developing robot applications, the underlying architecture can be applied to other applications. As a result, VPL may appeal to a wide audience of users including students, enthusiasts/hobbyists, as well as possibly web developers and professional programmers.
You will also need Microsoft Internet Explorer or another conventional web browser.
Open the Microsoft Visual Programming Language development environment and create a new project by selecting New from the File menu.
Now drag a Generic Contact Sensors service from the Services toolbox. The activity block appears with the name GenericContactSensors.

Figure 1 - Start by adding a GenericContactSensors activity block.
Add a Data activity by dragging one from the Basic Activities toolbox into your diagram, to the right of the sensor service activity. Select string from the dropdown list and enter Ouch! in its text box.
Connect the ContactSensor's notification output, dragging from the round Notification connection on the ContactSensor activity, to the Data activity.
If you dragged the connection from the correct connection point, you should see the Connection dialog box. Choose Update and Create in the Connections dialog and click OK.

Figure 2 - The Connections Dialog Box
This sends the Update message from the ContactSensor to the Create action of the Data activity. While the Data activity does not use the data coming from ContactSensor, it uses the message to trigger the creation of the data ("Ouch!") you entered.
Your diagram should now look like the following illustration.

Figure 3 - Connected Sensor and Data Activities
Now drag a Simple Dialog service into your Dataflow window and place to the right of the Data block. Connect the two activities. In the Connections dialog which opens, select DataValue and AlertDialog then click OK.
In the Data Connections dialog box, select value as the value to be sent to the target Message. This means that the text "Ouch!" is sent as the message text of the alert form of the simple dialog.

Figure 4 - The Data Connections Dialog Box
Your diagram should now look like the following illustration.

Figure 5 - Connected Activities and Simple Dialog
The ContactSensor activity represents a generic service that can be applied to a contact (touch) sensor for different robots. Before you run your application, you need to tell VPL which sensor you want to use.
Right-click on the ContactSensor activity block to open its context pop-up menu. Select the Set Configuration command. In the dialog box that appears, under Set Configuration, select Use a manifest. If no manifest shows up in the list, select Import Manifest and chose the appropriate manifest for the sensor you are using, then click OK. You can also select one of the simulation manifests. The manifest should now be selected in the dropdown list.
Run your application by selecting the Run command from the Run menu or by pressing F5.
Robotics Tutorial 2 (VPL) - Coordinating Services
This tutorial builds on Robotics Tutorial 1 (VPL) - Accessing a Serviceby using a sensor to turn a motor on and off. Like the previous tutorial, it requires sensor and motor services for a robot compatible with Microsoft Robotics Studio. Also as in previous tutorial, you need to setup your robot hardware appropriately before running this tutorial.
This tutorial is provided in the Microsoft Visual Programming Language (VPL) language. You can find the project files for this tutorial at the following location under the Microsoft Robotics Studio installation folder:
Sample location
Samples\RoboticsTutorials\Tutorial2\mvpl
· Add, Configure, and Connect New Activities.
· Add and Initialize a Variable.
· Add and Configure an If Activity.
· Add and Configure a Simple Dialog Box and Generic Motor.
You need a robot with microcontroller and a contact sensor. Contact sensors are typically simple mechanical switches that send a signal when physical contact is made. The sensor can also be distance detection devices (like sonars or infrared sensors) that provide a simple binary signal when a particular threshold is detected. Connect the sensor to your robot's microcontroller following the normal conventions for the hardware you are using.
To determine if support is included in Microsoft Robotics Studio for your robot and to setup your hardware, see Setting Up Your Hardware Overview. You may be able to apply this tutorial for other robots that provide similar services (or create your own services by performing the Service Tutorials included in Microsoft Robotics Studio). Setting up Your Hardware may also provide you with any recommended guidelines for setting up your PC to communicate with your robot.
This tutorial is designed for use with Microsoft Visual Programming Language.
Microsoft Visual Programming Language (VPL) is an application development environment designed on a graphical dataflow-based programming model rather than control flow typically found in conventional programming. Rather than series of imperative commands sequentially executed, a dataflow program is more like a series of workers on an assembly line who do their assigned task as the materials arrive. As a result, VPL is well suited to programming a variety of concurrent or distributed processing scenarios.
VPL is targeted for beginning programmers with a basic understanding of concepts like variables and logic. However, VPL is not limited to novices. The compositional nature of the programming language may appeal to more advanced programmers for rapid prototyping or code development. In addition, while its toolbox is tailored developing robot applications, the underlying architecture can be applied to other applications. As a result, VPL may appeal to a wide audience of users including students, enthusiasts/hobbyists, as well as possibly web developers and professional programmers.
You will also need Microsoft Internet Explorer or another conventional web browser.
While you could modify and extend the previous tutorial application, this tutorial starts you from the beginning.
To begin, open the Microsoft Visual Programming Language development environment and create a new project by selecting New from the File menu.
Insert a Generic Contact Sensor Array service and a Calculate activity into your Dataflow window. Connect the two using the round event connection on the Generic Contact Sensor Array (the actual activity block displays its name, ContactSensor). In the Connections dialog box, select Update and Calculate as your connections. In the Calculate text box enter Pressed. A list containing the parameters that the ContactSensor output includes in its Update event opens.

Now add a Variable activity. Use its dropdown list to open the Variables dialog box and define a variable called MotorOn of type bool. Set the Variable activity to this MotorOn variable. You will use this variable to store the state of the robot motor. Connect the output of the Calculate activity block to the Variable input. Set the connections as CalculatedResult to Set Value.

To initialize the MotorOn variable, insert another Variable activity block and also set it to MotorOn. Then insert a Data activity and connect to this second Variable activity (from Data to Set Value). Select the boolData type and enter false in the text box. You don't need to connect these two activities to the rest of your dataflow in the diagram.

Now insert an If activity into your diagram. Place it to the right of the first Variable activity you inserted and connect the output of the Variable block to its input. This sends the current state of the variable to determine what to do next.

Next, insert four more Data activities. In the first, select string and enter Motor On. In the second, select double and enter 1.0. In the third, select string and enter Motor Off. In the fou