Here2 follow a very quick introduction on how to get started with Microsoft Robotics Developer Studio and Lego Mindstorms NXT. If you have attended one of my presentations on robotics or read my presentation, this is a good guide on getting started on your own. This is the quick and dirty guide to getting started, if you want to dig deeper there are lots of good links at the bottom of this post. This is not the post that will learn you RDS, you can get the introduction here.

Software and Installation

First you have to download and install Visual Studio if you don’t already have it. RDS supports every version of Visual Studio, from Express to Team Suite.

After the initial software preparations, you need to pair the Lego NXT with your computer. The easiest way to do this is to make the PC discoverable and start the pairing from the NXT brick. Make sure your computer is discoverable in the settings of your Bluetooth software.

Windows Vista Bluetooth Options

Then you can go into the Bluetooth option on the NXT and choose Search. Select your computer and complete the pairing process. When the pairing is completed, you might have to go into the Bluetooth devices control panel, go into the available services on the Lego NXT device and install the port service. This will install a new virtual COM port on your computer that is used to communicate between your Lego and your computer. Make sure you record what COM port it uses, this is important to know when you are configuring the RDS service later on.

Windows Device Manager

Opening and Configuring the Ultrasonic Explorer application

Instead of starting from scratch with an empty canvas inside Visual Programming Language (VPL), you should rather jump directly to the Ultrasonic Explorer example that is included with RDS. It’s located at the following path by default: "C:\Users\YourUserName\Microsoft Robotics Dev Studio 2008\samples\Diagrams\LEGO\UltrasonicExplorer\UltrasonicExplorer.mvpl".

(Side note: In the July CTP, the UltrasonicExplorer crashes when I double-click to open it, instead you can open VPL from the start menu and use the open file option. It crashes on two of my computers, so there is a chance that it will happen to you too)

Visual Programming Language diagram design surface

You will see a diagram like the one above and to quickly explain what it does, it will make your Lego NXT robot navigate around the room, using the ultrasonic sensor to avoid obstacles. Depending on how close it reaches to a particular obstacle, it does 3 different actions.

Before you can hit F5 to run the application, you need to configure the COM port to communicate with your NXT brick. Select the NxtBrick service in the diagram surface and expand the Configuration option that appears on the right. Enter the serial port on your computer and just forget about the other values.

VPL service configuration settings

Starting Your Robot

Hit the F5 or click the Start button to launch the application and watch how your Lego NXT robot roams around the house, trying to avoid any obstacle. Remember that it will take a short while for the computer to get everything initialized and for the robot to start driving.

If you have any problems with my instructions, please leave a comment and I can edit the post with some trouble-shooting instructions.

Extending The Visual Application

Before we are finished, you need to learn how to make your first extension and change to the VPL application. Inside the VPL application, start typing the letters “Text” in the “Find service…” input box. This will filter the services list and display services you can put onto the diagram surface. Drag and drop (or double-click) the “Text to speech (TTS)” service and place it somewhere close to the first NxtDrive service. Drag a link between the orange square on the right side of the NxtDrive onto the TexttoSpeechTSS service.

Connection Dialogs

In the Connections dialog, select the Success event on the left and the SayText operation on the right. In the next dialog, you can check the “Edit values directly” option and write any text you want the computer to say through your computer speakers whenever the robot gets really close to an obstacle.

The VPL diagram after changes

If your VPL diagram looks like this, then you can start your application again and now the robot will have a voice of it’s own. From now on, you’re own your own… but there are plenty of resources out there that teaches you how to write advanced VPL applications. A good place to start is the VPL introduction.

Lego NXT Links

Here are some links to blogs and sites that covers the Lego NXT robot.

Kostek: Thanks for checking out my blog and the sample. This post is a bit out of date at the moment and I suggest having a look at the latest version of Microsoft Robotics Developer Studio here: http://www.microsoft.com/robotics/

So your problem might actually be related to the sample I wrote being built for an older version of the Robotics Developer Studio.

I ensured the com ports are identical in VPL wheb config the NXT brick com port to 5 in accordance with NXT Bluetooth Device, Properties, Hardware, Com 5. However, when I run my VPL it shows “false” connection. What exactly do you mean by “Go into the available services on the Lego NXT device and install the port service. ” Can you email me your phone number?

I suggest going to the official site for the latest changes and updates to how to work with Microsoft Robotics Developer Studio. I might make another article like this with the latest version at a later time.