Welcome to the early version of www.mrs.systronix.com
This web site is the work of Systronix Inc.
Some of my first impressions of Microsoft Robotic Studio (MRS for short) have been presented at the Java.net robotics community and on the Lego user group mail list. There are many compelling reasons to look very closely at MSR. A lot of people are dismissing MRS just because it's from Microsoft. That's unfortunate (the dismissal) since they may be missing out on something really good.
Enough opinion; let's get busy:
Where to Start: Lego NXT
So, after some hours of wheel-spinning trying to figure out how to write our own DLL for the transducers on the Java.net Robot Fusion project, we have decided to retrench and start much simpler. One obvious and affordable approach is to use off the shelf hardware and software. In this case that means the new Lego NXT Mindstorms kit, a PC, MRS software (the Nov 2006 release), and a Bluetooth adapter (Targus ACB10US from the nearby Staples store). Also I have a Bluetooth phone, the Motorola Razr V3. Let's not forget batteries. I have a box of new Powerizer AA NiMH 2300 mAHr, and a great little Ultra rapid charger with (a surprisingly useful) LCD display. It charges each battery individually and the LCD shows the progress of each battery.
Ultra rapid charger w/LCD
Get the NXT controller brick running
The NXT box claims "your first robot in 30 minutes" but since I'm writing and photographing as I go (my friend and fellow Lego wizard Russ calls this 'leaving a trail of bread crumbs') it may take a bit longer. Indeed, it takes me 30 minutes to open the box and hook up the first NXT light sensor demo program, which only requires installing batteries, plugging in the light sensor and running the built in example program.
Install PC Bluetooth adapter
The Targus adapter comes with a cute mini-CD install disk which must be used before plugging in the USB adapter. Note that this adapter isn't on the Lego approved list, but is on this much larger list: http://www.vialist.com/users/jgarbers/NXTBluetoothCompatibilityList. The Targus adapter is actually a Broadcom BCM2045 device. The Installshield Wizard pops up window after window while my IBM/Lenovo T43 bings away at me as one USB driver after another gets installed. But we're not done yet; now the adapter must be configured. I decide to enable everything except FAX.
It's so small I'm a bit worried about losing it...
Connect NXT brick to PC
OK, now turn the NXT BT on, make it visible, and tell it to search. It finds my PC quickly. Now the NXT docs don't seem to match the actual brick LCD GUI. Here's what seems to work: tell the NXT to search, tell the PC BT to discover services, then select the PC name on the NXT. Then the PC asks for the NXT passkey. Enter that on the PC and it discovers two BT serial connections, "Dev A on NXT" and "Dev B on NXT" . But I'm not sure these are really valid. The PC just seems to not know anything about available NXT services.
Mindstorms has a Bluetooth area at http://mindstorms.lego.com/overview/Bluetooth.aspx and there is a list of approved BT adapters there. The NXT Mindstorms User Guide references that web page for BT phone information and it is on the page http://mindstorms.lego.com/overview/Mobile%20Application.aspx - but no Motorola phones are supported. That's too bad... But there is an NXT Bluetooth Developer kit in the Mindstorms NXTreme web area.
Configure NXT to work with MRS
This web page http://msdn.microsoft.com/robotics/learn/tutorials/platforms/lego/ntx/default.aspx has detailed instructions. So here goes.
First, though, how about wasting a couple of hours by experiencing the "dreaded clicking NXT syndrome"? Sounds great, so let's go:
the hidden NXT reset switch
Your First Robot in 30 Minutes
... or so claims the NXT Quick Start. It took me an hour, even with help from a 4- and 8- year old. It's very simple, with three motors (one is an inactive chassis element only) and no sensors, so it can't avoid running into things. It uses demo code built into the NXT brick. The brick is held up at about a 45° angle so it would not fit back into the Lego box at all, or my suitcase very well. But it runs and should allow control by MRS.
Connect NXT to MRS
The MSR NXT tutorial page has very clear instructions on how to connect NXT to PC/BT/MRS. In my case it connected on COM16. Then navigate on NXT to My Files, Software Files, and execute main. Woohoo! - we get the MSR screen on the NXT:
Now, how to start MSR? Try "Start Default DSS Node" which eventually starts a browser, after I tell Firewall that Intranet Settings are OK. Now there is a browser open to URL http://localhost:50000/ hmm, no COM port config, so try to start the NXT Brick service, now I get a popup window at URL http://ibm-t43-bab:50000/legonxt/604a8bf2-05a5-4560-b829-f84c2958d938 asking me to configure the BT connection, but the NXT brick goes to sleep before I can do this. No I have to start all over with the NXT connection, and this time it fails until I Stop the Bluetooth Device and then restart it. Hmmm.
Try to start the Lego NXT Brick service, without manifest. A browser window opens to config the BT connection but the connection never completes.OK, try again:
Try to use the MRS Simulator:
(Next day, Dec 04) Follow the simulator tutorial at http://msdn.microsoft.com/robotics/getstarted/simulation/sim1/default.aspx but I get nonsensical errors like "DssHost.exe is not a valid Win32 application". So, do a repair install of MRS.
Now it complains about the manifest file:
C:\Microsoft Robotics Studio (November 2006)>bin\dsshost /port:50000 /manifest:"config\SimulationTutorial1.manifest.xml"
Invalid manifest identifier: file:///C:/Microsoft%20Robotics%20Studio%20(November%202006)/config/SimulationTutorial1.manifest.xml
Aha, there's an error on the web page. The command line should be:
bin\dsshost /port:50000 /manifest:"config\SimulationTutorial1.manifest.xml"
note that the config folder with the manifest is under the samples folder, it's not the config folder which is under the MRS root.
That fixes it and now the simulator starts. It runs OK for a while then inexplicably terminates:
C:\Microsoft Robotics Studio (November 2006)>bin\dsshost /port:50000 /manifest:"samples\Config\SimulationTutorial1.manifest.xml"
* Starting manifest load: file:///C:/Microsoft%20Robotics%20Studio%20(November%202006)/samples/Config/SimulationTutorial1.manifest
* Manifest load complete [http://ibm-t43-bab:50000/manifestloaderclient]
* Service uri: [http://ibm-t43-bab:50000/simulationtutorial1]
* Starting OBJ file conversion to BOS format:C:\Microsoft Robotics Studio (November 2006)\store\media\earth.obj
* Finished OBJ file conversion to BOS format:C:\Microsoft Robotics Studio (November 2006)\store\media\earth.obj
*** Object reference not set to an instance of an object. [http://ibm-t43-bab:50000/simulationengine]
It does restart again...
...though it sucks up most of my notebook resources and there doesn't seem to be a way to pause it or slow it down.
Since I'm on a roll, try the Simulation Tutorial 2 and zoom in on the NXT model:
and there is also a dashboard:
Invoking Task Manager causes the simulator to abruptly terminate with this
*** Object reference not set to an instance of an object. [http://ibm-t43-bab:50000/simulationengine]
There are five simulation tutorials and they are prebuilt. You don't actually need to build them with the C# compiler (but you can use the free Express 2005 edition).
Try to debug the NXT-MRS interface
There is an MRS forum at http://www.microsoft.com/communities/newsgroups/en-us/default.aspx
and searching on NXT turns up some possibly helpful tips which are worth pasting here:
Are you initiating the connection from the LEGO to the PC? If so, that is
the problem. The October release requires the connection to be established
from the PC to the LEGO.
Also, I use a tool called PortMon from www.sysinternals.com which lets me
watch the communication over the serial port. This is very helpful to
pinpoint this type of problem.
Another thing to check is the console output service. While your service is
running, open a web browser and navigate to:
http://localhost:50000/console/output. You may need to change the "50000" if
you are running on another port. In general, you will see details for any
errors on this page.
So, there appear to be some discrepancies between the website tutorials
and the actual instructions for a specific MRS release. I'll try some of
these tomorrow. There is a readme file in the MRS NXT install folder at
C:\Microsoft Robotics Studio (November 2006)\samples\Platforms\LEGO\NXT
...and indeed it contradicts the website instructions -- the connection to NXT must now be initiated from the PC for the Nov CTP release.
Had to punt on a working demo for the OMG presentation
So after way too many hours of grappling with all the above, I was unable to show a working MRS-NXT demo for a talk at OMG. This was a bit embarrassing for me and a disappointment for my colleagues as there is a lot of interest in the Studio. So instead my presentation covered the architecture of MRS and DSSP, and the hardware of the NXT. In the three months before the next OMG meeting I have pledged to figure this all out and make a further report.
Why is this proving so hard?
At the Washington OMG technical meeting I met several other people who had spent some time trying to get MRS to work with NXT. None had achieved much more success than I had. This is very puzzling to me, since I saw several MRS demos back in June at RoboDev, and MRS has been getting a lot of press coverage as The Next Big Thing, so it would be natural to assume that it really does work.
There are several layers to the PC-Bluetooth-MRS-NXT combination:
So what we could try to do is find other applications which use each of these portions of the system and test them independently. For example if we can get some other use of the Bluetooth adapter to work reliably then we can rule out any Bluetooth-related issues.
References and Links:
The official Lego NXT site is http://mindstorms.lego.com/default.aspx
The official Microsoft Robotic Studio resource is http://msdn.microsoft.com/robotics/
Detailed description of the MRS application model: http://msdn.microsoft.com/robotics/getstarted/prgmmodel/default.aspx
Credits, thanks and whom to blame:
All the photos here are courtesy of Bruce Boyes - peruse their metadata for a bit more information. Lego, Microsoft, Java, etc are trademarks of Lego, Microsoft, Sun Microsystems, or their respective owner. Thanks to Radio Paradise for great music by which to work.