Getting Started with Microsoft RDS and Lego NXT

lego-nxt-robot 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.

Secondly you have to download and install Microsoft RDS, preferably you should jump straight on the latest version (Currently in 2008 July CTP version).

Pair Your Robot with Your Computer

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.

Bluetooth
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.

devices
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)

VPL
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_Configuration
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.

Connections DataConnections
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.

TextToSpeech
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.

RobotThoughts
Lego Mindstorms NXT Forum
Official Lego NXT Home
FirstLegoLeague
Norwegian Robotics User Group
Microsoft Robotics Studio and Lego Mindstorms NXT (bit outdated, there are new and improved Lego services in RDS 2008 which does no longer require installation on the NXT brick)

Here you can download my latest RDS presentation:


Add comment


(Will show your Gravatar icon)  

  Country flag


  • Comment
  • Preview
Loading



Pages

Search

Tags

None

    Recent posts

    Recent comments

    Blogroll

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.