Saturday, September 08, 2007

Microsoft Robotics Studio - First Sight

Microsoft Robotics Studio (MRS)

I have recently come accross this great piece of new technology, offered for free by big MS [1]. MRS allows to program robots and other external devices via a visual programming language (VPL) or your prefered .NET programming language, such as VB.NET or C#. MRS main abstraction is a service.
Assuming you use VPL, a service is graphically represented as a box. Services exist in their own space and can be combined via message passing. In fact, services communicate via a SOAP-like protocol. This communication act is graphically represented by wires between services. Where such a wire connects the output of one service to the input of another. It is up to the developer of a service to decide what a service does, i.e. what kind kind of messages a service understands and what output a service produces. Therefore one can develop rather simple services such as a NoOP service, which does nothing, to a more complex service that for example takes a picture from a webcam. The great news is that MS ships MRS with a bunch of pre-built services, such as a Text-to-Speech service. This service takes some input message and renders it as its audio representive.
Since I have been able to play around with MRS, I wanted to share my first project, which calculates the greatest common divisor of two positive integer number m and n. Currently it is assumed that m is greater than n. The main routine that computes the gcd of m and n can be seen below here. As in yesterdays post, we make use of the fact that gcd (m, n) = gcd (n, r) where n = m % n and % is defined as the modulus of m and n. At the moment there is no swapping of m and n, in case n is greater than m (gcd (m,n) = gcd(n,m)). A possible example setting can be seen here. This example simply takes 10 and 5 as input and produces the expected output 5. I hope that this simple service will be one of many to come on my road to do cool stuff with MRS.

[1] Microsoft Robotics Studio: http://msdn2.microsoft.com/de-de/robotics/bb625969.aspx

No comments: